# Description: cryptographic recipes and primitives to Python developers
# URL: https://github.com/pyca/cryptography
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: python3-cffi python3-maturin

name=python3-cryptography
version=49.0.0
release=1
source=(https://pypi.python.org/packages/source/c/cryptography/cryptography-$version.tar.gz)

build() {
  prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
  mkdir "$PKGMK_SOURCE_DIR/rust" || true
  export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"

  cd ${name#*-}-$version

  /usr/bin/python3 -m build --wheel --skip-dependency-check --no-isolation
  /usr/bin/python3 -m installer --destdir=$PKG dist/*.whl

  _pyver=$(/usr/bin/python3 -c 'import sys; print("%s.%s" % sys.version_info[:2])')
  rm -rf $PKG/usr/lib/python${_pyver}/site-packages/tests/
}
