Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pycryptopp/files/, dev-python/pycryptopp/
Date: Mon, 01 Oct 2018 17:00:21
Message-Id: 1538413183.66ca2f7ff2c8a8f51193d5d75d7f1cc0b77e5a44.whissi@gentoo
1 commit: 66ca2f7ff2c8a8f51193d5d75d7f1cc0b77e5a44
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 1 16:59:43 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 1 16:59:43 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66ca2f7f
7
8 dev-python/pycryptopp: fix building with crypto++-7+
9
10 Closes: https://bugs.gentoo.org/654614
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12 Package-Manager: Portage-2.3.50, Repoman-2.3.11
13
14 .../files/pycryptopp-0.7.1-abi-change.patch | 55 ++++++++++++++++++++++
15 ...opp-0.7.1.ebuild => pycryptopp-0.7.1-r1.ebuild} | 6 ++-
16 2 files changed, 59 insertions(+), 2 deletions(-)
17
18 diff --git a/dev-python/pycryptopp/files/pycryptopp-0.7.1-abi-change.patch b/dev-python/pycryptopp/files/pycryptopp-0.7.1-abi-change.patch
19 new file mode 100644
20 index 00000000000..d6edd2ecc63
21 --- /dev/null
22 +++ b/dev-python/pycryptopp/files/pycryptopp-0.7.1-abi-change.patch
23 @@ -0,0 +1,55 @@
24 +https://github.com/tahoe-lafs/pycryptopp/issues/42
25 +
26 +--- old/src/pycryptopp/cipher/aesmodule.cpp
27 ++++ old/src/pycryptopp/cipher/aesmodule.cpp
28 +@@ -20,6 +20,8 @@
29 + #include <src-cryptopp/aes.h>
30 + #endif
31 +
32 ++typedef unsigned char byte;
33 ++
34 + static const char*const aes___doc__ = "_aes counter mode cipher\n\
35 + You are advised to run aes.start_up_self_test() after importing this module.";
36 +
37 +--- old/src/pycryptopp/cipher/xsalsa20module.cpp
38 ++++ old/src/pycryptopp/cipher/xsalsa20module.cpp
39 +@@ -16,6 +16,8 @@
40 + #include <src-cryptopp/salsa.h>
41 + #endif
42 +
43 ++typedef unsigned char byte;
44 ++
45 + static const char* const xsalsa20__doc__ = "_xsalsa20 cipher";
46 +
47 + static PyObject *xsalsa20_error;
48 +--- old/src/pycryptopp/hash/sha256module.cpp
49 ++++ old/src/pycryptopp/hash/sha256module.cpp
50 +@@ -21,6 +21,8 @@
51 + #include <src-cryptopp/filters.h>
52 + #endif
53 +
54 ++typedef unsigned char byte;
55 ++
56 + static const char*const sha256___doc__ = "_sha256 hash function";
57 +
58 + static PyObject *sha256_error;
59 +--- old/src/pycryptopp/publickey/rsamodule.cpp
60 ++++ old/src/pycryptopp/publickey/rsamodule.cpp
61 +@@ -87,7 +87,7 @@
62 + VerifyingKey_serialize(VerifyingKey *self, PyObject *dummy) {
63 + std::string outstr;
64 + StringSink ss(outstr);
65 +- self->k->DEREncode(ss);
66 ++ self->k->GetMaterial().Save(ss);
67 + PyStringObject* result = reinterpret_cast<PyStringObject*>(PyString_FromStringAndSize(outstr.c_str(), outstr.size()));
68 + if (!result)
69 + return NULL;
70 +@@ -216,7 +216,7 @@
71 + SigningKey_serialize(SigningKey *self, PyObject *dummy) {
72 + std::string outstr;
73 + StringSink ss(outstr);
74 +- self->k->DEREncode(ss);
75 ++ self->k->GetMaterial().Save(ss);
76 + PyStringObject* result = reinterpret_cast<PyStringObject*>(PyString_FromStringAndSize(outstr.c_str(), outstr.size()));
77 + if (!result)
78 + return NULL;
79
80 diff --git a/dev-python/pycryptopp/pycryptopp-0.7.1.ebuild b/dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild
81 similarity index 89%
82 rename from dev-python/pycryptopp/pycryptopp-0.7.1.ebuild
83 rename to dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild
84 index 3a4257ebfa7..400c5ec5bc8 100644
85 --- a/dev-python/pycryptopp/pycryptopp-0.7.1.ebuild
86 +++ b/dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild
87 @@ -1,7 +1,7 @@
88 -# Copyright 1999-2018 Gentoo Foundation
89 +# Copyright 1999-2018 Gentoo Authors
90 # Distributed under the terms of the GNU General Public License v2
91
92 -EAPI="5"
93 +EAPI="6"
94 PYTHON_COMPAT=( python2_7 )
95
96 inherit distutils-r1 vcs-snapshot
97 @@ -25,6 +25,8 @@ DEPEND="${RDEPEND}
98
99 DOCS="NEWS.rst"
100
101 +PATCHES=( "${FILESDIR}"/${PN}-0.7.1-abi-change.patch )
102 +
103 S="${WORKDIR}/${MY_P}"
104
105 python_prepare_all() {