Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cryptography/
Date: Wed, 23 Feb 2022 09:47:50
Message-Id: 1645609664.c698ffe332b2df88e2c856756a7f26375191e122.mgorny@gentoo
1 commit: c698ffe332b2df88e2c856756a7f26375191e122
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 23 09:20:42 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 23 09:47:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c698ffe3
7
8 dev-python/cryptography: Bump to EAPI 8 / PEP517
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../cryptography/cryptography-3.4.7-r3.ebuild | 81 ++++++++++++++++++++++
13 1 file changed, 81 insertions(+)
14
15 diff --git a/dev-python/cryptography/cryptography-3.4.7-r3.ebuild b/dev-python/cryptography/cryptography-3.4.7-r3.ebuild
16 new file mode 100644
17 index 000000000000..4051e6af5c34
18 --- /dev/null
19 +++ b/dev-python/cryptography/cryptography-3.4.7-r3.ebuild
20 @@ -0,0 +1,81 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +DISTUTILS_USE_PEP517=setuptools
27 +PYTHON_COMPAT=( python3_{8..10} pypy3 )
28 +PYTHON_REQ_USE="threads(+)"
29 +
30 +inherit distutils-r1 multiprocessing
31 +
32 +VEC_P=cryptography_vectors-${PV}
33 +DESCRIPTION="Library providing cryptographic recipes and primitives"
34 +HOMEPAGE="
35 + https://github.com/pyca/cryptography/
36 + https://pypi.org/project/cryptography/
37 +"
38 +SRC_URI="
39 + mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
40 + test? ( mirror://pypi/c/cryptography_vectors/${VEC_P}.tar.gz )
41 +"
42 +
43 +LICENSE="|| ( Apache-2.0 BSD )"
44 +SLOT="0"
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
46 +
47 +RDEPEND="
48 + $(python_gen_cond_dep '
49 + >=dev-python/cffi-1.8:=[${PYTHON_USEDEP}]
50 + ' 'python*')
51 +"
52 +BDEPEND="
53 + test? (
54 + >=dev-python/hypothesis-1.11.4[${PYTHON_USEDEP}]
55 + dev-python/iso8601[${PYTHON_USEDEP}]
56 + dev-python/pretend[${PYTHON_USEDEP}]
57 + dev-python/pyasn1-modules[${PYTHON_USEDEP}]
58 + dev-python/pytz[${PYTHON_USEDEP}]
59 + dev-python/pytest-subtests[${PYTHON_USEDEP}]
60 + dev-python/pytest-xdist[${PYTHON_USEDEP}]
61 + )
62 +"
63 +
64 +distutils_enable_tests pytest
65 +
66 +DEPEND="
67 + >=dev-libs/openssl-1.0.2o-r6:0=
68 +"
69 +RDEPEND+=${DEPEND}
70 +
71 +PATCHES=(
72 + "${FILESDIR}/${P}-py310.patch"
73 +)
74 +
75 +src_prepare() {
76 + default
77 +
78 + # avoid automagic dependency on dev-libs/openssl[sslv3]
79 + # https://bugs.gentoo.org/789450
80 + export CPPFLAGS="${CPPFLAGS} -DOPENSSL_NO_SSL3_METHOD=1"
81 +
82 + # work around availability macros not supported in GCC (yet)
83 + if [[ ${CHOST} == *-darwin* ]] ; then
84 + local darwinok=0
85 + [[ ${CHOST##*-darwin} -ge 16 ]] && darwinok=1
86 + sed -e 's/__builtin_available(macOS 10\.12, \*)/'"${darwinok}"'/' \
87 + -i src/_cffi_src/openssl/src/osrandom_engine.c || die
88 + fi
89 +
90 + # this version does not really use Rust, it just creates a dummy
91 + # extension to break stuff
92 + export CRYPTOGRAPHY_DONT_BUILD_RUST=1
93 + sed -e 's:from setuptools_rust import RustExtension:pass:' \
94 + -e '/setup_requires/d' \
95 + -i setup.py || die
96 +}
97 +
98 +python_test() {
99 + local -x PYTHONPATH=${PYTHONPATH}:${WORKDIR}/${VEC_P}
100 + epytest -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
101 +}