void-packages/srcpkgs/python-argon2/patches/disable-sse-for-cross.patch
2018-10-08 08:02:39 -03:00

23 lines
844 B
Diff

Source: Rasmus Thomsen <rasmus.thomsen@protonmail.com>
Upstream: No
Reason: We can't cross build SSE extensions to ARM* platforms
--- setup.py
+++ setup.py
@@ -19,9 +19,15 @@ from setuptools.command.install import install
NAME = "argon2_cffi"
PACKAGES = find_packages(where="src")
+CROSS_BUILD = os.environ.get("CROSS_BUILD", False)
+
# Optimized version requires SSE2 extensions. They have been around since
# 2001 so we try to compile it on every recent-ish x86.
-optimized = platform.machine() in ("i686", "x86", "x86_64", "AMD64")
+# Do not build these during cross builts, as this detects the hosts's arch
+optimized = False
+
+if not CROSS_BUILD:
+ optimized = platform.machine() in ("i686", "x86", "x86_64", "AMD64")
CFFI_MODULES = ["src/argon2/_ffi_build.py:ffi"]
lib_base = os.path.join("extras", "libargon2", "src")