dev-python/cryptography: Sync with Gentoo

It's from Gentoo commit 062469f72f8d6c17ab9375ac399001f966ba24c3.

Signed-off-by: Flatcar Buildbot <buildbot@flatcar-linux.org>
This commit is contained in:
Flatcar Buildbot 2025-09-01 07:08:30 +00:00 committed by Krzesimir Nowak
parent be7402afc6
commit 0db812c102
2 changed files with 135 additions and 0 deletions

View File

@ -7,8 +7,10 @@ DIST cc-1.2.23.crate 106527 BLAKE2B 0fd9e69ad743f4df15da3d25f85e1a422ef64b81b72a
DIST cfg-if-1.0.0.crate 7934 BLAKE2B e99a5589c11d79d77a4537b34ce0a45d37b981c123b79b807cea836c89fc3926d693458893baca2882448d3d44e3f64e06141f6d916b748daa10b8cc1ae16d1b SHA512 0fb16a8882fd30e86b62c5143b1cb18ab564e84e75bd1f28fd12f24ffdc4a42e0d2e012a99abb606c12efe3c11061ff5bf8e24ab053e550ae083f7d90f6576ff
DIST cryptography-45.0.4.tar.gz 744890 BLAKE2B 34687a369894b0dfcf8a81c6d1b8cbb0b4a711fd17d4419c5368c41b7e5192cad7233295976a236a52c20493b980a5df77ff4af5a9d54925510d00e833971a22 SHA512 d5bdb21956b80675ccfae78be3d56a2e3bfe8c6ceac15c87c9a3ca470605cb798774018c6c9b9597e90a6918912c9a6b5d83eac9f446364b917d7e8888b83eee
DIST cryptography-45.0.5.tar.gz 744903 BLAKE2B c8bee14a11b613b8e37fa9ed57dc8fc65b136c738ebe41a2aa753e9dbfed1976bebb429a62e869fd0a138ff222860d629280589b2340a4654f85b5b968af3a8c SHA512 1704f17250d8da6a33ac361f0fe07f6f91ebf087e81cee8fa783b220e118eba83f5c79eab001d79b383d7577b6dabd1e18de718cb16b5780d2f145107bf9cc79
DIST cryptography-45.0.6.tar.gz 744949 BLAKE2B 271143188d0a7485066b5c89fc0397e6f9e5f5219844961a85e9fd382fb0b05521a093fb943252ea2985bb89645a285345fcf66a6022a58176fe809a83376a81 SHA512 2c675834fa26db0773fe51855c248927a2a7d45963e07144afdfa73573ce1e6940d40849d23fb45f7599c0821e4dbbec956ce2bd993c614617312b8e67fe7f1f
DIST cryptography_vectors-45.0.4.tar.gz 35345034 BLAKE2B 578bd6dc066079a47cc8291a6b4ecec055b2374046efe12fdc1479505fd9bd5afbc9750e879d6d66b896ff7465abf4f1c133eb41dc4a75c57f5dc635ed8163f0 SHA512 0f2b6310eec21add1caa8ab60e8bb1399177b5a4bc50832fb5db581ed94d030871d2fdd53256e3764c67f58391673005db0527e15063554876306364a8111972
DIST cryptography_vectors-45.0.5.tar.gz 35344700 BLAKE2B 620d31f2ef2482990567bfaeb21163a96b4da20829c80367511a9803bfc2ecad9edb54e37ad1d3c2848c747d14db61323d9613765bd94462adb9228d8a6d43fc SHA512 7d5706243ec69ae670a7d8e0e6e7a650d4ba7e10b5bd8b05641d7f0e2291cd719c3b2bfccb975c429046a1a347316aa86f40d128160ef176efa294c1d843ff86
DIST cryptography_vectors-45.0.6.tar.gz 35344645 BLAKE2B 78e8cc7b27eefdf9f499ce64479c67be9ea320967fa6791f19e89c298b783972845728fe43b3c7e6d37fbe1bcd894b268a63cf47be7cc10c5487612cd3587cc5 SHA512 0571c8b5b6e6f7b8787f6bcd395f75460ef615cb9cfd2c779b11326c74b38f285dcb1d84123d3a7996530976fdda78ec266d5c849ea9d6c51835c5ef933b9bfa
DIST foreign-types-0.3.2.crate 7504 BLAKE2B 520818b702d990d296ecd31a8646850202509ccfa18edd0e1b260289619a6c351e758f317ec0824bd76eccb209b6f087057c25f1bd01a47897715013dd834867 SHA512 bf27b8243ed482c202d120383374f19ff09422535e24b9c1aebccc66529bf300ca17b8bbc76d67f98ac092e614497afe3add9dc68aa69c93074df05762f91232
DIST foreign-types-shared-0.1.1.crate 5672 BLAKE2B d2e42e04b6657e7a69fe0bd20c672176629c743e49a55fd007bb30e289710b70045d445ae9cae0eeaa747ee708c90e8abd9b5fc39bad8ec0666befe1b696d4f1 SHA512 bafdb2143e136fb0818e2ffd90b5c862b7181647d6568947d4e4531012bbf7a57b597221ec7056c1b562dfc0c3b5dead26d1a4111ebc15e7863737a873518a4a
DIST heck-0.5.0.crate 11517 BLAKE2B 5365ec43b2239a76b33a174f1a4292ece4147f9d382a68c6c60db78fdc8bad0afb1d51a65bcb25e96675372faa4ea37c318265030b0546ba51942f7c929e1835 SHA512 f044fc9c3d22466629fd8f772ec0555350fd611c0cfadca51d99a3d2f10e155f77c1091916c8a95a6b9b499f366c2e99a5fbf45b010f988bfb9b2501bf9f6a76

View File

@ -0,0 +1,133 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CARGO_OPTIONAL=yes
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=maturin
PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
PYTHON_REQ_USE="threads(+)"
CRATES="
asn1@0.21.3
asn1_derive@0.21.3
autocfg@1.4.0
base64@0.22.1
bitflags@2.9.1
cc@1.2.23
cfg-if@1.0.0
foreign-types-shared@0.1.1
foreign-types@0.3.2
heck@0.5.0
indoc@2.0.6
itoa@1.0.15
libc@0.2.172
memoffset@0.9.1
once_cell@1.21.3
openssl-macros@0.1.1
openssl-sys@0.9.108
openssl@0.10.72
pem@3.0.5
pkg-config@0.3.32
portable-atomic@1.11.0
proc-macro2@1.0.95
pyo3-build-config@0.25.0
pyo3-ffi@0.25.0
pyo3-macros-backend@0.25.0
pyo3-macros@0.25.0
pyo3@0.25.0
quote@1.0.40
self_cell@1.2.0
shlex@1.3.0
syn@2.0.101
target-lexicon@0.13.2
unicode-ident@1.0.18
unindent@0.2.4
vcpkg@0.2.15
"
inherit cargo distutils-r1 flag-o-matic pypi
VEC_P=cryptography_vectors-$(ver_cut 1-3)
DESCRIPTION="Library providing cryptographic recipes and primitives"
HOMEPAGE="
https://github.com/pyca/cryptography/
https://pypi.org/project/cryptography/
"
SRC_URI+="
${CARGO_CRATE_URIS}
test? (
$(pypi_sdist_url cryptography_vectors "$(ver_cut 1-3)")
)
"
LICENSE="|| ( Apache-2.0 BSD ) PSF-2"
# Dependent crate licenses
LICENSE+="
Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD MIT Unicode-3.0
"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
RDEPEND="
>=dev-libs/openssl-1.0.2o-r6:0=
$(python_gen_cond_dep '
>=dev-python/cffi-1.8:=[${PYTHON_USEDEP}]
' 'python*')
"
DEPEND="
${RDEPEND}
"
BDEPEND="
${RUST_DEPEND}
>=dev-util/maturin-1.8.6[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/certifi[${PYTHON_USEDEP}]
dev-python/iso8601[${PYTHON_USEDEP}]
dev-python/pretend[${PYTHON_USEDEP}]
dev-python/pyasn1-modules[${PYTHON_USEDEP}]
dev-python/pytz[${PYTHON_USEDEP}]
)
"
# Files built without CFLAGS/LDFLAGS, acceptable for rust
QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/cryptography/hazmat/bindings/_rust.*.so"
EPYTEST_PLUGINS=( hypothesis pytest-subtests )
EPYTEST_XDIST=1
distutils_enable_tests pytest
src_unpack() {
cargo_src_unpack
}
src_prepare() {
distutils-r1_src_prepare
sed -i -e 's:--benchmark-disable::' pyproject.toml || die
# work around availability macros not supported in GCC (yet)
if [[ ${CHOST} == *-darwin* ]] ; then
local darwinok=0
if [[ ${CHOST##*-darwin} -ge 16 ]] ; then
darwinok=1
fi
sed -i -e 's/__builtin_available(macOS 10\.12, \*)/'"${darwinok}"'/' \
src/_cffi_src/openssl/src/osrandom_engine.c || die
fi
}
python_configure_all() {
filter-lto # bug #903908
}
python_test() {
local -x PYTHONPATH="${PYTHONPATH}:${WORKDIR}/cryptography_vectors-${PV}"
local EPYTEST_IGNORE=(
tests/bench
)
epytest
}