summaryrefslogtreecommitdiff
path: root/lang/python31
diff options
context:
space:
mode:
authorsbd <sbd>2011-10-31 06:50:53 +0000
committersbd <sbd>2011-10-31 06:50:53 +0000
commit9fc0e39c2f06f9061a198b12522cc51044e981be (patch)
tree96fb10aeb62b081653b3936ffb63cca8a29acf7c /lang/python31
parentade705aa059a7a5cf06bd6fef7e07be950cbb304 (diff)
downloadpkgsrc-9fc0e39c2f06f9061a198b12522cc51044e981be.tar.gz
Improve the gdbm_compat handling by searching any ndbm.h found for the
string 'This file is part of GDBM' and ignoring it if it dose. Thanks to obache@ for the idea.
Diffstat (limited to 'lang/python31')
-rw-r--r--lang/python31/distinfo4
-rw-r--r--lang/python31/patches/patch-am71
2 files changed, 43 insertions, 32 deletions
diff --git a/lang/python31/distinfo b/lang/python31/distinfo
index 59deba0ea67..4eb6d907f0e 100644
--- a/lang/python31/distinfo
+++ b/lang/python31/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.4 2011/10/18 21:59:18 sbd Exp $
+$NetBSD: distinfo,v 1.5 2011/10/31 06:50:54 sbd Exp $
SHA1 (Python-3.1.4.tar.bz2) = 043d0240247f289205deeb0e620d799005202b3c
RMD160 (Python-3.1.4.tar.bz2) = d537706808b00989a636418b6b6a06357b6bb94b
@@ -7,7 +7,7 @@ SHA1 (patch-aa) = ae156c486007cfd14d378dd211108d3af4b841b1
SHA1 (patch-ab) = 7d4d6aa9239f53f1ce9ecd377890d71557c58ca4
SHA1 (patch-ah) = f93c0aab7b0d5e8e9f80433dda5ed5a22861f6b9
SHA1 (patch-al) = 48e348c64cf54756cf5b10254661ac089bec3e0a
-SHA1 (patch-am) = c7861e5c3bee63efa360218a2ff4685a23b45a3e
+SHA1 (patch-am) = dcc335f48a33c23275e07fa0e8f775917c770623
SHA1 (patch-an) = 933acde107b735931d26ace4eef251000b9f07ba
SHA1 (patch-ao) = dca396744edc5c0f86c8912bf54347a630cd865b
SHA1 (patch-au) = a2cefb240d91121315d02104416324c971af6a20
diff --git a/lang/python31/patches/patch-am b/lang/python31/patches/patch-am
index 2e291d574ee..14475c61048 100644
--- a/lang/python31/patches/patch-am
+++ b/lang/python31/patches/patch-am
@@ -1,4 +1,4 @@
-$NetBSD: patch-am,v 1.3 2011/10/18 21:59:18 sbd Exp $
+$NetBSD: patch-am,v 1.4 2011/10/31 06:50:55 sbd Exp $
--- setup.py.orig 2011-06-11 15:48:52.000000000 +0000
+++ setup.py
@@ -41,36 +41,47 @@ $NetBSD: patch-am,v 1.3 2011/10/18 21:59:18 sbd Exp $
if (ssl_incs is not None and
ssl_libs is not None):
-@@ -1054,13 +1058,15 @@ class PyBuildExt(build_ext):
- ndbm_libs = ['ndbm']
- else:
- ndbm_libs = []
-- print("building dbm using ndbm")
-- dbmext = Extension('_dbm', ['_dbmmodule.c'],
-+ if not self.compiler.find_library_file(lib_dirs,
-+ 'gdbm'):
-+ print("building dbm using ndbm")
-+ dbmext = Extension('_dbm', ['_dbmmodule.c'],
- define_macros=[
- ('HAVE_NDBM_H',None),
- ],
- libraries=ndbm_libs)
-- break
+@@ -1037,6 +1041,30 @@ class PyBuildExt(build_ext):
+ dbm_order = ['gdbm']
+ # The standard Unix dbm module:
+ if platform not in ['cygwin']:
++
++ ## Top half based on find_file
++ def find_ndbm_h(dirs):
++ ret = None
++ if sys.platform == 'darwin':
++ sysroot = macosx_sdk_root()
++ for dir in dirs:
++ f = os.path.join(dir, 'ndbm.h')
++ if sys.platform == 'darwin' and is_macosx_sdk_path(dir):
++ f = os.path.join(sysroot, dir[1:], filename)
++ if not os.path.exists(f): continue
++
++ ret = 'True'
++ input = text_file.TextFile(f)
++ while 1:
++ line = input.readline()
++ if not line: break
++ if re.search('This file is part of GDBM', line):
++ ret = None
+ break
-
- elif cand == "gdbm":
- if self.compiler.find_library_file(lib_dirs, 'gdbm'):
-@@ -1085,7 +1091,8 @@ class PyBuildExt(build_ext):
- ],
- libraries = gdbm_libs)
- break
-- elif cand == "bdb":
++ input.close()
++ break
++ return ret
+
-+ if cand == "bdb" and dbmext is None:
- if db_incs is not None:
- print("building dbm using bdb")
- dbmext = Extension('_dbm', ['_dbmmodule.c'],
-@@ -1315,6 +1322,14 @@ class PyBuildExt(build_ext):
+ config_args = [arg.strip("'")
+ for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
+ dbm_args = [arg for arg in config_args
+@@ -1048,7 +1076,7 @@ class PyBuildExt(build_ext):
+ dbmext = None
+ for cand in dbm_order:
+ if cand == "ndbm":
+- if find_file("ndbm.h", inc_dirs, []) is not None:
++ if find_ndbm_h(inc_dirs) is not None:
+ # Some systems have -lndbm, others don't
+ if self.compiler.find_library_file(lib_dirs, 'ndbm'):
+ ndbm_libs = ['ndbm']
+@@ -1315,6 +1343,14 @@ class PyBuildExt(build_ext):
macros = dict()
libraries = []
@@ -85,7 +96,7 @@ $NetBSD: patch-am,v 1.3 2011/10/18 21:59:18 sbd Exp $
else: # Linux and other unices
macros = dict()
libraries = ['rt']
-@@ -1831,8 +1846,8 @@ def main():
+@@ -1831,8 +1867,8 @@ def main():
# called unless there's at least one extension module defined.
ext_modules=[Extension('_struct', ['_struct.c'])],