Bump to rust-proc-macro2 1.0.51
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 7 Feb 2023 05:47:16 +0000 (14:47 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 8 Feb 2023 07:17:36 +0000 (16:17 +0900)
packaging/extern_core-unicode_ident.patch [new file with mode: 0644]
packaging/rust-proc-macro2.manifest [new file with mode: 0644]
packaging/rust-proc-macro2.spec [new file with mode: 0644]

diff --git a/packaging/extern_core-unicode_ident.patch b/packaging/extern_core-unicode_ident.patch
new file mode 100644 (file)
index 0000000..279831c
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 261c167..3a763a3 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -121,6 +121,9 @@ compile_error! {"\
+ #[cfg(use_proc_macro)]
+ extern crate proc_macro;
++extern crate core;
++extern crate unicode_ident;
++
+ mod marker;
+ mod parse;
+ mod rcvec;
diff --git a/packaging/rust-proc-macro2.manifest b/packaging/rust-proc-macro2.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/rust-proc-macro2.spec b/packaging/rust-proc-macro2.spec
new file mode 100644 (file)
index 0000000..2e9fdeb
--- /dev/null
@@ -0,0 +1,68 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate proc-macro2
+%global real_crate_name proc_macro2
+
+Name:           rust-proc-macro2
+Version:        1.0.51
+Release:        1%{?dist}
+Summary:        Substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case
+
+License:        MIT OR Apache-2.0
+URL:            https://crates.io/crates/proc-macro2
+Source:         %{crate}-%{version}.tar.gz
+Source1:        %{name}.manifest
+Source2:        extern_core-unicode_ident.patch
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires:  rust
+BuildRequires:  rust-unicode-ident
+
+
+%description
+Substitute implementation of the compiler's `proc_macro` API to decouple token-
+based libraries from the procedural macro use case.
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+%{__patch} -p1 < %{SOURCE2}
+
+# ==========================================================
+# build section
+# ==========================================================
+%build
+rust_std=$(find %{_libdir} -maxdepth 1 -name "libstd-*\.so")
+rustc -C prefer-dynamic \
+          --crate-type=dylib \
+          --crate-name="%{real_crate_name}" \
+          --extern std=${rust_std} \
+          -L%{_libdir} -lunicode_ident \
+          ./src/lib.rs
+
+# ==========================================================
+# install section
+# ==========================================================
+%install
+install -d -m 0755 %{buildroot}%{_libdir}
+install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_libdir}/lib%{real_crate_name}.so
+
+%clean
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+# ==========================================================
+# files section
+# ==========================================================
+%files
+%manifest %{name}.manifest
+%license LICENSE-APACHE
+%license LICENSE-MIT
+%{_libdir}/lib%{real_crate_name}.so