diff --git a/srcpkgs/python-argon2/patches/disable-sse-for-cross.patch b/srcpkgs/python-argon2/patches/disable-sse-for-cross.patch new file mode 100644 index 0000000000..a5c00808b1 --- /dev/null +++ b/srcpkgs/python-argon2/patches/disable-sse-for-cross.patch @@ -0,0 +1,23 @@ +Source: Rasmus Thomsen +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") + diff --git a/srcpkgs/python-argon2/template b/srcpkgs/python-argon2/template new file mode 100644 index 0000000000..1ef2be8508 --- /dev/null +++ b/srcpkgs/python-argon2/template @@ -0,0 +1,36 @@ +# Template file for 'python-argon2' +pkgname=python-argon2 +version=18.3.0 +revision=1 +wrksrc="argon2_cffi-${version}" +build_style=python-module +pycompile_module="argon2" +hostmakedepends="python-setuptools python3-setuptools python-cffi python3-cffi" +makedepends="libffi-devel python-cffi python3-cffi python-devel python3-devel" +depends="python-cffi python-enum34 python-six" +short_desc="CFFI-based Argon2 Bindings for Python2" +maintainer="Rasmus Thomsen " +license="MIT" +homepage="https://argon2-cffi.readthedocs.io/" +distfiles="${PYPI_SITE}/a/argon2_cffi/argon2_cffi-${version}.tar.gz" +checksum=003f588de43a817af6ecc1c06103fa0801de63849db3cb0f37576bb2da29043d + +pre_build() { + if [ "$CROSS_BUILD" ]; then + export CROSS_BUILD=True + fi +} + +post_install() { + vlicense LICENSE +} + +python3-argon2_package() { + depends="python3-cffi python3-six" + pycompile_module="argon2" + short_desc="${short_desc/python2/python3}" + pkg_install() { + vmove usr/lib/python3* + vlicense LICENSE + } +} diff --git a/srcpkgs/python3-argon2 b/srcpkgs/python3-argon2 new file mode 120000 index 0000000000..01df5bf05a --- /dev/null +++ b/srcpkgs/python3-argon2 @@ -0,0 +1 @@ +python-argon2 \ No newline at end of file