1 |
commit: 64b870fd75f3fdfb584db783da4fdcc1dd8b06c8 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 5 21:53:57 2020 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 6 19:13:07 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64b870fd |
7 |
|
8 |
dev-python/pycryptodomex: New package |
9 |
|
10 |
Package-Manager: Portage-3.0.5, Repoman-3.0.1 |
11 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
12 |
|
13 |
dev-python/pycryptodomex/Manifest | 1 + |
14 |
.../files/pycryptodome-3.9.4-parallel-make.patch | 22 ++++++++++++ |
15 |
dev-python/pycryptodomex/metadata.xml | 15 ++++++++ |
16 |
.../pycryptodomex/pycryptodomex-3.9.8.ebuild | 41 ++++++++++++++++++++++ |
17 |
4 files changed, 79 insertions(+) |
18 |
|
19 |
diff --git a/dev-python/pycryptodomex/Manifest b/dev-python/pycryptodomex/Manifest |
20 |
new file mode 100644 |
21 |
index 00000000000..d518c14e1e2 |
22 |
--- /dev/null |
23 |
+++ b/dev-python/pycryptodomex/Manifest |
24 |
@@ -0,0 +1 @@ |
25 |
+DIST pycryptodomex-3.9.8.tar.gz 15633485 BLAKE2B 3d7b8a74d2f7cc0f47c73f3f3d1dcf13c8b9feb9f2f532dc48751c4a73915aa081ecf273a81731076070f054f5b2037a5eba9054ca71e549aad18ed0c3148c74 SHA512 bcc5fb27a89c00e6348eacc744a23d687d0b308d5c8ad8f6d955fe2b9e84288a592206336e7fef699800948f8ea7b1ac06d2bec60df0b9ff0fa32d0a05380869 |
26 |
|
27 |
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 |
28 |
new file mode 100644 |
29 |
index 00000000000..331333533f1 |
30 |
--- /dev/null |
31 |
+++ b/dev-python/pycryptodomex/files/pycryptodome-3.9.4-parallel-make.patch |
32 |
@@ -0,0 +1,22 @@ |
33 |
+diff --git a/setup.py b/setup.py |
34 |
+index 1d70caad..c72f64ff 100644 |
35 |
+--- a/setup.py |
36 |
++++ b/setup.py |
37 |
+@@ -364,7 +364,7 @@ ext_modules = [ |
38 |
+ Extension("Crypto.Cipher._raw_eksblowfish", |
39 |
+ include_dirs=['src/'], |
40 |
+ define_macros=[('EKS',None),], |
41 |
+- sources=["src/blowfish.c"]), |
42 |
++ sources=["src/blowfish_eks.c"]), |
43 |
+ Extension("Crypto.Cipher._raw_cast", |
44 |
+ include_dirs=['src/'], |
45 |
+ sources=["src/CAST.c"]), |
46 |
+@@ -427,7 +427,7 @@ ext_modules = [ |
47 |
+ # Math |
48 |
+ Extension("Crypto.Math._modexp", |
49 |
+ include_dirs=['src/'], |
50 |
+- sources=['src/modexp.c', 'src/siphash.c', 'src/modexp_utils.c', 'src/mont.c'], |
51 |
++ sources=['src/modexp.c', 'src/siphash.c', 'src/modexp_utils.c', 'src/mont_math.c'], |
52 |
+ ), |
53 |
+ ] |
54 |
+ |
55 |
|
56 |
diff --git a/dev-python/pycryptodomex/metadata.xml b/dev-python/pycryptodomex/metadata.xml |
57 |
new file mode 100644 |
58 |
index 00000000000..ff92fe1587b |
59 |
--- /dev/null |
60 |
+++ b/dev-python/pycryptodomex/metadata.xml |
61 |
@@ -0,0 +1,15 @@ |
62 |
+<?xml version='1.0' encoding='UTF-8'?> |
63 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
64 |
+<pkgmetadata> |
65 |
+ <maintainer type="person"> |
66 |
+ <email>chutzpah@g.o</email> |
67 |
+ <name>Patrick McLean</name> |
68 |
+ </maintainer> |
69 |
+ <maintainer type="project"> |
70 |
+ <email>python@g.o</email> |
71 |
+ <name>Python project</name> |
72 |
+ </maintainer> |
73 |
+ <upstream> |
74 |
+ <remote-id type="github">Legrandin/pycryptodome</remote-id> |
75 |
+ </upstream> |
76 |
+</pkgmetadata> |
77 |
|
78 |
diff --git a/dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild b/dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild |
79 |
new file mode 100644 |
80 |
index 00000000000..485ba9c9ea3 |
81 |
--- /dev/null |
82 |
+++ b/dev-python/pycryptodomex/pycryptodomex-3.9.8.ebuild |
83 |
@@ -0,0 +1,41 @@ |
84 |
+# Copyright 1999-2020 Gentoo Authors |
85 |
+# Distributed under the terms of the GNU General Public License v2 |
86 |
+ |
87 |
+EAPI=7 |
88 |
+ |
89 |
+PYTHON_COMPAT=( python3_{6..9} pypy3 ) |
90 |
+PYTHON_REQ_USE="threads(+)" |
91 |
+ |
92 |
+inherit distutils-r1 |
93 |
+ |
94 |
+DESCRIPTION="A self-contained cryptographic library for Python" |
95 |
+HOMEPAGE="https://www.pycryptodome.org https://github.com/Legrandin/pycryptodome https://pypi.org/project/pycryptodome/" |
96 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
97 |
+ |
98 |
+LICENSE="BSD-2 Unlicense" |
99 |
+SLOT="0" |
100 |
+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" |
101 |
+IUSE="" |
102 |
+ |
103 |
+RDEPEND="dev-libs/gmp:0 |
104 |
+ virtual/python-cffi[${PYTHON_USEDEP}] |
105 |
+ !dev-python/pycrypto" |
106 |
+BDEPEND="${RDEPEND}" |
107 |
+ |
108 |
+PATCHES=( |
109 |
+ "${FILESDIR}/pycryptodome-3.9.4-parallel-make.patch" |
110 |
+) |
111 |
+ |
112 |
+distutils_enable_tests setup.py |
113 |
+ |
114 |
+python_prepare_all() { |
115 |
+ # parallel make fixes |
116 |
+ # Multiple targets were compiling the same file, setuptools doesn't |
117 |
+ # understand this and you get race conditions where a file gets |
118 |
+ # overwritten while it's linking. This makes the files look like separate |
119 |
+ # files so this race won't happen |
120 |
+ ln src/blowfish.c src/blowfish_eks.c || die |
121 |
+ ln src/mont.c src/mont_math.c || die |
122 |
+ |
123 |
+ distutils-r1_python_prepare_all |
124 |
+} |