diff --git a/srcpkgs/python-cryptography/template b/srcpkgs/python-cryptography/template index 6579b004e38..2363ec3042d 100644 --- a/srcpkgs/python-cryptography/template +++ b/srcpkgs/python-cryptography/template @@ -1,42 +1,28 @@ # Template file for 'python-cryptography' pkgname=python-cryptography -version=3.3.1 +version=3.3.2 revision=1 wrksrc="cryptography-${version}" -build_style=python-module -hostmakedepends="python-setuptools python3-setuptools libressl-devel - python-enum34 python-ipaddress python-six python3-six - python-cffi python3-cffi python-idna python3-idna" -makedepends="libressl-devel python-devel python3-devel" +build_style=python2-module +hostmakedepends="python-setuptools libressl-devel python-enum34 + python-ipaddress python-six python-cffi python-idna" +makedepends="libressl-devel python-devel" depends="python-cffi python-six python-enum34 python-idna python-ipaddress" checkdepends="python-cryptography_vectors python-hypothesis python-pretend - python-pytest python-pytz python-iso8601 python3-cryptography_vectors - python3-hypothesis python3-pretend python3-pytest python3-pytz python3-iso8601 - ${depends}" + python-pytest python-pytz python-iso8601 ${depends}" short_desc="Python2 library that provides cryptographic recipes and primitives" maintainer="Alessio Sergi " license="BSD-3-Clause, Apache-2.0" homepage="https://github.com/pyca/cryptography" changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst" distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz" -checksum=7e177e4bea2de937a584b13645cab32f25e3d96fc0bc4a4cf99c27dc77682be6 +checksum=5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed do_check() { - PYTHONPATH="$(cd build-2.7/lib* && pwd)" python2.7 -m pytest tests - PYTHONPATH="$(cd build-${py3_ver}/lib* && pwd)" python${py3_ver} -m pytest tests + PYTHONPATH="$(cd build/lib* && pwd)" python2.7 -m pytest tests } post_install() { vlicense LICENSE vlicense LICENSE.BSD } - -python3-cryptography_package() { - depends="python3-cffi python3-six python3-idna" - short_desc="${short_desc/Python2/Python3}" - pkg_install() { - vmove usr/lib/python3* - vlicense LICENSE - vlicense LICENSE.BSD - } -} diff --git a/srcpkgs/python-cryptography/update b/srcpkgs/python-cryptography/update new file mode 100644 index 00000000000..b128c2f3bcf --- /dev/null +++ b/srcpkgs/python-cryptography/update @@ -0,0 +1,2 @@ +# cryptography >= 3.4 does not support Python 2 +pattern="cryptography-\K3\.3\.[0-9.]+(?=.tar.gz)" diff --git a/srcpkgs/python3-cryptography b/srcpkgs/python3-cryptography deleted file mode 120000 index 056dc2d1d9b..00000000000 --- a/srcpkgs/python3-cryptography +++ /dev/null @@ -1 +0,0 @@ -python-cryptography \ No newline at end of file diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template new file mode 100644 index 00000000000..dff0d3b211f --- /dev/null +++ b/srcpkgs/python3-cryptography/template @@ -0,0 +1,36 @@ +# Template file for 'python3-cryptography' +pkgname=python3-cryptography +version=3.4.4 +revision=1 +wrksrc="${pkgname#python3-}-${version}" +build_style=python3-module +build_helper="rust" +hostmakedepends="python3-setuptools-rust python3-cffi cargo" +makedepends="python3-devel libressl-devel" +depends="python3-cffi" +checkdepends="python3-pytest-subtests python3-pytz python3-iso8601 + python3-cryptography_vectors python3-pretend python3-hypothesis $depends" +short_desc="Python3 library that provides cryptographic recipes and primitives" +maintainer="Andrew J. Hesford " +license="BSD-3-Clause, Apache-2.0" +homepage="https://github.com/pyca/cryptography" +changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.rst" +distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz" +checksum=ee5e19f0856b6fbbdbab15c2787ca65d203801d2d65d0b8de6218f424206c848 + +if [ "$CROSS_BUILD" ]; then + makedepends+=" rust-std" + export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib" + export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include" +fi + +do_check() { + PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest +} + +post_install() { + vlicense LICENSE + vlicense LICENSE.BSD + + chmod 755 ${DESTDIR}/${py3_sitelib}/cryptography/hazmat/bindings/*.so +}