summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2015-05-25 16:41:54 +0000
committerMike Gilbert <floppym@gentoo.org>2015-05-25 16:41:54 +0000
commit495a5c4cb7bce82b7c0ed22e2e659703e19fb152 (patch)
treec2a7004f96cecf42540ac1bcd3f2387f379487e6 /dev-python
parentVersion bump with few bugfixes (diff)
downloadgentoo-2-495a5c4cb7bce82b7c0ed22e2e659703e19fb152.tar.gz
gentoo-2-495a5c4cb7bce82b7c0ed22e2e659703e19fb152.tar.bz2
gentoo-2-495a5c4cb7bce82b7c0ed22e2e659703e19fb152.zip
Resolve issues with swig-3.0.5, bug 538920.
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/m2crypto/ChangeLog9
-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-packaging.patch68
-rw-r--r--dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild44
4 files changed, 258 insertions, 1 deletions
diff --git a/dev-python/m2crypto/ChangeLog b/dev-python/m2crypto/ChangeLog
index b7af49ecc4d6..c608a78baa2e 100644
--- a/dev-python/m2crypto/ChangeLog
+++ b/dev-python/m2crypto/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-python/m2crypto
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/m2crypto/ChangeLog,v 1.85 2015/05/15 09:03:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/m2crypto/ChangeLog,v 1.86 2015/05/25 16:41:54 floppym Exp $
+
+*m2crypto-0.22.3-r4 (25 May 2015)
+
+ 25 May 2015; Mike Gilbert <floppym@gentoo.org>
+ +files/0.22.3-Use-swig-generated-python-loader.patch,
+ +files/0.22.3-packaging.patch, +m2crypto-0.22.3-r4.ebuild:
+ Resolve issues with swig-3.0.5, bug 538920.
15 May 2015; Mike Frysinger <vapier@gentoo.org>
+files/m2crypto-0.21.1-cross-compile.patch,
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
new file mode 100644
index 000000000000..9ddd5509fdf6
--- /dev/null
+++ b/dev-python/m2crypto/files/0.22.3-Use-swig-generated-python-loader.patch
@@ -0,0 +1,138 @@
+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-packaging.patch b/dev-python/m2crypto/files/0.22.3-packaging.patch
new file mode 100644
index 000000000000..54a4b560aba3
--- /dev/null
+++ b/dev-python/m2crypto/files/0.22.3-packaging.patch
@@ -0,0 +1,68 @@
+From d307a38515c5d050bbf8555d79aff3e4ce78af78 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
+Revert custom build and install classes
+---
+ setup.py | 20 ++++----------------
+ 1 file changed, 4 insertions(+), 16 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index fc89513..806464f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -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:
+@@ -162,5 +150,5 @@ interface.''',
+
+ ext_modules = [m2crypto],
+ test_suite='tests.alltests.suite',
+- cmdclass = {'build': CustomBuild, 'install': CustomInstall, 'build_ext': _M2CryptoBuildExt}
++ cmdclass = {'build_ext': _M2CryptoBuildExt}
+ )
+--
+2.4.1
+
diff --git a/dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild b/dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild
new file mode 100644
index 000000000000..7df88adddb9b
--- /dev/null
+++ b/dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/m2crypto/m2crypto-0.22.3-r4.ebuild,v 1.1 2015/05/25 16:41:54 floppym Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+MY_PN="M2Crypto"
+
+DESCRIPTION="M2Crypto: A Python crypto and SSL toolkit"
+HOMEPAGE="http://chandlerproject.org/bin/view/Projects/MeTooCrypto http://pypi.python.org/pypi/M2Crypto"
+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 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+# swig-3.0.5 results in broken constants, #538920
+RDEPEND=">=dev-libs/openssl-0.9.8:0="
+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
+
+python_prepare_all() {
+ epatch "${FILESDIR}"/0.22.3-Use-swig-generated-python-loader.patch
+ epatch "${FILESDIR}"/0.22.3-packaging.patch
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ esetup.py test
+}