python-argon2: build against system libargon2

This commit is contained in:
Alessio Sergi 2018-10-15 18:43:30 +02:00
parent c0809ae870
commit e92b75ba5b
2 changed files with 4 additions and 31 deletions

View File

@ -1,23 +0,0 @@
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")

View File

@ -1,12 +1,12 @@
# Template file for 'python-argon2'
pkgname=python-argon2
version=18.3.0
revision=1
revision=2
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"
makedepends="libargon2-devel python-devel python3-devel"
depends="python-cffi python-enum34 python-six"
short_desc="CFFI-based Argon2 Bindings for Python2"
maintainer="Rasmus Thomsen <rasmus.thomsen@protonmail.com>"
@ -15,11 +15,7 @@ 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
}
export ARGON2_CFFI_USE_SYSTEM=1
post_install() {
vlicense LICENSE
@ -28,7 +24,7 @@ post_install() {
python3-argon2_package() {
depends="python3-cffi python3-six"
pycompile_module="argon2"
short_desc="${short_desc/python2/python3}"
short_desc="${short_desc/Python2/Python3}"
pkg_install() {
vmove usr/lib/python3*
vlicense LICENSE