Skip to content

Commit

Permalink
python-cryptography: update to 3.3.2, split package
Browse files Browse the repository at this point in the history
New package: python3-cryptography-3.4.2
  • Loading branch information
ahesford committed Feb 8, 2021
1 parent 774f3c9 commit 1a573dc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 23 deletions.
30 changes: 8 additions & 22 deletions srcpkgs/python-cryptography/template
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
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
}
}
2 changes: 2 additions & 0 deletions srcpkgs/python-cryptography/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# cryptography >= 3.4 does not support Python 2
pattern="cryptography-\K3\.3\.[0-9.]+(?=.tar.gz)"
1 change: 0 additions & 1 deletion srcpkgs/python3-cryptography

This file was deleted.

36 changes: 36 additions & 0 deletions srcpkgs/python3-cryptography/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Template file for 'python3-cryptography'
pkgname=python3-cryptography
version=3.4.2
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 <[email protected]>"
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=c460e296c8cb3a796cdcc7d56c62a78fcd0a09409ccd9c658ace4f987ce935c4

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
}

0 comments on commit 1a573dc

Please sign in to comment.