New package: python-argon2-18.3.0

This commit is contained in:
Rasmus Thomsen 2018-09-28 22:25:59 +02:00 committed by maxice8
parent bc116fa601
commit b7adfa03c2
3 changed files with 60 additions and 0 deletions

View file

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

@ -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 <rasmus.thomsen@protonmail.com>"
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
}
}

1
srcpkgs/python3-argon2 Symbolic link
View file

@ -0,0 +1 @@
python-argon2