1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
7 PYTHON_REQ_USE="threads(+)"
9 inherit distutils-r1 flag-o-matic
11 VEC_P=cryptography_vectors-${PV}
12 DESCRIPTION="Library providing cryptographic recipes and primitives"
13 HOMEPAGE="https://github.com/pyca/cryptography/ https://pypi.org/project/cryptography/"
14 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
15 test? ( mirror://pypi/c/cryptography_vectors/${VEC_P}.tar.gz )"
17 LICENSE="|| ( Apache-2.0 BSD )"
19 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
20 IUSE="libressl idna test"
21 RESTRICT="!test? ( test )"
23 # the openssl 1.0.2l-r1 needs to be updated again :(
24 # It'd theb be able to go into the || section again
25 #=dev-libs/openssl-1.0.2l-r1:0
26 # the following is the original section, disallowing bindist entirely
27 #!libressl? ( >=dev-libs/openssl-1.0.2:0=[-bindist(-)] )
32 dev-libs/openssl:0[-bindist(-)]
33 >=dev-libs/openssl-1.0.2o-r6:0
37 libressl? ( dev-libs/libressl:0= )
38 idna? ( >=dev-python/idna-2.1[${PYTHON_USEDEP}] )
39 dev-python/setuptools[${PYTHON_USEDEP}]
40 >=dev-python/six-1.4.1[${PYTHON_USEDEP}]
41 $(python_gen_cond_dep '
42 dev-python/enum34[${PYTHON_USEDEP}]
43 dev-python/ipaddress[${PYTHON_USEDEP}]
45 $(python_gen_cond_dep '
46 >=dev-python/cffi-1.8:=[${PYTHON_USEDEP}]
47 !~dev-python/cffi-1.11.3[${PYTHON_USEDEP}]
51 >=dev-python/setuptools-1.0[${PYTHON_USEDEP}]
53 dev-python/pretend[${PYTHON_USEDEP}]
54 dev-python/iso8601[${PYTHON_USEDEP}]
55 dev-python/pytz[${PYTHON_USEDEP}]
56 >=dev-python/hypothesis-1.11.4[${PYTHON_USEDEP}]
57 !~dev-python/hypothesis-3.79.2[${PYTHON_USEDEP}]
58 dev-python/pyasn1-modules[${PYTHON_USEDEP}]
59 dev-python/pytest[${PYTHON_USEDEP}]
62 DOCS=( AUTHORS.rst CONTRIBUTING.rst README.rst )
64 python_configure_all() {
65 append-cflags $(test-flags-CC -pthread)
69 local -x PYTHONPATH=${PYTHONPATH}:${WORKDIR}/${VEC_P}
70 pytest -vv || die "Tests fail with ${EPYTHON}"