summaryrefslogtreecommitdiff
path: root/packaging/rust-async-executor.spec
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/rust-async-executor.spec')
-rw-r--r--packaging/rust-async-executor.spec30
1 files changed, 27 insertions, 3 deletions
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