+++ /dev/null
-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};
URL: https://crates.io/crates/async-executor
Source: %{crate}-%{version}.tar.gz
Source1: %{name}.manifest
-Source2: extern.patch
# ==========================================================
# BuildRequires
# ==========================================================
# 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
%prep
%setup -q
cp %{SOURCE1} .
-%{__patch} -p1 < %{SOURCE2}
# ==========================================================
# build section
%{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
# ==========================================================
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