From 66ca2f7ff2c8a8f51193d5d75d7f1cc0b77e5a44 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Mon, 1 Oct 2018 18:59:43 +0200 Subject: dev-python/pycryptopp: fix building with crypto++-7+ Closes: https://bugs.gentoo.org/654614 Signed-off-by: Thomas Deutschmann Package-Manager: Portage-2.3.50, Repoman-2.3.11 --- .../files/pycryptopp-0.7.1-abi-change.patch | 55 ++++++++++++++++++++++ dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild | 46 ++++++++++++++++++ dev-python/pycryptopp/pycryptopp-0.7.1.ebuild | 44 ----------------- 3 files changed, 101 insertions(+), 44 deletions(-) create mode 100644 dev-python/pycryptopp/files/pycryptopp-0.7.1-abi-change.patch create mode 100644 dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild delete mode 100644 dev-python/pycryptopp/pycryptopp-0.7.1.ebuild (limited to 'dev-python') 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 index 000000000000..d6edd2ecc630 --- /dev/null +++ b/dev-python/pycryptopp/files/pycryptopp-0.7.1-abi-change.patch @@ -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 + #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 + #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 + #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(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(PyString_FromStringAndSize(outstr.c_str(), outstr.size())); + if (!result) + return NULL; diff --git a/dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild b/dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild new file mode 100644 index 000000000000..400c5ec5bc83 --- /dev/null +++ b/dev-python/pycryptopp/pycryptopp-0.7.1-r1.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +PYTHON_COMPAT=( python2_7 ) + +inherit distutils-r1 vcs-snapshot + +NUM="869544967005693312591928092448767568728501330214" +MY_P="${P}.${NUM}" + +DESCRIPTION="Python wrappers for a few algorithms from the Crypto++ library" +HOMEPAGE="https://tahoe-lafs.org/trac/pycryptopp + https://pypi.org/project/pycryptopp/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="dev-libs/crypto++" +DEPEND="${RDEPEND} + dev-python/setuptools[${PYTHON_USEDEP}]" + +DOCS="NEWS.rst" + +PATCHES=( "${FILESDIR}"/${PN}-0.7.1-abi-change.patch ) + +S="${WORKDIR}/${MY_P}" + +python_prepare_all() { + # Don't install license files + sed -i -e "/data_files=data_files,/d" setup.py || die + + distutils-r1_python_prepare_all +} + +python_compile() { + # use system crypto++ library + distutils-r1_python_compile --disable-embedded-cryptopp +} + +python_test() { + esetup.py test +} diff --git a/dev-python/pycryptopp/pycryptopp-0.7.1.ebuild b/dev-python/pycryptopp/pycryptopp-0.7.1.ebuild deleted file mode 100644 index 3a4257ebfa77..000000000000 --- a/dev-python/pycryptopp/pycryptopp-0.7.1.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="5" -PYTHON_COMPAT=( python2_7 ) - -inherit distutils-r1 vcs-snapshot - -NUM="869544967005693312591928092448767568728501330214" -MY_P="${P}.${NUM}" - -DESCRIPTION="Python wrappers for a few algorithms from the Crypto++ library" -HOMEPAGE="https://tahoe-lafs.org/trac/pycryptopp - https://pypi.org/project/pycryptopp/" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -RDEPEND="dev-libs/crypto++" -DEPEND="${RDEPEND} - dev-python/setuptools[${PYTHON_USEDEP}]" - -DOCS="NEWS.rst" - -S="${WORKDIR}/${MY_P}" - -python_prepare_all() { - # Don't install license files - sed -i -e "/data_files=data_files,/d" setup.py || die - - distutils-r1_python_prepare_all -} - -python_compile() { - # use system crypto++ library - distutils-r1_python_compile --disable-embedded-cryptopp -} - -python_test() { - esetup.py test -} -- cgit v1.2.3