dev-python/cryptography-3.2.1: fix build for macOS using GCC

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
This commit is contained in:
Fabian Groffen
2020-11-30 09:02:54 +01:00
parent b9b779cd3e
commit b28c7994d2

View File

@@ -46,6 +46,20 @@ RDEPEND+=${DEPEND}
DOCS=( AUTHORS.rst CONTRIBUTING.rst README.rst )
src_prepare() {
default
# 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
fi
}
python_test() {
local -x PYTHONPATH=${PYTHONPATH}:${WORKDIR}/${VEC_P}
pytest -vv -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" ||