# Contributor: Felix Yan pkgname=python2-cryptography # Do NOT update. 3.4.0 dropped support for Python 2 pkgver=3.3.2 pkgrel=3 pkgdesc="A package designed to expose cryptographic recipes and primitives to Python developers (Legacy Python 2 version)" arch=('x86_64') license=('Apache') url="https://pypi.python.org/pypi/cryptography" depends=('python2-six' 'python2-cffi' 'python2-enum34' 'python2-ipaddress' 'glibc' 'openssl-1.1' 'python2') makedepends=('python2-setuptools') checkdepends=('python2-setuptools' 'python2-pytest-runner' 'python2-pretend' 'python2-iso8601' 'python2-pytz' 'python2-hypothesis' "python2-cryptography-vectors=$pkgver") optdepends=('python2-bcrypt: for OpenSSH private key support') source=("https://pypi.io/packages/source/c/cryptography/cryptography-$pkgver.tar.gz") sha512sums=('55f6ee13342b3209b1fcb310f4c4d33d22856ee785cb2347e6ad36c34e9b42f6e0d5bece8e458b09663a5b78e34c4567fe7a211b51ca71f55ccc93e3f62dc5e4') build() { cd cryptography-$pkgver # Allow building under non-default prefixes. Should normally resolve to "/usr". _usr="$(dirname $(dirname $(command -v python2)))" # Explicitly build against OpenSSL 1.1. Otherwise we end up building against the OpenSSL 3 headers # even though this version of cryptography doesn't support OpenSSL 3, yet. CFLAGS+=" -I${_usr}/include/openssl-1.1" LDFLAGS+=" -L${_usr}/lib/openssl-1.1" python2 setup.py build } check() { cd cryptography-$pkgver python2 setup.py pytest } package() { cd cryptography-$pkgver python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build }