Add cpufeatures
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 5 Apr 2023 01:18:38 +0000 (10:18 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 5 Apr 2023 01:18:38 +0000 (10:18 +0900)
packaging/rust-aes.spec

index 0d0ea3ea5cc36166eee86a079f1d5c5021e2ed0f..9d17c47410f21696e2d8321d67275efa2d09a36d 100644 (file)
@@ -28,6 +28,7 @@ BuildRequires:  rust-zeroize
 
 Requires:       rust-cfg-if
 Requires:       rust-cipher
+Requires:       rust-cpufeatures
 
 # ==========================================================
 # dev-dependencies
@@ -48,12 +49,16 @@ cp %{SOURCE1} .
 # crate-type : dylib, proc-macro, cdylib, bin, etc.
 # ==========================================================
 %build
+%ifarch %{ix86} aarch64 x86_64
+export _RUSTC_EXTERN_PACKAGES_="--extern cpufeatures=%{_rust_dylibdir}/libcpufeatures.so"
+%endif
 %{rustc_std_build} --crate-type=dylib \
         --crate-name=%{real_crate_name} \
         %{?rustc_edition:--edition=%{rustc_edition}} \
-        %rust_dylib_extern cipher \
-        %rust_dylib_extern cfg_if \
         --cfg='feature="hazmat"' \
+        %rust_dylib_extern cfg_if \
+        %rust_dylib_extern cipher \
+        $_RUSTC_EXTERN_PACKAGES_ \
         ./src/lib.rs
 
 # ==========================================================