summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorsbd <sbd>2011-10-31 04:17:24 +0000
committersbd <sbd>2011-10-31 04:17:24 +0000
commit8eba2f19e29bbe2d7439b04ec95efc003113319d (patch)
tree4ff83dfce83bbe596d9447b399565ea3acd7d1f8 /lang
parent3f325cc344a87002c10389ce68c227a0784d2126 (diff)
downloadpkgsrc-8eba2f19e29bbe2d7439b04ec95efc003113319d.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')
-rw-r--r--lang/python27/distinfo4
-rw-r--r--lang/python27/patches/patch-am62
2 files changed, 42 insertions, 24 deletions
diff --git a/lang/python27/distinfo b/lang/python27/distinfo
index 2aa816cb998..cbfab170c5b 100644
--- a/lang/python27/distinfo
+++ b/lang/python27/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.10 2011/10/18 21:59:18 sbd Exp $
+$NetBSD: distinfo,v 1.11 2011/10/31 04:17:24 sbd Exp $
SHA1 (Python-2.7.2.tar.bz2) = 417bdeea77abfaf1b9257fc6b4a04aaa209f4547
RMD160 (Python-2.7.2.tar.bz2) = c3bf4f09b7c429a4d9f4cc251c795304cd5232c5
@@ -12,7 +12,7 @@ SHA1 (patch-ad) = de730b9f5a5efb56afa8bed05824b5f6579242ec
SHA1 (patch-ae) = ff6d8c6164fe3c6dc4fb33d88eb8a49d5c5442f6
SHA1 (patch-ah) = 8e9ee44c7a054f1387b6d8ef8dbe9c1b8dc8d891
SHA1 (patch-al) = b97c2e73b9038e22f55ec226c2cbcc671466ad19
-SHA1 (patch-am) = 593f14d9f4ad9f46c57cc43a2a6402ffb9312437
+SHA1 (patch-am) = 7154c710bb42b9e0f4c65cefd80285d4f26ce873
SHA1 (patch-an) = 6098fbf0fc31422196cc40d3a227934523db11ca
SHA1 (patch-ao) = 9996a444fc0034c9f01fd18f4ad7bf714a8c8d04
SHA1 (patch-au) = 18fce68df48e43c2927cc83e6b4b404b5e1103b7
diff --git a/lang/python27/patches/patch-am b/lang/python27/patches/patch-am
index 0b341b9060b..8fb80e715bd 100644
--- a/lang/python27/patches/patch-am
+++ b/lang/python27/patches/patch-am
@@ -1,4 +1,4 @@
-$NetBSD: patch-am,v 1.4 2011/10/18 21:59:18 sbd Exp $
+$NetBSD: patch-am,v 1.5 2011/10/31 04:17:24 sbd Exp $
Disabled modules for normal build:
bsddb
@@ -233,7 +233,7 @@ Build the 1.85 compat module all the time against the BDB version of choice.
# The sqlite interface
sqlite_setup_debug = False # verbose debug prints from this script?
-@@ -1113,31 +951,12 @@ class PyBuildExt(build_ext):
+@@ -1113,35 +951,40 @@ class PyBuildExt(build_ext):
# we do not build this one. Otherwise this build will pick up
# the more recent berkeleydb's db.h file first in the include path
# when attempting to compile and it will fail.
@@ -270,26 +270,44 @@ Build the 1.85 compat module all the time against the BDB version of choice.
dbm_order = ['gdbm']
# The standard Unix dbm module:
-@@ -1160,13 +979,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
+ 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'):
-@@ -1192,19 +1013,16 @@ class PyBuildExt(build_ext):
++ input.close()
++ break
++ return ret
++
+ config_args = [arg.strip("'")
+ for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
+ dbm_args = [arg for arg in config_args
+@@ -1153,7 +996,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'):
+@@ -1192,19 +1035,16 @@ class PyBuildExt(build_ext):
],
libraries = gdbm_libs)
break
@@ -319,7 +337,7 @@ Build the 1.85 compat module all the time against the BDB version of choice.
if dbmext is not None:
exts.append(dbmext)
else:
-@@ -2066,9 +1884,9 @@ def main():
+@@ -2066,9 +1906,9 @@ def main():
ext_modules=[Extension('_struct', ['_struct.c'])],
# Scripts to install