# Description: A package designed to expose cryptographic recipes and primitives to Python developers.
# URL: https://pypi.org/project/cryptography/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: python3-cffi python3-setuptools-rust

name=python3-cryptography
version=41.0.3
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 --compile-bytecode 2 --destdir=$PKG dist/*.whl
}
