summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2023-04-14 14:35:09 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2023-04-14 14:35:09 +0900
commitf1971407b3c07388373d608ae8912e67980442b3 (patch)
tree193aa5d5d408065b3a151ac1d78c54adc4100ef9
parent6a6f18a22315e3005dce85f150482ed4d92541d6 (diff)
downloadrust-async-stream-impl-tizen.tar.gz
rust-async-stream-impl-tizen.tar.bz2
rust-async-stream-impl-tizen.zip
[ 26s] running 0 tests [ 26s] [ 26s] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-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