pycryptodomex: parallel make patch

This commit is contained in:
blshkv 2020-02-13 12:41:19 +08:00
parent bfd6504378
commit 98f10c565b
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
2 changed files with 44 additions and 3 deletions

View file

@ -0,0 +1,22 @@
diff --git a/setup.py b/setup.py
index 1d70caad..c72f64ff 100644
--- a/setup.py
+++ b/setup.py
@@ -364,7 +364,7 @@ ext_modules = [
Extension("Crypto.Cipher._raw_eksblowfish",
include_dirs=['src/'],
define_macros=[('EKS',None),],
- sources=["src/blowfish.c"]),
+ sources=["src/blowfish_eks.c"]),
Extension("Crypto.Cipher._raw_cast",
include_dirs=['src/'],
sources=["src/CAST.c"]),
@@ -427,7 +427,7 @@ ext_modules = [
# Math
Extension("Crypto.Math._modexp",
include_dirs=['src/'],
- sources=['src/modexp.c', 'src/siphash.c', 'src/modexp_utils.c', 'src/mont.c'],
+ sources=['src/modexp.c', 'src/siphash.c', 'src/modexp_utils.c', 'src/mont_math.c'],
),
]

View file

@ -14,7 +14,8 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD-2 Unlicense"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 x86"
#fails to compile
#KEYWORDS="amd64 ~arm ~arm64 x86"
RDEPEND="${PYTHON_DEPS}
dev-libs/gmp:0
@ -22,6 +23,24 @@ RDEPEND="${PYTHON_DEPS}
DEPEND="${RDEPEND}"
python_test() {
esetup.py test
PATCHES=(
"${FILESDIR}/pycryptodome-3.9.4-parallel-make.patch"
# https://github.com/Legrandin/pycryptodome/pull/351
# "${FILESDIR}/pycryptodome-3.9.4-tests.patch"
)
python_prepare_all() {
# parallel make fixes
# Multiple targets were compiling the same file, setuptools doesn't
# understand this and you get race conditions where a file gets
# overwritten while it's linking. This makes the files look like separate
# files so this race won't happen
ln src/blowfish.c src/blowfish_eks.c || die
ln src/mont.c src/mont_math.c || die
distutils-r1_python_prepare_all
}
python_test() {
esetup.py test -vv
}