summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pycrypto/files/pycrypto-2.1.0-gmp.patch')
-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)