summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/extern.patch18
-rw-r--r--packaging/rust-async-executor.spec30
2 files changed, 27 insertions, 21 deletions
diff --git a/packaging/extern.patch b/packaging/extern.patch
deleted file mode 100644
index 119357b..0000000
--- a/packaging/extern.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/src/lib.rs b/src/lib.rs
-index 24fbfac..29a30d4 100644
---- a/src/lib.rs
-+++ b/src/lib.rs
-@@ -20,6 +20,13 @@
-
- #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
-
-+extern crate futures_lite;
-+extern crate async_lock;
-+extern crate async_task;
-+extern crate concurrent_queue;
-+extern crate slab;
-+extern crate fastrand;
-+
- use std::future::Future;
- use std::marker::PhantomData;
- use std::panic::{RefUnwindSafe, UnwindSafe};
diff --git a/packaging/rust-async-executor.spec b/packaging/rust-async-executor.spec
index def6d61..a0a6787 100644
--- a/packaging/rust-async-executor.spec
+++ b/packaging/rust-async-executor.spec
@@ -15,7 +15,6 @@ License: Apache-2.0 OR MIT
URL: https://crates.io/crates/async-executor
Source: %{crate}-%{version}.tar.gz
Source1: %{name}.manifest
-Source2: extern.patch
# ==========================================================
# BuildRequires
@@ -39,11 +38,13 @@ Requires: rust-slab
# ==========================================================
# dev-dependencies
# ==========================================================
+%if 0%{?run_tests}
# BuildRequires: rust-async-channel
# BuildRequires: rust-async-io
# BuildRequires: rust-easy-parallel
# BuildRequires: rust-num_cpus
-# BuildRequires: rust-once_cell
+BuildRequires: rust-once_cell
+%endif
%description
@@ -52,7 +53,6 @@ Async executor.
%prep
%setup -q
cp %{SOURCE1} .
-%{__patch} -p1 < %{SOURCE2}
# ==========================================================
# build section
@@ -62,6 +62,12 @@ cp %{SOURCE1} .
%{rustc_std_build} --crate-type=dylib \
--crate-name=%{real_crate_name} \
%{?rustc_edition:--edition=%{rustc_edition}} \
+ %rust_dylib_extern futures_lite \
+ %rust_dylib_extern async_lock \
+ %rust_dylib_extern async_task \
+ %rust_dylib_extern concurrent_queue \
+ %rust_dylib_extern slab \
+ %rust_dylib_extern fastrand \
./src/lib.rs
# ==========================================================
@@ -71,6 +77,24 @@ cp %{SOURCE1} .
install -d -m 0755 %{buildroot}%{_rust_dylibdir}
install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_rust_dylibdir}/lib%{real_crate_name}.so
+%check
+%if 0%{?run_tests}
+%{rustc_std_build} --test --crate-type=dylib \
+ --crate-name=%{real_crate_name} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ --extern %{real_crate_name}=lib%{real_crate_name}.so \
+ %rust_dylib_extern futures_lite \
+ %rust_dylib_extern async_lock \
+ %rust_dylib_extern async_task \
+ %rust_dylib_extern concurrent_queue \
+ %rust_dylib_extern slab \
+ %rust_dylib_extern fastrand \
+ %rust_dylib_extern once_cell \
+ ./tests/drop.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig