From 666d91b278c5419915ce73a3d35369b32952b208 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 10 Mar 2023 13:17:17 +0900 Subject: [PATCH] Bump to rust-async-global-executor 2.3.1 --- packaging/extern.patch | 31 +++++++ packaging/rust-async-global-executor.manifest | 5 ++ packaging/rust-async-global-executor.spec | 90 +++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 packaging/extern.patch create mode 100644 packaging/rust-async-global-executor.manifest create mode 100644 packaging/rust-async-global-executor.spec diff --git a/packaging/extern.patch b/packaging/extern.patch new file mode 100644 index 0000000..5cd9f72 --- /dev/null +++ b/packaging/extern.patch @@ -0,0 +1,31 @@ +diff --git a/src/lib.rs b/src/lib.rs +index 0900941..dae8eb9 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -31,6 +31,14 @@ + #[cfg(doctest)] + doc_comment::doctest!("../README.md"); + ++extern crate blocking; ++extern crate once_cell; ++extern crate async_io; ++extern crate async_lock; ++extern crate async_channel; ++extern crate async_executor; ++extern crate futures_lite; ++ + pub use async_executor::Task; + pub use config::GlobalExecutorConfig; + pub use executor::{block_on, spawn, spawn_blocking, spawn_local}; +diff --git a/src/tokio.rs b/src/tokio.rs +index a594640..d7fb69d 100644 +--- a/src/tokio.rs ++++ b/src/tokio.rs +@@ -1,5 +1,6 @@ + use once_cell::sync::Lazy; +-use tokio_crate as tokio; ++ ++extern crate tokio; + + pub(crate) fn enter() -> tokio::runtime::EnterGuard<'static> { + RUNTIME.enter() diff --git a/packaging/rust-async-global-executor.manifest b/packaging/rust-async-global-executor.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/rust-async-global-executor.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/rust-async-global-executor.spec b/packaging/rust-async-global-executor.spec new file mode 100644 index 0000000..9b073c0 --- /dev/null +++ b/packaging/rust-async-global-executor.spec @@ -0,0 +1,90 @@ +# Generated by rust2rpm 23 +%global _rpm_strip_disable 1 +%global debug_package %{nil} + +%global crate async-global-executor +%global real_crate_name async_global_executor +%global rustc_edition 2021 + +Name: rust-async-global-executor +Version: 2.3.1 +Release: 1 +Summary: Global executor built on top of async-executor and async-io + +License: Apache-2.0 OR MIT +URL: https://crates.io/crates/async-global-executor +Source: %{crate}-%{version}.tar.gz +Source1: %{name}.manifest +Source2: extern.patch + +# ========================================================== +# BuildRequires +# specifies build-time dependencies for the package +# ========================================================== +BuildRequires: rust +BuildRequires: rust-async-channel +BuildRequires: rust-async-executor +BuildRequires: rust-async-io +BuildRequires: rust-async-lock +BuildRequires: rust-blocking +BuildRequires: rust-futures-lite +BuildRequires: rust-once_cell +BuildRequires: rust-tokio + +Requires: rust-async-channel +Requires: rust-async-executor +Requires: rust-async-io +Requires: rust-async-lock +Requires: rust-blocking +Requires: rust-futures-lite +Requires: rust-once_cell +Requires: rust-tokio + +# ========================================================== +# dev-dependencies +# ========================================================== +# BuildRequires: rust-doc-comment + + +%description +Global executor built on top of async-executor and async-io. + +%prep +%setup -q +cp %{SOURCE1} . +%{__patch} -p1 < %{SOURCE2} + +# ========================================================== +# build section +# crate-type : dylib, proc-macro, cdylib, bin, etc. +# ========================================================== +%build +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:%{_rust_dylibdir} +%{rustc_std_build} --crate-type=dylib \ + --crate-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + --cfg='feature="async-io"' \ + --cfg='feature="tokio"' \ + ./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.34.1