Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/files/, dev-lang/python/
Date: Thu, 28 Apr 2016 15:07:16
Message-Id: 1461855943.6b8e9c8593f902585590f446a291f492e4d2bf82.haubi@gentoo
1 commit: 6b8e9c8593f902585590f446a291f492e4d2bf82
2 Author: Michael Haubenwallner <michael.haubenwallner <AT> ssi-schaefer <DOT> com>
3 AuthorDate: Wed Apr 27 13:42:59 2016 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 28 15:05:43 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6b8e9c85
7
8 python-2.7.11: add patch to use dlltool on Cygwin
9
10 .../files/python-2.5.2-cygwin-find_library.patch | 34 ++++++++++++++++++++++
11 dev-lang/python/python-2.7.11.ebuild | 3 ++
12 2 files changed, 37 insertions(+)
13
14 diff --git a/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch b/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch
15 new file mode 100644
16 index 0000000..381d073
17 --- /dev/null
18 +++ b/dev-lang/python/files/python-2.5.2-cygwin-find_library.patch
19 @@ -0,0 +1,34 @@
20 +--- origsrc/Python-2.5.2/Lib/ctypes/util.py 2007-09-14 15:05:26.000000000 -0500
21 ++++ src/Python-2.5.2/Lib/ctypes/util.py 2008-11-25 17:54:47.319296200 -0600
22 +@@ -41,6 +41,20 @@
23 + continue
24 + return None
25 +
26 ++elif sys.platform == "cygwin":
27 ++ def find_library(name):
28 ++ for libdir in ['/usr/lib', '/usr/local/lib']:
29 ++ for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]:
30 ++ implib = os.path.join(libdir, libext)
31 ++ if not os.path.exists(implib):
32 ++ continue
33 ++ cmd = "dlltool -I " + implib + " 2>/dev/null"
34 ++ res = os.popen(cmd).read().replace("\n","")
35 ++ if not res:
36 ++ continue
37 ++ return res
38 ++ return None
39 ++
40 + elif os.name == "posix":
41 + # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
42 + import re, tempfile, errno
43 +@@ -157,6 +173,10 @@
44 + print cdll.LoadLibrary("libcrypto.dylib")
45 + print cdll.LoadLibrary("libSystem.dylib")
46 + print cdll.LoadLibrary("System.framework/System")
47 ++ elif sys.platform == "cygwin":
48 ++ print cdll.LoadLibrary("cygbz2-1.dll")
49 ++ print find_library("crypt")
50 ++ print cdll.LoadLibrary("cygcrypt-0.dll")
51 + else:
52 + print cdll.LoadLibrary("libm.so")
53 + print cdll.LoadLibrary("libcrypt.so")
54
55 diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild
56 index d974398..4906dc2 100644
57 --- a/dev-lang/python/python-2.7.11.ebuild
58 +++ b/dev-lang/python/python-2.7.11.ebuild
59 @@ -129,6 +129,9 @@ src_prepare() {
60 epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
61 epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
62
63 + # On Cygwin, find_library("c") has to return "cygwin1.dll"
64 + epatch "${FILESDIR}/python-2.5.2-cygwin-find_library.patch"
65 +
66 # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
67 sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die