1 |
commit: 2acb2e9a2b53726945e74c0e64f082291217230f |
2 |
Author: Horea Christian <chr <AT> chymera <DOT> eu> |
3 |
AuthorDate: Sun Mar 27 04:14:20 2022 +0000 |
4 |
Commit: Horea Christian <horea.christ <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Mar 27 04:14:20 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=2acb2e9a |
7 |
|
8 |
dev-python/pycryptodomex: new package (DANDI stack) |
9 |
|
10 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
11 |
Signed-off-by: Horea Christian <chr <AT> chymera.eu> |
12 |
|
13 |
.../pycryptodome-3.10.1-system-libtomcrypt.patch | 50 ++++++++++++++++++++++ |
14 |
dev-python/pycryptodomex/metadata.xml | 21 +++++++++ |
15 |
.../pycryptodomex/pycryptodomex-3.10.4.ebuild | 43 +++++++++++++++++++ |
16 |
.../pycryptodomex/pycryptodomex-3.14.1.ebuild | 43 +++++++++++++++++++ |
17 |
4 files changed, 157 insertions(+) |
18 |
|
19 |
diff --git a/dev-python/pycryptodomex/files/pycryptodome-3.10.1-system-libtomcrypt.patch b/dev-python/pycryptodomex/files/pycryptodome-3.10.1-system-libtomcrypt.patch |
20 |
new file mode 100644 |
21 |
index 000000000..51a5766c1 |
22 |
--- /dev/null |
23 |
+++ b/dev-python/pycryptodomex/files/pycryptodome-3.10.1-system-libtomcrypt.patch |
24 |
@@ -0,0 +1,50 @@ |
25 |
+diff -dupr a/setup.py b/setup.py |
26 |
+--- a/setup.py 2021-02-09 13:49:46.356455141 +0100 |
27 |
++++ b/setup.py 2021-02-09 13:50:49.351076275 +0100 |
28 |
+@@ -367,13 +367,15 @@ ext_modules = [ |
29 |
+ sources=["src/CAST.c"], |
30 |
+ py_limited_api=True), |
31 |
+ Extension("Crypto.Cipher._raw_des", |
32 |
+- include_dirs=['src/', 'src/libtom/'], |
33 |
++ include_dirs=['src/'], |
34 |
+ sources=["src/DES.c"], |
35 |
+- py_limited_api=True), |
36 |
++ py_limited_api=True, |
37 |
++ extra_link_args=["-ltomcrypt"]), |
38 |
+ Extension("Crypto.Cipher._raw_des3", |
39 |
+- include_dirs=['src/', 'src/libtom/'], |
40 |
++ include_dirs=['src/'], |
41 |
+ sources=["src/DES3.c"], |
42 |
+- py_limited_api=True), |
43 |
++ py_limited_api=True, |
44 |
++ extra_link_args=["-ltomcrypt"]), |
45 |
+ Extension("Crypto.Util._cpuid_c", |
46 |
+ include_dirs=['src/'], |
47 |
+ sources=['src/cpuid.c'], |
48 |
+@@ -410,9 +412,10 @@ ext_modules = [ |
49 |
+ sources=["src/ARC4.c"], |
50 |
+ py_limited_api=True), |
51 |
+ Extension("Crypto.Cipher._Salsa20", |
52 |
+- include_dirs=['src/', 'src/libtom/'], |
53 |
++ include_dirs=['src/'], |
54 |
+ sources=["src/Salsa20.c"], |
55 |
+- py_limited_api=True), |
56 |
++ py_limited_api=True, |
57 |
++ extra_link_args=["-ltomcrypt"]), |
58 |
+ Extension("Crypto.Cipher._chacha20", |
59 |
+ include_dirs=['src/'], |
60 |
+ sources=["src/chacha20.c"], |
61 |
+Only in b: setup.py.orig |
62 |
+Only in b: setup.py.rej |
63 |
+diff -dupr a/src/DES.c b/src/DES.c |
64 |
+--- a/src/DES.c 2021-02-09 13:49:46.336454729 +0100 |
65 |
++++ b/src/DES.c 2021-02-09 13:50:02.640123617 +0100 |
66 |
+@@ -39,7 +39,7 @@ FAKE_INIT(raw_des3) |
67 |
+ |
68 |
+ /* Include the actial DES implementation */ |
69 |
+ #define LTC_NO_PROTOTYPES |
70 |
+-#include "libtom/tomcrypt_des.c" |
71 |
++#include <tomcrypt.h> |
72 |
+ |
73 |
+ struct block_state { |
74 |
+ symmetric_key sk; |
75 |
|
76 |
diff --git a/dev-python/pycryptodomex/metadata.xml b/dev-python/pycryptodomex/metadata.xml |
77 |
new file mode 100644 |
78 |
index 000000000..f9c82e80b |
79 |
--- /dev/null |
80 |
+++ b/dev-python/pycryptodomex/metadata.xml |
81 |
@@ -0,0 +1,21 @@ |
82 |
+<?xml version='1.0' encoding='UTF-8'?> |
83 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
84 |
+<pkgmetadata> |
85 |
+ <maintainer type="person"> |
86 |
+ <email>gentoo@×××××××.eu</email> |
87 |
+ <name>Horea Christian</name> |
88 |
+ </maintainer> |
89 |
+ <maintainer type="project"> |
90 |
+ <email>sci@g.o</email> |
91 |
+ <name>Gentoo Science Project</name> |
92 |
+ </maintainer> |
93 |
+ <longdescription lang="en"> |
94 |
+ Equivalent package to dev-python/cryptodome which installs |
95 |
+ modules under the Cryptodome package, so that PyCrypto and |
96 |
+ PyCryptodome can coexist. |
97 |
+ </longdescription> |
98 |
+ <upstream> |
99 |
+ <remote-id type="github">Legrandin/pycryptodome</remote-id> |
100 |
+ <remote-id type="pypi">pycryptodomex</remote-id> |
101 |
+ </upstream> |
102 |
+</pkgmetadata> |
103 |
|
104 |
diff --git a/dev-python/pycryptodomex/pycryptodomex-3.10.4.ebuild b/dev-python/pycryptodomex/pycryptodomex-3.10.4.ebuild |
105 |
new file mode 100644 |
106 |
index 000000000..0f5ad73c2 |
107 |
--- /dev/null |
108 |
+++ b/dev-python/pycryptodomex/pycryptodomex-3.10.4.ebuild |
109 |
@@ -0,0 +1,43 @@ |
110 |
+# Copyright 1999-2022 Gentoo Authors |
111 |
+# Distributed under the terms of the GNU General Public License v2 |
112 |
+ |
113 |
+EAPI=8 |
114 |
+ |
115 |
+DISTUTILS_USE_PEP517=setuptools |
116 |
+PYTHON_COMPAT=( python3_{8..10} pypy3) |
117 |
+PYTHON_REQ_USE="threads(+)" |
118 |
+ |
119 |
+inherit distutils-r1 |
120 |
+ |
121 |
+DESCRIPTION="Cryptographic library for Python" |
122 |
+HOMEPAGE="https://www.pycryptodome.org https://pypi.org/project/pycryptodomex/" |
123 |
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
124 |
+ |
125 |
+LICENSE="BSD-2 Unlicense" |
126 |
+SLOT="0" |
127 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux" |
128 |
+IUSE="test" |
129 |
+RESTRICT="!test? ( test )" |
130 |
+ |
131 |
+DEPEND=" |
132 |
+ dev-libs/gmp:0= |
133 |
+ >=dev-libs/libtomcrypt-1.18.2-r1:= |
134 |
+" |
135 |
+BDEPEND="virtual/python-cffi[${PYTHON_USEDEP}]" |
136 |
+RDEPEND=" |
137 |
+ ${DEPEND} |
138 |
+ ${BDEPEND} |
139 |
+" |
140 |
+ |
141 |
+PATCHES=( |
142 |
+ "${FILESDIR}/pycryptodome-3.10.1-system-libtomcrypt.patch" |
143 |
+) |
144 |
+ |
145 |
+distutils_enable_tests setup.py |
146 |
+ |
147 |
+python_prepare_all() { |
148 |
+ # make sure we're unbundling it correctly |
149 |
+ rm -r src/libtom || die |
150 |
+ |
151 |
+ distutils-r1_python_prepare_all |
152 |
+} |
153 |
|
154 |
diff --git a/dev-python/pycryptodomex/pycryptodomex-3.14.1.ebuild b/dev-python/pycryptodomex/pycryptodomex-3.14.1.ebuild |
155 |
new file mode 100644 |
156 |
index 000000000..0f5ad73c2 |
157 |
--- /dev/null |
158 |
+++ b/dev-python/pycryptodomex/pycryptodomex-3.14.1.ebuild |
159 |
@@ -0,0 +1,43 @@ |
160 |
+# Copyright 1999-2022 Gentoo Authors |
161 |
+# Distributed under the terms of the GNU General Public License v2 |
162 |
+ |
163 |
+EAPI=8 |
164 |
+ |
165 |
+DISTUTILS_USE_PEP517=setuptools |
166 |
+PYTHON_COMPAT=( python3_{8..10} pypy3) |
167 |
+PYTHON_REQ_USE="threads(+)" |
168 |
+ |
169 |
+inherit distutils-r1 |
170 |
+ |
171 |
+DESCRIPTION="Cryptographic library for Python" |
172 |
+HOMEPAGE="https://www.pycryptodome.org https://pypi.org/project/pycryptodomex/" |
173 |
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
174 |
+ |
175 |
+LICENSE="BSD-2 Unlicense" |
176 |
+SLOT="0" |
177 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux" |
178 |
+IUSE="test" |
179 |
+RESTRICT="!test? ( test )" |
180 |
+ |
181 |
+DEPEND=" |
182 |
+ dev-libs/gmp:0= |
183 |
+ >=dev-libs/libtomcrypt-1.18.2-r1:= |
184 |
+" |
185 |
+BDEPEND="virtual/python-cffi[${PYTHON_USEDEP}]" |
186 |
+RDEPEND=" |
187 |
+ ${DEPEND} |
188 |
+ ${BDEPEND} |
189 |
+" |
190 |
+ |
191 |
+PATCHES=( |
192 |
+ "${FILESDIR}/pycryptodome-3.10.1-system-libtomcrypt.patch" |
193 |
+) |
194 |
+ |
195 |
+distutils_enable_tests setup.py |
196 |
+ |
197 |
+python_prepare_all() { |
198 |
+ # make sure we're unbundling it correctly |
199 |
+ rm -r src/libtom || die |
200 |
+ |
201 |
+ distutils-r1_python_prepare_all |
202 |
+} |