aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAric Belsito <lluixhi@gmail.com>2017-10-17 18:45:54 -0700
committerAric Belsito <lluixhi@gmail.com>2017-10-17 18:45:54 -0700
commit8edadab98aff4b92a227d4c96a583bcfa1478ace (patch)
treeea79ae01bf353504e7d4039eca46a5f63fb1a726 /dev-python
parentmedia-video/ffmpeg:version bump to 3.4 (diff)
downloadlibressl-8edadab98aff4b92a227d4c96a583bcfa1478ace.tar.gz
libressl-8edadab98aff4b92a227d4c96a583bcfa1478ace.tar.bz2
libressl-8edadab98aff4b92a227d4c96a583bcfa1478ace.zip
dev-python/m2crypto: update to latest version.
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/m2crypto/Manifest2
-rw-r--r--dev-python/m2crypto/files/0.22.3-Use-swig-generated-python-loader.patch138
-rw-r--r--dev-python/m2crypto/files/0.22.3-no-ssl3.patch12
-rw-r--r--dev-python/m2crypto/files/0.22.3-packaging.patch69
-rw-r--r--dev-python/m2crypto/files/0.26.4-libressl.patch245
-rw-r--r--dev-python/m2crypto/m2crypto-0.26.4.ebuild (renamed from dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild)22
6 files changed, 260 insertions, 228 deletions
diff --git a/dev-python/m2crypto/Manifest b/dev-python/m2crypto/Manifest
index 5ceb0d4..631c2ea 100644
--- a/dev-python/m2crypto/Manifest
+++ b/dev-python/m2crypto/Manifest
@@ -1 +1 @@
-DIST M2Crypto-0.22.3.tar.gz 74795 SHA256 6071bfc817d94723e9b458a010d565365104f84aa73f7fe11919871f7562ff72 SHA512 c179d3cf03ced77aed24285ca3f1527d5e05bbfe091a1522bff94a940fd390213fbb9b83d7ccd43ceae49626b427ae8790782cf93ead85be1e063bc4121c62e0 WHIRLPOOL 66a9a6e7c9b195814048a1bcecf6ef71a269bebb9dbda73801c88b3ba27330b555a46d05c53bbd0778f9c1e1bb5f9c6e7e860de443bf16baffc2072ee5996e31
+DIST M2Crypto-0.26.4.tar.gz 1116587 SHA256 5cae7acc0b34821f8c0ddf6665e482893fe1f198ad6379e61ffa9d8e65f5c199 SHA512 632b71850edd4f4e32d6d3aa83cb0e8068654c087498c88265f999180e0c58917aa6d29c5d1033f597397da98c3dc9acb9d21feddbb2f3da25a368f6a0af60f9 WHIRLPOOL 9388b016cf47f849379ef47a1819a9ee4fd647f8491a61e7381107032ba0e57f28bf6ebca868cf8cc6e4d6fb9341c77a01bc620b5133ea6e689aab72349a07d0
diff --git a/dev-python/m2crypto/files/0.22.3-Use-swig-generated-python-loader.patch b/dev-python/m2crypto/files/0.22.3-Use-swig-generated-python-loader.patch
deleted file mode 100644
index 9ddd550..0000000
--- a/dev-python/m2crypto/files/0.22.3-Use-swig-generated-python-loader.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From 803188070e486030cb1d2e53692b39305c742b17 Mon Sep 17 00:00:00 2001
-From: Joe Julian <jjulian@io.com>
-Date: Tue, 19 May 2015 23:54:08 -0700
-Subject: [PATCH] Use swig generated python loader
-
----
- .gitignore | 6 +++++-
- M2Crypto/__init__.py | 4 ++--
- M2Crypto/m2.py | 4 +---
- SWIG/_m2crypto.def | 2 +-
- SWIG/_m2crypto.i | 2 +-
- setup.py | 25 +++++++++++++++++++++----
- 6 files changed, 31 insertions(+), 12 deletions(-)
-
-diff --git a/M2Crypto/__init__.py b/M2Crypto/__init__.py
-index 647e057..38dbbd5 100644
---- a/M2Crypto/__init__.py
-+++ b/M2Crypto/__init__.py
-@@ -19,7 +19,7 @@ Copyright 2008-2011 Heikki Toivonen. All rights reserved.
- version_info = (0, 22)
- version = '.'.join([str(_v) for _v in version_info])
-
--import __m2crypto
-+import m2crypto
- import m2
- import ASN1
- import AuthCookie
-@@ -47,4 +47,4 @@ import m2xmlrpclib
- import threading
- import util
-
--__m2crypto.lib_init()
-+m2crypto.lib_init()
-diff --git a/M2Crypto/m2.py b/M2Crypto/m2.py
-index e4bb695..516cadb 100644
---- a/M2Crypto/m2.py
-+++ b/M2Crypto/m2.py
-@@ -25,7 +25,5 @@ Portions created by Open Source Applications Foundation (OSAF) are
- Copyright (C) 2004 OSAF. All Rights Reserved.
- """
-
--from __m2crypto import *
-+from m2crypto import *
- lib_init()
--
--
-diff --git a/SWIG/_m2crypto.def b/SWIG/_m2crypto.def
-index 753db2c..3e9d5bc 100644
---- a/SWIG/_m2crypto.def
-+++ b/SWIG/_m2crypto.def
-@@ -1,2 +1,2 @@
- EXPORTS
--init__m2crypto
-+init_m2crypto
-diff --git a/SWIG/_m2crypto.i b/SWIG/_m2crypto.i
-index 50be5c3..e491222 100644
---- a/SWIG/_m2crypto.i
-+++ b/SWIG/_m2crypto.i
-@@ -8,7 +8,7 @@
- *
- */
-
--%module(threads=1) _m2crypto
-+%module(threads=1) m2crypto
- /* We really don't need threadblock (PyGILState_Ensure() etc.) anywhere.
- Disable threadallow as well, only enable it for operations likely to
- block. */
-diff --git a/setup.py b/setup.py
-index bac6f9f..fc89513 100644
---- a/setup.py
-+++ b/setup.py
-@@ -17,9 +17,22 @@ import os, sys, platform
- from setuptools import setup
- from setuptools.command import build_ext
-
-+from distutils.util import get_platform
- from distutils.core import Extension
- from distutils.spawn import find_executable
-
-+from distutils.command.build import build
-+from setuptools.command.install import install
-+
-+class CustomBuild(build):
-+ def run(self):
-+ self.run_command('build_ext')
-+ build.run(self)
-+
-+class CustomInstall(install):
-+ def run(self):
-+ self.run_command('build_ext')
-+ self.do_egg_install()
-
- class _M2CryptoBuildExt(build_ext.build_ext):
- '''Specialization of build_ext to enable swig_opts to inherit any
-@@ -70,11 +83,12 @@ class _M2CryptoBuildExt(build_ext.build_ext):
-
- self.add_multiarch_paths()
-
-- opensslIncludeDir = os.path.join(self.openssl, 'include')
-+ includeDir = os.path.join(self.openssl, 'include')
-+ opensslIncludeDir = os.path.join(self.openssl, 'include', 'openssl')
- opensslLibraryDir = os.path.join(self.openssl, 'lib')
-
- self.swig_opts = ['-I%s' % i for i in self.include_dirs + \
-- [opensslIncludeDir, os.path.join(opensslIncludeDir, "openssl")]]
-+ [opensslIncludeDir, includeDir]]
- self.swig_opts.append('-includeall')
- self.swig_opts.append('-modern')
-
-@@ -85,6 +99,9 @@ class _M2CryptoBuildExt(build_ext.build_ext):
- elif platform.architecture()[0] == '32bit':
- self.swig_opts.append('-D__i386__')
-
-+ self.swig_opts.append('-outdir')
-+ self.swig_opts.append(os.path.join(os.getcwd(),'M2Crypto'))
-+
- self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
- os.path.join(os.getcwd(), 'SWIG')]
-
-@@ -103,7 +120,7 @@ if sys.platform == 'darwin':
- else:
- my_extra_compile_args = []
-
--m2crypto = Extension(name = 'M2Crypto.__m2crypto',
-+m2crypto = Extension(name = 'M2Crypto._m2crypto',
- sources = ['SWIG/_m2crypto.i'],
- extra_compile_args = ['-DTHREADING'] + my_extra_compile_args,
- #extra_link_args = ['-Wl,-search_paths_first'], # Uncomment to build Universal Mac binaries
-@@ -145,5 +162,5 @@ interface.''',
-
- ext_modules = [m2crypto],
- test_suite='tests.alltests.suite',
-- cmdclass = {'build_ext': _M2CryptoBuildExt}
-+ cmdclass = {'build': CustomBuild, 'install': CustomInstall, 'build_ext': _M2CryptoBuildExt}
- )
---
-2.4.1
-
diff --git a/dev-python/m2crypto/files/0.22.3-no-ssl3.patch b/dev-python/m2crypto/files/0.22.3-no-ssl3.patch
deleted file mode 100644
index fafdb50..0000000
--- a/dev-python/m2crypto/files/0.22.3-no-ssl3.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naurw M2Crypto-0.22.3.orig/SWIG/_ssl.i M2Crypto-0.22.3/SWIG/_ssl.i
---- M2Crypto-0.22.3.orig/SWIG/_ssl.i 2013-04-30 01:55:00.000000000 -0700
-+++ M2Crypto-0.22.3/SWIG/_ssl.i 2015-09-24 13:38:16.493673610 -0700
-@@ -48,8 +48,6 @@
- %rename(ssl_get_alert_desc_v) SSL_alert_desc_string_long;
- extern const char *SSL_alert_desc_string_long(int);
-
--%rename(sslv3_method) SSLv3_method;
--extern SSL_METHOD *SSLv3_method(void);
- %rename(sslv23_method) SSLv23_method;
- extern SSL_METHOD *SSLv23_method(void);
- %rename(tlsv1_method) TLSv1_method;
diff --git a/dev-python/m2crypto/files/0.22.3-packaging.patch b/dev-python/m2crypto/files/0.22.3-packaging.patch
deleted file mode 100644
index 26952a4..0000000
--- a/dev-python/m2crypto/files/0.22.3-packaging.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 0f2c82f097cf6d3722b7793fe1159160f3f52725 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Mon, 25 May 2015 12:08:47 -0400
-Subject: [PATCH] Gentoo-specific packaging fixes
-
-Fix cross-compiles
-EPREFIX support
----
- setup.py | 20 ++++----------------
- 1 file changed, 4 insertions(+), 16 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index fc89513..8360e7e 100644
---- a/setup.py
-+++ b/setup.py
-@@ -32,7 +32,7 @@ class CustomBuild(build):
- class CustomInstall(install):
- def run(self):
- self.run_command('build_ext')
-- self.do_egg_install()
-+ install.run(self)
-
- class _M2CryptoBuildExt(build_ext.build_ext):
- '''Specialization of build_ext to enable swig_opts to inherit any
-@@ -81,29 +81,19 @@ class _M2CryptoBuildExt(build_ext.build_ext):
-
- build_ext.build_ext.finalize_options(self)
-
-- self.add_multiarch_paths()
--
- includeDir = os.path.join(self.openssl, 'include')
- opensslIncludeDir = os.path.join(self.openssl, 'include', 'openssl')
- opensslLibraryDir = os.path.join(self.openssl, 'lib')
-
-- self.swig_opts = ['-I%s' % i for i in self.include_dirs + \
-- [opensslIncludeDir, includeDir]]
-+ eprefix = os.getenv('EPREFIX', '')
-+ self.swig_opts = ['-I' + eprefix + '/usr/include']
- self.swig_opts.append('-includeall')
- self.swig_opts.append('-modern')
-
-- # Fedora does hat tricks.
-- if platform.linux_distribution()[0] in ['Fedora', 'CentOS']:
-- if platform.architecture()[0] == '64bit':
-- self.swig_opts.append('-D__x86_64__')
-- elif platform.architecture()[0] == '32bit':
-- self.swig_opts.append('-D__i386__')
--
- self.swig_opts.append('-outdir')
- self.swig_opts.append(os.path.join(os.getcwd(),'M2Crypto'))
-
-- self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
-- os.path.join(os.getcwd(), 'SWIG')]
-+ self.include_dirs += [os.path.join(os.getcwd(), 'SWIG')]
-
- if sys.platform == 'cygwin':
- # Cygwin SHOULD work (there's code in distutils), but
-@@ -113,8 +103,6 @@ class _M2CryptoBuildExt(build_ext.build_ext):
- # Someday distutils will be fixed and this won't be needed.
- self.library_dirs += [os.path.join(self.openssl, 'bin')]
-
-- self.library_dirs += [os.path.join(self.openssl, opensslLibraryDir)]
--
- if sys.platform == 'darwin':
- my_extra_compile_args = ["-Wno-deprecated-declarations"]
- else:
---
-2.4.1
-
diff --git a/dev-python/m2crypto/files/0.26.4-libressl.patch b/dev-python/m2crypto/files/0.26.4-libressl.patch
new file mode 100644
index 0000000..4db1bff
--- /dev/null
+++ b/dev-python/m2crypto/files/0.26.4-libressl.patch
@@ -0,0 +1,245 @@
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_bio.i M2Crypto-0.26.4/SWIG/_bio.i
+--- M2Crypto-0.26.4.orig/SWIG/_bio.i 2017-10-17 18:22:17.157602333 -0700
++++ M2Crypto-0.26.4/SWIG/_bio.i 2017-10-17 18:31:52.799592024 -0700
+@@ -63,14 +63,14 @@
+ 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
+ }
+@@ -298,7 +298,7 @@
+ 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
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_evp.i M2Crypto-0.26.4/SWIG/_evp.i
+--- M2Crypto-0.26.4.orig/SWIG/_evp.i 2017-10-17 18:22:17.157602333 -0700
++++ M2Crypto-0.26.4/SWIG/_evp.i 2017-10-17 18:32:48.379591029 -0700
+@@ -19,7 +19,7 @@
+ #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));
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_lib.i M2Crypto-0.26.4/SWIG/_lib.i
+--- M2Crypto-0.26.4.orig/SWIG/_lib.i 2017-10-17 18:22:17.157602333 -0700
++++ M2Crypto-0.26.4/SWIG/_lib.i 2017-10-17 18:33:13.535590578 -0700
+@@ -487,7 +487,7 @@
+ %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
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_lib11_compat.i M2Crypto-0.26.4/SWIG/_lib11_compat.i
+--- M2Crypto-0.26.4.orig/SWIG/_lib11_compat.i 2017-10-17 18:22:17.156602333 -0700
++++ M2Crypto-0.26.4/SWIG/_lib11_compat.i 2017-10-17 18:34:12.117589529 -0700
+@@ -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>
+@@ -454,5 +454,5 @@
+ return 1;
+ }
+
+-#endif /* OPENSSL_VERSION_NUMBER */
++#endif /* OPENSSL_VERSION_NUMBER || LIBRESSL_VERSION_NUMBER */
+ %}
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_m2crypto_wrap.c M2Crypto-0.26.4/SWIG/_m2crypto_wrap.c
+--- M2Crypto-0.26.4.orig/SWIG/_m2crypto_wrap.c 2017-10-17 18:22:17.156602333 -0700
++++ M2Crypto-0.26.4/SWIG/_m2crypto_wrap.c 2017-10-17 18:40:03.847583230 -0700
+@@ -3764,7 +3764,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()];
+@@ -3772,7 +3772,7 @@
+ #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]++;
+@@ -3784,7 +3784,7 @@
+ }
+
+ 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;
+@@ -3793,7 +3793,7 @@
+
+
+ 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++) {
+@@ -3808,7 +3808,7 @@
+ }
+
+ 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);
+@@ -3834,7 +3834,7 @@
+ #include <ceval.h>
+
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #include <string.h>
+ #include <openssl/engine.h>
+@@ -4745,7 +4745,7 @@
+
+
+ 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
+@@ -5038,14 +5038,14 @@
+ 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
+ }
+@@ -5268,7 +5268,7 @@
+ 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
+@@ -5749,7 +5749,7 @@
+ #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));
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_ssl.i M2Crypto-0.26.4/SWIG/_ssl.i
+--- M2Crypto-0.26.4.orig/SWIG/_ssl.i 2017-10-17 18:22:17.157602333 -0700
++++ M2Crypto-0.26.4/SWIG/_ssl.i 2017-10-17 18:41:25.205581773 -0700
+@@ -29,7 +29,7 @@
+ #endif
+ %}
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100005L
++#if OPENSSL_VERSION_NUMBER >= 0x10100005L && !defined(LIBRESSL_VERSION_NUMBER)
+ %include <openssl/safestack.h>
+ #endif
+
+diff -Naur M2Crypto-0.26.4.orig/SWIG/_threads.i M2Crypto-0.26.4/SWIG/_threads.i
+--- M2Crypto-0.26.4.orig/SWIG/_threads.i 2017-10-17 18:22:17.157602333 -0700
++++ M2Crypto-0.26.4/SWIG/_threads.i 2017-10-17 18:42:10.303580966 -0700
+@@ -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 @@
+ #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 @@
+ }
+
+ 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 @@
+
+ %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_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);
+diff -Naur M2Crypto-0.26.4.orig/SWIG/libcrypto-compat.h M2Crypto-0.26.4/SWIG/libcrypto-compat.h
+--- M2Crypto-0.26.4.orig/SWIG/libcrypto-compat.h 2017-10-17 18:22:17.157602333 -0700
++++ M2Crypto-0.26.4/SWIG/libcrypto-compat.h 2017-10-17 18:42:49.654580261 -0700
+@@ -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.22.3-r4.ebuild b/dev-python/m2crypto/m2crypto-0.26.4.ebuild
index 28157b1..d198975 100644
--- a/dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild
+++ b/dev-python/m2crypto/m2crypto-0.26.4.ebuild
@@ -1,8 +1,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id$
-EAPI=5
+EAPI=6
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="threads(+)"
@@ -17,10 +16,15 @@ SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
LICENSE="BSD"
SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE=""
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
-RDEPEND=">=dev-libs/openssl-0.9.8:0="
+IUSE="libressl"
+
+RDEPEND="
+ !libressl? ( >=dev-libs/openssl-0.9.8:0= )
+ libressl? ( dev-libs/libressl:0= )
+ dev-python/typing[${PYTHON_USEDEP}]
+"
DEPEND="${RDEPEND}
>=dev-lang/swig-1.3.28:0
dev-python/setuptools[${PYTHON_USEDEP}]
@@ -32,11 +36,13 @@ S="${WORKDIR}/${MY_PN}-${PV}"
RESTRICT=test
PATCHES=(
- "${FILESDIR}"/0.22.3-Use-swig-generated-python-loader.patch
- "${FILESDIR}"/0.22.3-packaging.patch
- "${FILESDIR}"/0.22.3-no-ssl3.patch
+ "${FILESDIR}"/0.26.4-libressl.patch
)
+python_compile() {
+ distutils-r1_python_compile --openssl="${EPREFIX}"/usr
+}
+
python_test() {
esetup.py test
}