summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2020-09-05 14:53:57 -0700
committerPatrick McLean <chutzpah@gentoo.org>2020-09-06 12:13:07 -0700
commit64b870fd75f3fdfb584db783da4fdcc1dd8b06c8 (patch)
treeeedca64254567b214c501026309661253ba4262c /dev-python/pycryptodomex
parentmedia-sound/apulse: fix tests (diff)
downloadgentoo-64b870fd75f3fdfb584db783da4fdcc1dd8b06c8.tar.gz
gentoo-64b870fd75f3fdfb584db783da4fdcc1dd8b06c8.tar.bz2
gentoo-64b870fd75f3fdfb584db783da4fdcc1dd8b06c8.zip
dev-python/pycryptodomex: New package
Package-Manager: Portage-3.0.5, Repoman-3.0.1 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-python/pycryptodomex')
-rw-r--r--dev-python/pycryptodomex/Manifest1
-rw-r--r--dev-python/pycryptodomex/files/pycryptodome-3.9.4-parallel-make.patch22
-rw-r--r--dev-python/pycryptodomex/metadata.xml15
-rw-r--r--dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild41
4 files changed, 79 insertions, 0 deletions
diff --git a/dev-python/pycryptodomex/Manifest b/dev-python/pycryptodomex/Manifest
new file mode 100644
index 000000000000..d518c14e1e23
--- /dev/null
+++ b/dev-python/pycryptodomex/Manifest
@@ -0,0 +1 @@
+DIST pycryptodomex-3.9.8.tar.gz 15633485 BLAKE2B 3d7b8a74d2f7cc0f47c73f3f3d1dcf13c8b9feb9f2f532dc48751c4a73915aa081ecf273a81731076070f054f5b2037a5eba9054ca71e549aad18ed0c3148c74 SHA512 bcc5fb27a89c00e6348eacc744a23d687d0b308d5c8ad8f6d955fe2b9e84288a592206336e7fef699800948f8ea7b1ac06d2bec60df0b9ff0fa32d0a05380869
diff --git a/dev-python/pycryptodomex/files/pycryptodome-3.9.4-parallel-make.patch b/dev-python/pycryptodomex/files/pycryptodome-3.9.4-parallel-make.patch
new file mode 100644
index 000000000000..331333533f10
--- /dev/null
+++ b/dev-python/pycryptodomex/files/pycryptodome-3.9.4-parallel-make.patch
@@ -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'],
+ ),
+ ]
+
diff --git a/dev-python/pycryptodomex/metadata.xml b/dev-python/pycryptodomex/metadata.xml
new file mode 100644
index 000000000000..ff92fe1587b7
--- /dev/null
+++ b/dev-python/pycryptodomex/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">Legrandin/pycryptodome</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild b/dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild
new file mode 100644
index 000000000000..485ba9c9ea37
--- /dev/null
+++ b/dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="A self-contained cryptographic library for Python"
+HOMEPAGE="https://www.pycryptodome.org https://github.com/Legrandin/pycryptodome https://pypi.org/project/pycryptodome/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD-2 Unlicense"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-libs/gmp:0
+ virtual/python-cffi[${PYTHON_USEDEP}]
+ !dev-python/pycrypto"
+BDEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/pycryptodome-3.9.4-parallel-make.patch"
+)
+
+distutils_enable_tests setup.py
+
+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
+}