summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2009-12-23 21:56:41 +0000
committerFabian Groffen <grobian@gentoo.org>2009-12-23 21:56:41 +0000
commite87d5a43643491191134d6b17de28598ae3f8d83 (patch)
tree9739af37165130385dbbb0af3fd822f7cbacec5e /dev-python/pycrypto/files
parentTweak pkg_nofetch message a bit for last commit. (diff)
downloadgentoo-2-e87d5a43643491191134d6b17de28598ae3f8d83.tar.gz
gentoo-2-e87d5a43643491191134d6b17de28598ae3f8d83.tar.bz2
gentoo-2-e87d5a43643491191134d6b17de28598ae3f8d83.zip
Inject the python conigured libdir to the library search path to avoid not finding GMP, bug #291949
(Portage version: 2.2.00.15134-prefix/cvs/Darwin powerpc)
Diffstat (limited to 'dev-python/pycrypto/files')
-rw-r--r--dev-python/pycrypto/files/pycrypto-2.1.0-gmp.patch16
1 files changed, 15 insertions, 1 deletions
diff --git a/dev-python/pycrypto/files/pycrypto-2.1.0-gmp.patch b/dev-python/pycrypto/files/pycrypto-2.1.0-gmp.patch
index 1aafd8022d56..9b7c03baf93c 100644
--- a/dev-python/pycrypto/files/pycrypto-2.1.0-gmp.patch
+++ b/dev-python/pycrypto/files/pycrypto-2.1.0-gmp.patch
@@ -1,5 +1,19 @@
+* make GMP conditional
+* don't use hardwired search path /lib /usr/lib, but instead use the
+ python configured libdir (in particular under Prefix very important,
+ e.g. bug #291949)
+
--- setup.py
+++ setup.py
+@@ -36,7 +36,7 @@
+
+ __revision__ = "$Id: pycrypto-2.1.0-gmp.patch,v 1.2 2009/12/23 21:56:41 grobian Exp $"
+
+-from distutils import core
++from distutils import core, sysconfig
+ from distutils.core import Extension, Command
+ from distutils.command.build_ext import build_ext
+ import os, sys
@@ -151,11 +151,12 @@
if self.compiler.compiler_type == 'msvc':
self.compiler.include_dirs.insert(0, "src/inc-msvc/")
@@ -11,7 +25,7 @@
- self.__remove_extensions(["Crypto.PublicKey._fastmath"])
+ if os.environ.get("USE_GMP", "1") == "1":
+ # Detect libgmp and don't build _fastmath if it is missing.
-+ lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
++ lib_dirs = self.compiler.library_dirs + [sysconfig.get_config_var('LIBDIR'), '/lib', '/usr/lib']
+ if not (self.compiler.find_library_file(lib_dirs, 'gmp')):
+ print >>sys.stderr, "error: GMP library not found."
+ sys.exit(1)