summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/extern.patch16
-rw-r--r--packaging/rust-async-stream-impl.spec20
2 files changed, 28 insertions, 8 deletions
diff --git a/packaging/extern.patch b/packaging/extern.patch
index ccd0e98..6140b86 100644
--- a/packaging/extern.patch
+++ b/packaging/extern.patch
@@ -1,13 +1,13 @@
diff --git a/src/lib.rs b/src/lib.rs
-index 082f734..fbab2eb 100644
+index 082f734..ced08f8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
-@@ -1,3 +1,8 @@
+@@ -4,6 +4,8 @@ use quote::quote;
+ use syn::parse::{Parse, ParseStream, Parser, Result};
+ use syn::visit_mut::VisitMut;
+
+extern crate proc_macro;
-+extern crate proc_macro2;
-+extern crate quote;
-+extern crate syn;
+
- use proc_macro::TokenStream;
- use proc_macro2::{Group, TokenStream as TokenStream2, TokenTree};
- use quote::quote;
+ struct Scrub<'a> {
+ /// Whether the stream is a try stream.
+ is_try: bool,
diff --git a/packaging/rust-async-stream-impl.spec b/packaging/rust-async-stream-impl.spec
index d2e98bc..bda1074 100644
--- a/packaging/rust-async-stream-impl.spec
+++ b/packaging/rust-async-stream-impl.spec
@@ -26,6 +26,10 @@ BuildRequires: rust-proc-macro2
BuildRequires: rust-quote
BuildRequires: rust-syn
+Requires: rust-proc-macro2
+Requires: rust-quote
+Requires: rust-syn
+
# ==========================================================
# dev-dependencies
# ==========================================================
@@ -50,6 +54,9 @@ cp %{SOURCE1} .
%{rustc_std_build} --crate-type=proc-macro \
--crate-name=%{real_crate_name} \
%{?rustc_edition:--edition=%{rustc_edition}} \
+ %rust_dylib_extern proc_macro2 \
+ %rust_dylib_extern quote \
+ %rust_dylib_extern syn \
./src/lib.rs
# ==========================================================
@@ -59,6 +66,19 @@ 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=proc-macro \
+ --crate-name=%{real_crate_name} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ %rust_dylib_extern proc_macro2 \
+ %rust_dylib_extern quote \
+ %rust_dylib_extern syn \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig