|
| 1 | +inherit: [cargo, "python3::build"] |
| 2 | + |
| 3 | +metaEnvironment: |
| 4 | + PKG_VERSION: "46.0.5" |
| 5 | + PKG_LICENSE: "Apache-2.0 OR BSD-3-Clause" |
| 6 | + |
| 7 | +checkoutSCM: |
| 8 | + scm: url |
| 9 | + url: ${GITHUB_MIRROR}/pyca/cryptography/archive/refs/tags/${PKG_VERSION}.tar.gz |
| 10 | + digestSHA256: 7571f0e09a6d6eb22168993f94d35867b4dcbd0d34224e0eb7b392b905b3f12f |
| 11 | + stripComponents: 1 |
| 12 | + |
| 13 | +depends: |
| 14 | + - tools: |
| 15 | + target-toolchain: host-compat-toolchain |
| 16 | + depends: |
| 17 | + - name: python::maturin |
| 18 | + alias: python::maturin-host |
| 19 | + use: [tools] |
| 20 | + - python::cffi |
| 21 | + - name: libs::openssl-dev |
| 22 | + alias: openssl-host |
| 23 | + use: [result] |
| 24 | + |
| 25 | + - python::setuptools-rust |
| 26 | + - python::pycparser |
| 27 | + - python::semantic-version |
| 28 | + - libs::openssl-dev |
| 29 | + - use: [] |
| 30 | + depends: |
| 31 | + - libs::openssl-tgt |
| 32 | + |
| 33 | +checkoutDeterministic: True |
| 34 | +checkoutScript: | |
| 35 | + cargoFetchDeps |
| 36 | +
|
| 37 | +buildTools: [host-toolchain, target-toolchain, maturin] |
| 38 | +buildSetup: | |
| 39 | + # provide openssl dir |
| 40 | + export OPENSSL_DIR=${BOB_DEP_PATHS['libs::openssl-dev']}/usr/ |
| 41 | + # caro builds a native-tool depending on python::cffi |
| 42 | + export HOST_CC=gcc |
| 43 | + export CARGO_BUILD_RUSTFLAGS="-C link-arg=-L${BOB_DEP_PATHS['openssl-host']}/usr/lib" |
| 44 | +
|
| 45 | +buildScript: | |
| 46 | + # without a git directory maturin fails with: |
| 47 | + # fatal: not a git repository (or any parent up to mount point |
| 48 | + # dev/build/python/cryptography/2) |
| 49 | + # See https://github.com/pyca/cryptography/issues/11845 |
| 50 | + git init . |
| 51 | +
|
| 52 | + # build wheel to avoid |
| 53 | + # ERROR Source /tmp/build-via-sdist-5zco0pfp/cryptography-46.0.5 does |
| 54 | + # not appear to be a Python project |
| 55 | + # See: https://github.com/pyca/cryptography/issues/11845 |
| 56 | + python3Build -w $1 |
| 57 | +
|
| 58 | +packageScript: | |
| 59 | + python3PackageTgt |
| 60 | +
|
| 61 | +provideDeps: |
| 62 | + - python::setuptools-rust |
| 63 | + - python::pycparser |
| 64 | + - python::semantic-version |
| 65 | + - '*-tgt' |
0 commit comments