[packages/rpm-pld-macros] explicitly handle x32 in %cargo macros

atler atler at pld-linux.org
Wed Mar 31 00:20:38 CEST 2021


commit c0244625859f7edafc554812411d17121dcb3be6
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Mar 31 00:08:49 2021 +0200

    explicitly handle x32 in %cargo macros
    
    appears to be cross-compiled so needs special treatment

 macros.rust | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/macros.rust b/macros.rust
index 0219554..e402ac6 100644
--- a/macros.rust
+++ b/macros.rust
@@ -3,13 +3,20 @@
 
 %__cargo	/usr/bin/cargo
 %__cargo_common_opts	-v --offline
-%cargo_build { \
-	RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \
-	%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \
-	%{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \
-}
-%cargo_install { \
-	RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \
-	%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \
-	%{__cargo} %{__cargo_common_opts} install \
-}
+%cargo_build \\\
+	RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
+	%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
+	%{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
+%ifarch x32 \
+	--target x86_64-unknown-linux-gnux32 \\\
+%endif \
+%{nil}
+
+%cargo_install \\\
+	RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
+	%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
+	%{__cargo} %{__cargo_common_opts} install \\\
+%ifarch x32 \
+	--target x86_64-unknown-linux-gnux32 \\\
+%endif \
+%{nil}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/f62a5c22000a98a4962fec65f376b87db0667e20



More information about the pld-cvs-commit mailing list