From 19e99e2379cee7c4c026849ad3109600249f1c5d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 16 Mar 2023 14:42:38 +0900 Subject: [PATCH] Bump to rust-lazycell 1.3.0 --- packaging/extern.patch | 16 ++++++++++ packaging/rust-lazycell.manifest | 5 +++ packaging/rust-lazycell.spec | 69 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 packaging/extern.patch create mode 100644 packaging/rust-lazycell.manifest create mode 100644 packaging/rust-lazycell.spec diff --git a/packaging/extern.patch b/packaging/extern.patch new file mode 100644 index 0000000..eba9600 --- /dev/null +++ b/packaging/extern.patch @@ -0,0 +1,16 @@ +diff --git a/src/lib.rs b/src/lib.rs +index 53bee07..50ae85b 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -44,10 +44,8 @@ + //! coordination in a thread-safe fashion. The limitation of an `AtomicLazyCell` + //! is that after it is initialized, it can't be modified. + ++extern crate std; + +-#[cfg(not(test))] +-#[macro_use] +-extern crate core as std; + #[cfg(feature = "serde")] + extern crate serde; + diff --git a/packaging/rust-lazycell.manifest b/packaging/rust-lazycell.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/rust-lazycell.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/rust-lazycell.spec b/packaging/rust-lazycell.spec new file mode 100644 index 0000000..64fd808 --- /dev/null +++ b/packaging/rust-lazycell.spec @@ -0,0 +1,69 @@ +# Generated by rust2rpm 23 +%global _rpm_strip_disable 1 +%global debug_package %{nil} + +%global crate lazycell +%global real_crate_name lazycell +%global rustc_edition 2015 + +Name: rust-lazycell +Version: 1.3.0 +Release: 1 +Summary: Library providing a lazily filled Cell struct + +# Upstream license specification: MIT/Apache-2.0 +License: MIT OR Apache-2.0 +URL: https://crates.io/crates/lazycell +Source: %{crate}-%{version}.tar.gz +Source1: %{name}.manifest +Source2: extern.patch + +# ========================================================== +# BuildRequires +# specifies build-time dependencies for the package +# ========================================================== +BuildRequires: rust +BuildRequires: rust-serde + +# BuildRequires: rust-clippy + + +%description +Library providing a lazily filled Cell struct. + +%prep +%setup -q +cp %{SOURCE1} . +%{__patch} -p1 < %{SOURCE2} + +# ========================================================== +# build section +# crate-type : dylib, proc-macro, cdylib, bin, etc. +# ========================================================== +%build +%{rustc_std_build} --crate-type=dylib \ + --crate-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + ./src/lib.rs + +# ========================================================== +# install section +# ========================================================== +%install +install -d -m 0755 %{buildroot}%{_rust_dylibdir} +install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_rust_dylibdir}/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 +%{_rust_dylibdir}/lib%{real_crate_name}.so -- 2.7.4