--- /dev/null
+diff --git a/src/char.rs b/src/char.rs
+index 939b6b4..ae337aa 100644
+--- a/src/char.rs
++++ b/src/char.rs
+@@ -10,6 +10,8 @@
+ //
+ // Original authors: alexchrichton, bluss
+
++extern crate matches;
++
+ // UTF-8 ranges and tags for encoding characters
+ const TAG_CONT: u8 = 0b1000_0000;
+ const TAG_TWO_B: u8 = 0b1100_0000;
URL: https://crates.io/crates/arrayvec
Source: %{crate}-%{version}.tar.gz
Source1: %{name}.manifest
+Source2: matches_extern.patch
# ==========================================================
# BuildRequires
# ==========================================================
# dev-dependencies
# ==========================================================
+%if 0%{?run_tests}
# BuildRequires: rust-bencher
-# BuildRequires: rust-matches
# BuildRequires: rust-serde_test
+BuildRequires: rust-matches
+%endif
%description
%prep
%setup -q
cp %{SOURCE1} .
+%if 0%{?run_tests}
+%{__patch} -p1 < %{SOURCE2}
+%endif
# ==========================================================
# build section
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}} \
+ %rust_dylib_extern matches \
+ --cfg='feature="std"' \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig