* [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/files/, dev-python/m2crypto/
@ 2021-08-03 11:37 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-08-03 11:37 UTC (permalink / raw
To: gentoo-commits
commit: bd416ab339944869da9c8dd68c3f1b56c14d0c91
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 3 11:18:12 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 3 11:37:51 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd416ab3
dev-python/m2crypto: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/m2crypto/Manifest | 1 -
.../files/m2crypto-0.37.1-openssl-fixes.patch | 76 -------------
.../m2crypto/files/m2crypto-0.37.1-py310.patch | 119 ---------------------
dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild | 69 ------------
4 files changed, 265 deletions(-)
diff --git a/dev-python/m2crypto/Manifest b/dev-python/m2crypto/Manifest
index 8b5375f4935..43b92192e60 100644
--- a/dev-python/m2crypto/Manifest
+++ b/dev-python/m2crypto/Manifest
@@ -1,2 +1 @@
-DIST M2Crypto-0.37.1.tar.gz 1247031 BLAKE2B 3628150b8da15d7356298b6e52e0d8fa7875921a184a0eba3a97eff0588c9e0fee340c92fd486919057d900d6e3b2b711174dde9761fe247848f92ac6434df0a SHA512 9a5e0220704b4897a9ca7efa4b3b57447b9175c52e8039a85bff7bb1a43b709c69f3c8b5903df461f8de39d3f8a20f9bf494df6f5882771846adfe2c03fbea9e
DIST M2Crypto-0.38.0.tar.gz 1241269 BLAKE2B 95433090e08ff72cd2b0779491dc38b89eca159b26812e763b5b8973e3d27249a96d5a2c983b59f414184f64beb8e455dc26979310378db89dd2081741d4d17d SHA512 b1e24e3101ce0dd9f17be4cabeddc2ec0f1228b270d74ef2fb38bae8807c5025b031d0743185f06370786a3dd5c3f42129720534dcff07ea4de3c727613f8d20
diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch
deleted file mode 100644
index c249f7adbb8..00000000000
--- a/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 73fbd1e646f6bbf202d4418bae80eb9941fbf552 Mon Sep 17 00:00:00 2001
-From: Casey Deccio <casey@deccio.net>
-Date: Fri, 8 Jan 2021 12:43:09 -0700
-Subject: [PATCH] Allow verify_cb_* to be called with ok=True
-
-With https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58
-OpenSSL allowed verificaton to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE
----
- tests/test_ssl.py | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/tests/test_ssl.py b/tests/test_ssl.py
-index 92b6942..7a3271a 100644
---- a/tests/test_ssl.py
-+++ b/tests/test_ssl.py
-@@ -59,8 +59,13 @@ def allocate_srv_port():
-
-
- def verify_cb_new_function(ok, store):
-- assert not ok
- err = store.get_error()
-+ # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of
-+ # aborting, this callback is called to retrieve additional error
-+ # information. In this case, ok might not be False.
-+ # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58
-+ if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
-+ assert not ok
- assert err in [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT,
- m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
- m2.X509_V_ERR_CERT_UNTRUSTED,
-@@ -618,7 +623,12 @@ class MiscSSLClientTestCase(BaseSSLClientTestCase):
-
- def verify_cb_old(self, ctx_ptr, x509_ptr, err, depth, ok):
- try:
-- self.assertFalse(ok)
-+ # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of
-+ # aborting, this callback is called to retrieve additional error
-+ # information. In this case, ok might not be False.
-+ # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58
-+ if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
-+ self.assertFalse(ok)
- self.assertIn(err,
- [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT,
- m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
---
-2.31.1
-
-From d06eaa88a5f491827733f32027c46de3557fbd05 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
-Date: Fri, 19 Feb 2021 15:53:02 +0100
-Subject: [PATCH] Use of RSA_SSLV23_PADDING has been deprecated.
-
-Fixes #293.
----
- tests/test_rsa.py | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/tests/test_rsa.py b/tests/test_rsa.py
-index 3de5016..7299785 100644
---- a/tests/test_rsa.py
-+++ b/tests/test_rsa.py
-@@ -124,11 +124,6 @@ class RSATestCase(unittest.TestCase):
- ptxt = priv.private_decrypt(ctxt, p)
- self.assertEqual(ptxt, self.data)
-
-- # sslv23_padding
-- ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding)
-- res = priv.private_decrypt(ctxt, RSA.sslv23_padding)
-- self.assertEqual(res, self.data)
--
- # no_padding
- with six.assertRaisesRegex(self, RSA.RSAError, 'data too small'):
- priv.public_encrypt(self.data, RSA.no_padding)
---
-2.31.1
-
diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
deleted file mode 100644
index f9be349fc3d..00000000000
--- a/dev-python/m2crypto/files/m2crypto-0.37.1-py310.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-diff --git a/SWIG/_bio.i b/SWIG/_bio.i
-index 84b76b3..6c090a4 100644
---- a/SWIG/_bio.i
-+++ b/SWIG/_bio.i
-@@ -246,8 +246,8 @@ PyObject *bio_set_cipher(BIO *b, EVP_CIPHER *c, PyObject *key, PyObject *iv, int
- const void *kbuf, *ibuf;
- Py_ssize_t klen, ilen;
-
-- if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
-- || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
-+ if ((m2_PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
-+ || (m2_PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
- return NULL;
-
- BIO_set_cipher(b, (const EVP_CIPHER *)c,
-diff --git a/SWIG/_ec.i b/SWIG/_ec.i
-index f47d593..a492f6f 100644
---- a/SWIG/_ec.i
-+++ b/SWIG/_ec.i
-@@ -466,7 +466,7 @@ EC_KEY* ec_key_from_pubkey_der(PyObject *pubkey) {
- const unsigned char *tempBuf;
- EC_KEY *keypair;
-
-- if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
-+ if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
- {
- return NULL;
- }
-@@ -486,7 +486,7 @@ EC_KEY* ec_key_from_pubkey_params(int nid, PyObject *pubkey) {
- const unsigned char *tempBuf;
- EC_KEY *keypair;
-
-- if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
-+ if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
- {
- return NULL;
- }
-diff --git a/SWIG/_lib.i b/SWIG/_lib.i
-index 954e99b..351134b 100644
---- a/SWIG/_lib.i
-+++ b/SWIG/_lib.i
-@@ -137,8 +137,8 @@ m2_PyObject_AsReadBuffer(PyObject * obj, const void **buffer,
- len = view.len;
- }
- } else {
-- if ((ret = PyObject_AsReadBuffer(obj, buffer, &len)) != 0)
-- return ret;
-+ PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
-+ return -1;
- }
- if (len > INT_MAX) {
- m2_PyBuffer_Release(obj, &view);
-@@ -171,11 +171,8 @@ static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags)
- if (PyObject_CheckBuffer(obj))
- ret = PyObject_GetBuffer(obj, view, flags);
- else {
-- const void *buf;
--
-- ret = PyObject_AsReadBuffer(obj, &buf, &view->len);
-- if (ret == 0)
-- view->buf = (void *)buf;
-+ PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
-+ return -1;
- }
- if (ret)
- return ret;
-@@ -633,7 +630,7 @@ BIGNUM *hex_to_bn(PyObject *value) {
- }
- }
- else {
-- if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
-+ if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
- return NULL;
- }
-
-@@ -665,7 +662,7 @@ BIGNUM *dec_to_bn(PyObject *value) {
- }
- }
- else {
-- if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
-+ if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
- return NULL;
- }
-
-diff --git a/SWIG/_rc4.i b/SWIG/_rc4.i
-index eb4747e..6af2dc6 100644
---- a/SWIG/_rc4.i
-+++ b/SWIG/_rc4.i
-@@ -46,7 +46,7 @@ PyObject *rc4_update(RC4_KEY *key, PyObject *in) {
- Py_ssize_t len;
- void *out;
-
-- if (PyObject_AsReadBuffer(in, &buf, &len) == -1)
-+ if (m2_PyObject_AsReadBuffer(in, &buf, &len) == -1)
- return NULL;
-
- if (!(out = PyMem_Malloc(len))) {
-diff --git a/SWIG/_util.i b/SWIG/_util.i
-index bc2ee61..18e446a 100644
---- a/SWIG/_util.i
-+++ b/SWIG/_util.i
-@@ -22,7 +22,7 @@ PyObject *util_hex_to_string(PyObject *blob) {
- char *ret;
- Py_ssize_t len;
-
-- if (PyObject_AsReadBuffer(blob, &buf, &len) == -1)
-+ if (m2_PyObject_AsReadBuffer(blob, &buf, &len) == -1)
- return NULL;
-
- ret = hex_to_string((unsigned char *)buf, len);
-@@ -44,7 +44,7 @@ PyObject *util_string_to_hex(PyObject *blob) {
- Py_ssize_t len0;
- long len;
-
-- if (PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
-+ if (m2_PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
- return NULL;
-
- len = len0;
diff --git a/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
deleted file mode 100644
index 86a23528664..00000000000
--- a/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 2018-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 toolchain-funcs
-
-MY_PN="M2Crypto"
-DESCRIPTION="A Python crypto and SSL toolkit"
-HOMEPAGE="https://gitlab.com/m2crypto/m2crypto https://pypi.org/project/M2Crypto/"
-SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
-S="${WORKDIR}/${MY_PN}-${PV}"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-BDEPEND="
- >=dev-lang/swig-2.0.9
- test? ( dev-python/parameterized[${PYTHON_USEDEP}] )
-"
-RDEPEND="
- dev-libs/openssl:0=
-"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${P}-openssl-fixes.patch"
- "${FILESDIR}/${P}-py310.patch"
-)
-
-swig_define() {
- local x
- for x; do
- if tc-cpp-is-true "defined(${x})"; then
- SWIG_FEATURES+=" -D${x}"
- fi
- done
-}
-
-src_prepare() {
- # TODO
- sed -e 's:test_server_simple_timeouts:_&:' \
- -i tests/test_ssl.py || die
- distutils-r1_src_prepare
-}
-
-python_compile() {
- # setup.py looks at platform.machine() to determine swig options.
- # For exotic ABIs, we need to give swig a hint.
- local -x SWIG_FEATURES=
-
- # https://bugs.gentoo.org/617946
- swig_define __ILP32__
-
- # https://bugs.gentoo.org/674112
- swig_define __ARM_PCS_VFP
-
- distutils-r1_python_compile --openssl="${ESYSROOT}"/usr
-}
-
-python_test() {
- esetup.py test
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/files/, dev-python/m2crypto/
@ 2021-04-12 12:46 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-04-12 12:46 UTC (permalink / raw
To: gentoo-commits
commit: 79f541287308eb3fbe33c39fdea31d4d1c5b8205
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 12 12:22:12 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Apr 12 12:46:47 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79f54128
dev-python/m2crypto: Backport OpenSSL fixes
Closes: https://bugs.gentoo.org/768495
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../files/m2crypto-0.37.1-openssl-fixes.patch | 76 ++++++++++++++++++++++
dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild | 69 ++++++++++++++++++++
2 files changed, 145 insertions(+)
diff --git a/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch b/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch
new file mode 100644
index 00000000000..c249f7adbb8
--- /dev/null
+++ b/dev-python/m2crypto/files/m2crypto-0.37.1-openssl-fixes.patch
@@ -0,0 +1,76 @@
+From 73fbd1e646f6bbf202d4418bae80eb9941fbf552 Mon Sep 17 00:00:00 2001
+From: Casey Deccio <casey@deccio.net>
+Date: Fri, 8 Jan 2021 12:43:09 -0700
+Subject: [PATCH] Allow verify_cb_* to be called with ok=True
+
+With https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58
+OpenSSL allowed verificaton to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE
+---
+ tests/test_ssl.py | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_ssl.py b/tests/test_ssl.py
+index 92b6942..7a3271a 100644
+--- a/tests/test_ssl.py
++++ b/tests/test_ssl.py
+@@ -59,8 +59,13 @@ def allocate_srv_port():
+
+
+ def verify_cb_new_function(ok, store):
+- assert not ok
+ err = store.get_error()
++ # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of
++ # aborting, this callback is called to retrieve additional error
++ # information. In this case, ok might not be False.
++ # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58
++ if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
++ assert not ok
+ assert err in [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT,
+ m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
+ m2.X509_V_ERR_CERT_UNTRUSTED,
+@@ -618,7 +623,12 @@ class MiscSSLClientTestCase(BaseSSLClientTestCase):
+
+ def verify_cb_old(self, ctx_ptr, x509_ptr, err, depth, ok):
+ try:
+- self.assertFalse(ok)
++ # If err is X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, then instead of
++ # aborting, this callback is called to retrieve additional error
++ # information. In this case, ok might not be False.
++ # See https://github.com/openssl/openssl/commit/2e06150e3928daa06d5ff70c32bffad8088ebe58
++ if err != m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
++ self.assertFalse(ok)
+ self.assertIn(err,
+ [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT,
+ m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
+--
+2.31.1
+
+From d06eaa88a5f491827733f32027c46de3557fbd05 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Fri, 19 Feb 2021 15:53:02 +0100
+Subject: [PATCH] Use of RSA_SSLV23_PADDING has been deprecated.
+
+Fixes #293.
+---
+ tests/test_rsa.py | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/tests/test_rsa.py b/tests/test_rsa.py
+index 3de5016..7299785 100644
+--- a/tests/test_rsa.py
++++ b/tests/test_rsa.py
+@@ -124,11 +124,6 @@ class RSATestCase(unittest.TestCase):
+ ptxt = priv.private_decrypt(ctxt, p)
+ self.assertEqual(ptxt, self.data)
+
+- # sslv23_padding
+- ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding)
+- res = priv.private_decrypt(ctxt, RSA.sslv23_padding)
+- self.assertEqual(res, self.data)
+-
+ # no_padding
+ with six.assertRaisesRegex(self, RSA.RSAError, 'data too small'):
+ priv.public_encrypt(self.data, RSA.no_padding)
+--
+2.31.1
+
diff --git a/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
new file mode 100644
index 00000000000..c650101f6d3
--- /dev/null
+++ b/dev-python/m2crypto/m2crypto-0.37.1-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 2018-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 toolchain-funcs
+
+MY_PN="M2Crypto"
+DESCRIPTION="A Python crypto and SSL toolkit"
+HOMEPAGE="https://gitlab.com/m2crypto/m2crypto https://pypi.org/project/M2Crypto/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="libressl test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=dev-lang/swig-2.0.9
+ test? ( dev-python/parameterized[${PYTHON_USEDEP}] )
+"
+RDEPEND="
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-openssl-fixes.patch"
+)
+
+swig_define() {
+ local x
+ for x; do
+ if tc-cpp-is-true "defined(${x})"; then
+ SWIG_FEATURES+=" -D${x}"
+ fi
+ done
+}
+
+src_prepare() {
+ # TODO
+ sed -e 's:test_server_simple_timeouts:_&:' \
+ -i tests/test_ssl.py || die
+ distutils-r1_src_prepare
+}
+
+python_compile() {
+ # setup.py looks at platform.machine() to determine swig options.
+ # For exotic ABIs, we need to give swig a hint.
+ local -x SWIG_FEATURES=
+
+ # https://bugs.gentoo.org/617946
+ swig_define __ILP32__
+
+ # https://bugs.gentoo.org/674112
+ swig_define __ARM_PCS_VFP
+
+ distutils-r1_python_compile --openssl="${ESYSROOT}"/usr
+}
+
+python_test() {
+ esetup.py test
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/files/, dev-python/m2crypto/
@ 2019-02-16 18:28 Aaron Bauman
0 siblings, 0 replies; 4+ messages in thread
From: Aaron Bauman @ 2019-02-16 18:28 UTC (permalink / raw
To: gentoo-commits
commit: e0cd10c7a66e1387dfc9ea020e3a749e714eb811
Author: Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
AuthorDate: Wed Jan 9 08:26:28 2019 +0000
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Sat Feb 16 18:28:22 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0cd10c7
dev-python/m2crypto: add LibreSSL support
Closes: https://bugs.gentoo.org/674942
Package-Manager: Portage-2.3.54, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/10781
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
.../m2crypto/files/m2crypto-libressl-0.31.0.patch | 222 +++++++++++++++++++++
...pto-0.31.0.ebuild => m2crypto-0.31.0-r1.ebuild} | 12 +-
2 files changed, 230 insertions(+), 4 deletions(-)
diff --git a/dev-python/m2crypto/files/m2crypto-libressl-0.31.0.patch b/dev-python/m2crypto/files/m2crypto-libressl-0.31.0.patch
new file mode 100644
index 00000000000..10ed142b33e
--- /dev/null
+++ b/dev-python/m2crypto/files/m2crypto-libressl-0.31.0.patch
@@ -0,0 +1,222 @@
+From fa56170c7adf5f124a48cf1074390adfc697272c Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <stefan.strogin@gmail.com>
+Date: Wed, 9 Jan 2019 10:15:08 +0200
+Subject: [PATCH] Fix compilation with LibreSSL
+
+---
+ SWIG/_bio.i | 8 +++++---
+ SWIG/_evp.i | 2 +-
+ SWIG/_lib.i | 2 +-
+ SWIG/_lib11_compat.i | 5 ++++-
+ SWIG/_m2crypto_wrap.c | 11 ++++++++---
+ SWIG/_ssl.i | 4 ++--
+ SWIG/_threads.i | 10 +++++-----
+ 7 files changed, 26 insertions(+), 16 deletions(-)
+
+diff --git a/SWIG/_bio.i b/SWIG/_bio.i
+index e85a275..8eada82 100644
+--- a/SWIG/_bio.i
++++ b/SWIG/_bio.i
+@@ -293,7 +293,7 @@ int bio_should_write(BIO* a) {
+ }
+
+ /* Macros for things not defined before 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+ static BIO_METHOD *
+ BIO_meth_new( int type, const char *name )
+ {
+@@ -325,11 +325,13 @@ BIO_meth_free( BIO_METHOD *meth )
+ #define BIO_set_shutdown(b, x) (b)->shutdown = x
+ #define BIO_get_shutdown(b) (b)->shutdown
+ #define BIO_set_init(b, x) b->init = x
+-#define BIO_get_init(b) (b)->init
+ #define BIO_set_data(b, x) b->ptr = x
+ #define BIO_clear_flags(b, x) b->flags &= ~(x)
+ #define BIO_get_data(b) b->ptr
+ #endif
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#define BIO_get_init(b) (b)->init
++#endif
+
+ /* implment custom BIO_s_pyfd */
+
+@@ -515,7 +517,7 @@ static long pyfd_ctrl(BIO *b, int cmd, long num, void *ptr) {
+ }
+
+ void pyfd_init(void) {
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if (!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
+ methods_fdp = BIO_meth_new(
+ BIO_get_new_index()|BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK,
+ "python file descriptor");
+diff --git a/SWIG/_evp.i b/SWIG/_evp.i
+index d04e806..6fa9b38 100644
+--- a/SWIG/_evp.i
++++ b/SWIG/_evp.i
+@@ -19,7 +19,7 @@ Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved.
+ #include <openssl/rsa.h>
+ #include <openssl/opensslv.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+
+ HMAC_CTX *HMAC_CTX_new(void) {
+ HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX));
+diff --git a/SWIG/_lib.i b/SWIG/_lib.i
+index c84b800..807d5f6 100644
+--- a/SWIG/_lib.i
++++ b/SWIG/_lib.i
+@@ -512,7 +512,7 @@ int passphrase_callback(char *buf, int num, int v, void *arg) {
+ %inline %{
+
+ void lib_init() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+ SSLeay_add_all_algorithms();
+ ERR_load_ERR_strings();
+ #endif
+diff --git a/SWIG/_lib11_compat.i b/SWIG/_lib11_compat.i
+index 1ec42dd..4234004 100644
+--- a/SWIG/_lib11_compat.i
++++ b/SWIG/_lib11_compat.i
+@@ -8,7 +8,7 @@
+ */
+
+ %{
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #include <string.h>
+ #include <openssl/engine.h>
+@@ -24,6 +24,9 @@ static void *CRYPTO_zalloc(size_t num, const char *file, int line)
+ return ret;
+ }
+
++#endif
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
++
+ #include <openssl/bn.h>
+
+ #ifndef BN_F_BN_GENCB_NEW
+diff --git a/SWIG/_m2crypto_wrap.c b/SWIG/_m2crypto_wrap.c
+index 0f07702..f168822 100644
+--- a/SWIG/_m2crypto_wrap.c
++++ b/SWIG/_m2crypto_wrap.c
+@@ -3838,7 +3838,7 @@ void threading_cleanup(void) {
+ #include <ceval.h>
+
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #include <string.h>
+ #include <openssl/engine.h>
+@@ -3854,6 +3854,9 @@ static void *CRYPTO_zalloc(size_t num, const char *file, int line)
+ return ret;
+ }
+
++#endif
++#ifdef OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
++
+ #include <openssl/bn.h>
+
+ #ifndef BN_F_BN_GENCB_NEW
+@@ -5315,7 +5318,7 @@ int bio_should_write(BIO* a) {
+ }
+
+ /* Macros for things not defined before 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+ static BIO_METHOD *
+ BIO_meth_new( int type, const char *name )
+ {
+@@ -5347,11 +5350,13 @@ BIO_meth_free( BIO_METHOD *meth )
+ #define BIO_set_shutdown(b, x) (b)->shutdown = x
+ #define BIO_get_shutdown(b) (b)->shutdown
+ #define BIO_set_init(b, x) b->init = x
+-#define BIO_get_init(b) (b)->init
+ #define BIO_set_data(b, x) b->ptr = x
+ #define BIO_clear_flags(b, x) b->flags &= ~(x)
+ #define BIO_get_data(b) b->ptr
+ #endif
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#define BIO_get_init(b) (b)->init
++#endif
+
+ /* implment custom BIO_s_pyfd */
+
+diff --git a/SWIG/_ssl.i b/SWIG/_ssl.i
+index 7257656..40b0582 100644
+--- a/SWIG/_ssl.i
++++ b/SWIG/_ssl.i
+@@ -27,7 +27,7 @@ typedef unsigned __int64 uint64_t;
+ #endif
+ %}
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100005L
++#if (!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100005L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
+ %include <openssl/safestack.h>
+ #endif
+
+@@ -261,7 +261,7 @@ void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout_err) {
+ }
+
+ const SSL_METHOD *tlsv1_method(void) {
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if (!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "Function TLSv1_method has been deprecated.", 1);
+ #endif
+diff --git a/SWIG/_threads.i b/SWIG/_threads.i
+index 69adb9f..fd2285a 100644
+--- a/SWIG/_threads.i
++++ b/SWIG/_threads.i
+@@ -5,7 +5,7 @@
+ #include <pythread.h>
+ #include <openssl/crypto.h>
+
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && (OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL))
+ #define CRYPTO_num_locks() (CRYPTO_NUM_LOCKS)
+ static PyThread_type_lock lock_cs[CRYPTO_num_locks()];
+ static long lock_count[CRYPTO_num_locks()];
+@@ -13,7 +13,7 @@ static int thread_mode = 0;
+ #endif
+
+ void threading_locking_callback(int mode, int type, const char *file, int line) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && (OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL))
+ if (mode & CRYPTO_LOCK) {
+ PyThread_acquire_lock(lock_cs[type], WAIT_LOCK);
+ lock_count[type]++;
+@@ -25,7 +25,7 @@ void threading_locking_callback(int mode, int type, const char *file, int line)
+ }
+
+ unsigned long threading_id_callback(void) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && (OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL))
+ return (unsigned long)PyThread_get_thread_ident();
+ #else
+ return (unsigned long)0;
+@@ -35,7 +35,7 @@ unsigned long threading_id_callback(void) {
+
+ %inline %{
+ void threading_init(void) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && (OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL))
+ int i;
+ if (!thread_mode) {
+ for (i=0; i<CRYPTO_num_locks(); i++) {
+@@ -50,7 +50,7 @@ void threading_init(void) {
+ }
+
+ void threading_cleanup(void) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && (OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL))
+ int i;
+ if (thread_mode) {
+ CRYPTO_set_locking_callback(NULL);
+--
+2.20.1
+
diff --git a/dev-python/m2crypto/m2crypto-0.31.0.ebuild b/dev-python/m2crypto/m2crypto-0.31.0-r1.ebuild
similarity index 85%
rename from dev-python/m2crypto/m2crypto-0.31.0.ebuild
rename to dev-python/m2crypto/m2crypto-0.31.0-r1.ebuild
index 89114bf03d7..d39f59a5d40 100644
--- a/dev-python/m2crypto/m2crypto-0.31.0.ebuild
+++ b/dev-python/m2crypto/m2crypto-0.31.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2018 Gentoo Authors
+# Copyright 2018-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -18,11 +18,11 @@ LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
-# NOTE: Apparently nobody cares about libressl support, dropping support
-# IUSE="libressl"
+IUSE="libressl"
RDEPEND="
- dev-libs/openssl:0=[-bindist(-)]
+ !libressl? ( dev-libs/openssl:0=[-bindist(-)] )
+ libressl? ( dev-libs/libressl:0= )
virtual/python-typing[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}
@@ -35,6 +35,10 @@ S="${WORKDIR}/${MY_PN}-${PV}"
# Tests access network, and fail randomly. Bug #431458.
RESTRICT=test
+PATCHES=(
+ "${FILESDIR}/${PN}-libressl-${PV}.patch"
+)
+
python_compile() {
# setup.py looks at platform.machine() to determine swig options.
# For exotic ABIs, we need to give swig a hint.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/files/, dev-python/m2crypto/
@ 2018-04-12 21:01 Aaron Bauman
0 siblings, 0 replies; 4+ messages in thread
From: Aaron Bauman @ 2018-04-12 21:01 UTC (permalink / raw
To: gentoo-commits
commit: 51e7514a7882be4bbf2a5ca3177cf77d16e4c39e
Author: Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 12 02:01:53 2018 +0000
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Thu Apr 12 20:59:48 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51e7514a
dev-python/m2crypto: properly detect LibreSSL versions
Ensure the build environment can determine the LibreSSL version. This
also fixes dependencies such as net-wireless/crda which fail to find the
m2crypto module due to the broken m2crypto build.
Bug: https://bugs.gentoo.org/633832
Package-Manager: Portage-2.3.28, Repoman-2.3.9
Closes: https://github.com/gentoo/gentoo/pull/7947
.../files/m2crypto-libressl-version-check.patch | 154 +++++++++++++++++++++
dev-python/m2crypto/m2crypto-0.27.0-r1.ebuild | 56 ++++++++
2 files changed, 210 insertions(+)
diff --git a/dev-python/m2crypto/files/m2crypto-libressl-version-check.patch b/dev-python/m2crypto/files/m2crypto-libressl-version-check.patch
new file mode 100644
index 00000000000..770c49f4278
--- /dev/null
+++ b/dev-python/m2crypto/files/m2crypto-libressl-version-check.patch
@@ -0,0 +1,154 @@
+--- a/SWIG/_bio.i
++++ b/SWIG/_bio.i
+@@ -63,14 +63,14 @@ extern BIO *BIO_pop(BIO *);
+ static PyObject *_bio_err;
+
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ void pyfd_init(void);
+ #endif
+
+ void bio_init(PyObject *bio_err) {
+ Py_INCREF(bio_err);
+ _bio_err = bio_err;
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ pyfd_init();
+ #endif
+ }
+@@ -299,7 +299,7 @@ int bio_should_write(BIO* a) {
+ return BIO_should_write(a);
+ }
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ /* implment custom BIO_s_pyfd */
+
+ #ifdef WIN32
+
+--- a/SWIG/_evp.i
++++ b/SWIG/_evp.i
+@@ -19,7 +19,7 @@ Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved.
+ #include <openssl/rsa.h>
+ #include <openssl/opensslv.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ HMAC_CTX *HMAC_CTX_new(void) {
+ HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX));
+
+--- a/SWIG/_lib.i
++++ b/SWIG/_lib.i
+@@ -18,7 +18,7 @@
+
+ %{
+ /* OpenSSL 1.0.2 copmatbility shim */
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
+ typedef void (*OPENSSL_sk_freefunc)(void *);
+ typedef void *(*OPENSSL_sk_copyfunc)(const void *);
+ typedef struct stack_st OPENSSL_STACK;
+@@ -501,7 +501,7 @@ int passphrase_callback(char *buf, int num, int v, void *arg) {
+ %inline %{
+
+ void lib_init() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ SSLeay_add_all_algorithms();
+ ERR_load_ERR_strings();
+ #endif
+
+--- a/SWIG/_lib11_compat.i
++++ b/SWIG/_lib11_compat.i
+@@ -8,7 +8,7 @@
+ */
+
+ %{
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #include <string.h>
+ #include <openssl/engine.h>
+
+--- a/SWIG/_ssl.i
++++ b/SWIG/_ssl.i
+@@ -268,7 +268,7 @@ void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout_err) {
+
+ #ifndef OPENSSL_NO_SSL3
+ const SSL_METHOD *sslv3_method(void) {
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "Function SSLv3_method has been deprecated.", 1);
+ #endif
+@@ -277,7 +277,7 @@ const SSL_METHOD *sslv3_method(void) {
+ #endif
+
+ const SSL_METHOD *tlsv1_method(void) {
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "Function TLSv1_method has been deprecated.", 1);
+ #endif
+
+--- a/SWIG/_threads.i
++++ b/SWIG/_threads.i
+@@ -5,7 +5,7 @@
+ #include <pythread.h>
+ #include <openssl/crypto.h>
+
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define CRYPTO_num_locks() (CRYPTO_NUM_LOCKS)
+ static PyThread_type_lock lock_cs[CRYPTO_num_locks()];
+ static long lock_count[CRYPTO_num_locks()];
+@@ -13,7 +13,7 @@ static int thread_mode = 0;
+ #endif
+
+ void threading_locking_callback(int mode, int type, const char *file, int line) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ if (mode & CRYPTO_LOCK) {
+ PyThread_acquire_lock(lock_cs[type], WAIT_LOCK);
+ lock_count[type]++;
+@@ -25,7 +25,7 @@ void threading_locking_callback(int mode, int type, const char *file, int line)
+ }
+
+ unsigned long threading_id_callback(void) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ return (unsigned long)PyThread_get_thread_ident();
+ #else
+ return (unsigned long)0;
+@@ -35,7 +35,7 @@ unsigned long threading_id_callback(void) {
+
+ %inline %{
+ void threading_init(void) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ int i;
+ if (!thread_mode) {
+ for (i=0; i<CRYPTO_num_locks(); i++) {
+@@ -50,7 +50,7 @@ void threading_init(void) {
+ }
+
+ void threading_cleanup(void) {
+-#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ int i;
+ if (thread_mode) {
+ CRYPTO_set_locking_callback(NULL);
+
+--- a/SWIG/libcrypto-compat.h
++++ b/SWIG/libcrypto-compat.h
+@@ -1,7 +1,7 @@
+ #ifndef LIBCRYPTO_COMPAT_H
+ #define LIBCRYPTO_COMPAT_H
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #include <openssl/rsa.h>
+ #include <openssl/dsa.h>
diff --git a/dev-python/m2crypto/m2crypto-0.27.0-r1.ebuild b/dev-python/m2crypto/m2crypto-0.27.0-r1.ebuild
new file mode 100644
index 00000000000..a1f68b64503
--- /dev/null
+++ b/dev-python/m2crypto/m2crypto-0.27.0-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+MY_PN="M2Crypto"
+
+DESCRIPTION="M2Crypto: A Python crypto and SSL toolkit"
+HOMEPAGE="https://gitlab.com/m2crypto/m2crypto https://pypi.python.org/pypi/M2Crypto"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+
+IUSE="libressl"
+
+RDEPEND="
+ !libressl? ( >=dev-libs/openssl-0.9.8:0=[-bindist(-)] )
+ libressl? ( dev-libs/libressl:0= )
+ dev-python/typing[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ >=dev-lang/swig-1.3.28:0
+ dev-python/setuptools[${PYTHON_USEDEP}]
+"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+# Tests access network, and fail randomly. Bug #431458.
+RESTRICT=test
+
+PATCHES=(
+ "${FILESDIR}/${PN}-libressl-version-check.patch"
+)
+
+python_compile() {
+ # setup.py looks at platform.machine() to determine swig options.
+ # For exotic ABIs, we need to give swig a hint.
+ # https://bugs.gentoo.org/617946
+ # TODO: Fix cross-compiles
+ local -x SWIG_FEATURES=
+ case ${ABI} in
+ x32) SWIG_FEATURES="-D__ILP32__" ;;
+ esac
+ distutils-r1_python_compile --openssl="${EPREFIX}"/usr
+}
+
+python_test() {
+ esetup.py test
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-03 11:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-03 11:37 [gentoo-commits] repo/gentoo:master commit in: dev-python/m2crypto/files/, dev-python/m2crypto/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2021-04-12 12:46 Michał Górny
2019-02-16 18:28 Aaron Bauman
2018-04-12 21:01 Aaron Bauman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox