[packages/maturin] attempt to fix build on x32
atler
atler at pld-linux.org
Sun Mar 16 03:18:48 CET 2025
commit 0ff5785524d641c8beef60d22ca524e79c0006d9
Author: Jan Palus <atler at pld-linux.org>
Date: Sun Mar 16 01:31:17 2025 +0100
attempt to fix build on x32
maturin.spec | 7 +++++++
x32.patch | 14 ++++++++++++++
2 files changed, 21 insertions(+)
---
diff --git a/maturin.spec b/maturin.spec
index cbd1b5e..2e8768c 100644
--- a/maturin.spec
+++ b/maturin.spec
@@ -14,6 +14,7 @@ Source0: https://github.com/PyO3/maturin/archive/v%{version}/%{name}-%{version}.
# ./create-crates.sh
Source1: %{name}-crates-%{crates_ver}.tar.xz
# Source1-md5: c15d367a752fc0c9997eb4c6a95f7df5
+Patch0: x32.patch
URL: https://github.com/PyO3/maturin
BuildRequires: cargo
BuildRequires: rpmbuild(macros) >= 2.004
@@ -44,6 +45,12 @@ Maturin bindings for Python.
%{__mv} maturin-%{crates_ver}/* .
sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
+old_sum=$(sha256sum vendor/ring/src/cpu/intel.rs|cut -f1 -d' ')
+%patch -P0 -p0
+new_sum=$(sha256sum vendor/ring/src/cpu/intel.rs|cut -f1 -d' ')
+test "$old_sum" != "$new_sum"
+%{__sed} -i -e "s/$old_sum/$new_sum/" vendor/ring/.cargo-checksum.json
+
# use our offline registry
export CARGO_HOME="$(pwd)/.cargo"
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..e519084
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,14 @@
+--- vendor/ring/src/cpu/intel.rs.orig 2025-03-03 10:19:43.000000000 +0100
++++ vendor/ring/src/cpu/intel.rs 2025-03-16 01:30:12.911412520 +0100
+@@ -27,9 +27,9 @@
+ const _ASSUMES_SSE2: () =
+ assert!(cfg!(target_feature = "sse") && cfg!(target_feature = "sse2"));
+
+- #[cfg(target_arch = "x86_64")]
++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+ const _ASSUMED_POINTER_SIZE: usize = 8;
+- #[cfg(target_arch = "x86")]
++ #[cfg(any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "32")))]
+ const _ASSUMED_POINTER_SIZE: usize = 4;
+ const _ASSUMED_USIZE_SIZE: () = assert!(core::mem::size_of::<usize>() == _ASSUMED_POINTER_SIZE);
+ const _ASSUMED_REF_SIZE: () =
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/maturin.git/commitdiff/0ff5785524d641c8beef60d22ca524e79c0006d9
More information about the pld-cvs-commit
mailing list