dev-python/pycryptopp: fix building with crypto++-7+
authorThomas Deutschmann <whissi@gentoo.org>
Mon, 1 Oct 2018 16:59:43 +0000 (18:59 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Mon, 1 Oct 2018 16:59:43 +0000 (18:59 +0200)
Closes: https://bugs.gentoo.org/654614
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Package-Manager: Portage-2.3.50, Repoman-2.3.11

dev-python/pycryptopp/files/pycryptopp-0.7.1-abi-change.patch [new file with mode: 0644]
dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild [moved from dev-python/pycryptopp/pycryptopp-0.7.1.ebuild with 89% similarity]

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
new file mode 100644 (file)
index 0000000..d6edd2e
--- /dev/null
@@ -0,0 +1,55 @@
+https://github.com/tahoe-lafs/pycryptopp/issues/42
+
+--- old/src/pycryptopp/cipher/aesmodule.cpp
++++ old/src/pycryptopp/cipher/aesmodule.cpp
+@@ -20,6 +20,8 @@
+ #include <src-cryptopp/aes.h>
+ #endif
++typedef unsigned char byte;
++
+ static const char*const aes___doc__ = "_aes counter mode cipher\n\
+ You are advised to run aes.start_up_self_test() after importing this module.";
+--- old/src/pycryptopp/cipher/xsalsa20module.cpp
++++ old/src/pycryptopp/cipher/xsalsa20module.cpp
+@@ -16,6 +16,8 @@
+ #include <src-cryptopp/salsa.h>
+ #endif
++typedef unsigned char byte;
++
+ static const char* const xsalsa20__doc__ = "_xsalsa20 cipher";
+ static PyObject *xsalsa20_error;
+--- old/src/pycryptopp/hash/sha256module.cpp
++++ old/src/pycryptopp/hash/sha256module.cpp
+@@ -21,6 +21,8 @@
+ #include <src-cryptopp/filters.h>
+ #endif
++typedef unsigned char byte;
++
+ static const char*const sha256___doc__ = "_sha256 hash function";
+ static PyObject *sha256_error;
+--- old/src/pycryptopp/publickey/rsamodule.cpp
++++ old/src/pycryptopp/publickey/rsamodule.cpp
+@@ -87,7 +87,7 @@
+ VerifyingKey_serialize(VerifyingKey *self, PyObject *dummy) {
+     std::string outstr;
+     StringSink ss(outstr);
+-    self->k->DEREncode(ss);
++    self->k->GetMaterial().Save(ss);
+     PyStringObject* result = reinterpret_cast<PyStringObject*>(PyString_FromStringAndSize(outstr.c_str(), outstr.size()));
+     if (!result)
+         return NULL;
+@@ -216,7 +216,7 @@
+ SigningKey_serialize(SigningKey *self, PyObject *dummy) {
+     std::string outstr;
+     StringSink ss(outstr);
+-    self->k->DEREncode(ss);
++    self->k->GetMaterial().Save(ss);
+     PyStringObject* result = reinterpret_cast<PyStringObject*>(PyString_FromStringAndSize(outstr.c_str(), outstr.size()));
+     if (!result)
+         return NULL;
similarity index 89%
rename from dev-python/pycryptopp/pycryptopp-0.7.1.ebuild
rename to dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild
index 3a4257ebfa77b95bf800384dfa9092deb792834a..400c5ec5bc83812352d5743e8e4da0d92535f6a2 100644 (file)
@@ -1,7 +1,7 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="5"
+EAPI="6"
 PYTHON_COMPAT=( python2_7 )
 
 inherit distutils-r1 vcs-snapshot
@@ -25,6 +25,8 @@ DEPEND="${RDEPEND}
 
 DOCS="NEWS.rst"
 
+PATCHES=( "${FILESDIR}"/${PN}-0.7.1-abi-change.patch )
+
 S="${WORKDIR}/${MY_P}"
 
 python_prepare_all() {