From fb92acfbdd782cddac11bd150aabc28fded2ea6d Mon Sep 17 00:00:00 2001 From: minskim Date: Sun, 29 May 2005 08:41:34 +0000 Subject: Make the dbm module build when pkgsrc bdb is used. --- lang/python21/distinfo | 5 +-- lang/python21/patches/patch-ac | 69 ++++++++++++++++++++++++++++++++++++++---- lang/python21/patches/patch-ae | 14 +++++++++ 3 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 lang/python21/patches/patch-ae (limited to 'lang') diff --git a/lang/python21/distinfo b/lang/python21/distinfo index f95af0786dd..d0c09cca159 100644 --- a/lang/python21/distinfo +++ b/lang/python21/distinfo @@ -1,12 +1,13 @@ -$NetBSD: distinfo,v 1.17 2005/05/29 08:03:25 minskim Exp $ +$NetBSD: distinfo,v 1.18 2005/05/29 08:41:34 minskim Exp $ SHA1 (Python-2.1.3.tgz) = 7042a5c5fd60d334c0ac227885d68a4c305713b4 RMD160 (Python-2.1.3.tgz) = d7216480cf884507d97bf7932767871977fc1ccc Size (Python-2.1.3.tgz) = 6194432 bytes SHA1 (patch-aa) = 8273acc49a9eedad6e09685098178f3b7fb8f1c6 SHA1 (patch-ab) = f87a4d5c76182ab27ba79b42f00e8a2ff63bcf2b -SHA1 (patch-ac) = 731a0dd2286ee9ca95c26f92e74f2cbd0fdd905a +SHA1 (patch-ac) = 83d4aef6dc1a928ea27a18bc7c02828d4300fa48 SHA1 (patch-ad) = 769bcd7803723c8d538a74173792ffcc491fa414 +SHA1 (patch-ae) = f236291b5c54373063c28357c400a9fabe5a93c8 SHA1 (patch-af) = e17c20f83ba1219860a6aefd959364147c7963e1 SHA1 (patch-ah) = 637dfe0cb4d031760f1085fb7921c0ae77158221 SHA1 (patch-ai) = 6420f2994109b8cce55674ea14d7a974f9e039c6 diff --git a/lang/python21/patches/patch-ac b/lang/python21/patches/patch-ac index 876aa59c66f..96923258705 100644 --- a/lang/python21/patches/patch-ac +++ b/lang/python21/patches/patch-ac @@ -1,4 +1,4 @@ -$NetBSD: patch-ac,v 1.8 2005/05/29 08:03:25 minskim Exp $ +$NetBSD: patch-ac,v 1.9 2005/05/29 08:41:34 minskim Exp $ --- setup.py.orig 2001-12-27 15:51:02.000000000 -0600 +++ setup.py @@ -68,7 +68,27 @@ $NetBSD: patch-ac,v 1.8 2005/05/29 08:03:25 minskim Exp $ if (ssl_incs is not None and ssl_libs is not None): -@@ -346,16 +347,20 @@ class PyBuildExt(build_ext): +@@ -322,19 +323,6 @@ class PyBuildExt(build_ext): + # implementation independent wrapper for these; dumbdbm.py provides + # similar functionality (but slower of course) implemented in Python. + +- # The standard Unix dbm module: +- if platform not in ['cygwin']: +- if (self.compiler.find_library_file(lib_dirs, 'ndbm')): +- exts.append( Extension('dbm', ['dbmmodule.c'], +- libraries = ['ndbm'] ) ) +- else: +- exts.append( Extension('dbm', ['dbmmodule.c']) ) +- +- # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: +- if (self.compiler.find_library_file(lib_dirs, 'gdbm')): +- exts.append( Extension('gdbm', ['gdbmmodule.c'], +- libraries = ['gdbm'] ) ) +- + # Berkeley DB interface. + # + # This requires the Berkeley DB code, see +@@ -346,16 +334,20 @@ class PyBuildExt(build_ext): # (See http://electricrain.com/greg/python/bsddb3/ for an interface to # BSD DB 3.x.) @@ -95,7 +115,44 @@ $NetBSD: patch-ac,v 1.8 2005/05/29 08:03:25 minskim Exp $ define_macros=[('HAVE_DB_185_H',1)], libraries = dblib ) ) elif db_inc is not None: -@@ -408,8 +413,8 @@ class PyBuildExt(build_ext): +@@ -363,6 +355,36 @@ class PyBuildExt(build_ext): + include_dirs = db_inc, + libraries = dblib) ) + ++ # The standard Unix dbm module: ++ if platform not in ['cygwin']: ++ if find_file("ndbm.h", inc_dirs, []) is not None: ++ if (self.compiler.find_library_file(lib_dirs, 'ndbm')): ++ ndbm_libs = ['ndbm'] ++ else: ++ ndbm_libs = [] ++ exts.append( Extension('dbm', ['dbmmodule.c'], ++ libraries = ndbm_libs ) ) ++ elif find_file("ndbm.h", db_inc, []) is not None: ++ exts.append( Extension('dbm', ['dbmmodule.c'], ++ library_dirs=dblib_dir, ++ runtime_library_dirs=dblib_dir, ++ include_dirs=db_inc, ++ define_macros=[('HAVE_NDBM_H',None)], ++ libraries=dblib)) ++ elif db_inc is not None: ++ exts.append( Extension('dbm', ['dbmmodule.c'], ++ library_dirs=dblib_dir, ++ runtime_library_dirs=dblib_dir, ++ include_dirs=db_inc, ++ define_macros=[('HAVE_BERKDB_H',None), ++ ('DB_DBM_HSEARCH',None)], ++ libraries=dblib)) ++ ++ # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: ++ if (self.compiler.find_library_file(lib_dirs, 'gdbm')): ++ exts.append( Extension('gdbm', ['gdbmmodule.c'], ++ libraries = ['gdbm'] ) ) ++ + # The mpz module interfaces to the GNU Multiple Precision library. + # You need to ftp the GNU MP library. + # This was originally written and tested against GMP 1.2 and 1.3.2. +@@ -408,8 +430,8 @@ class PyBuildExt(build_ext): if (self.compiler.find_library_file(lib_dirs, 'ncurses')): curses_libs = ['ncurses'] @@ -106,7 +163,7 @@ $NetBSD: patch-ac,v 1.8 2005/05/29 08:03:25 minskim Exp $ elif (self.compiler.find_library_file(lib_dirs, 'curses')) and platform[:6] != 'darwin': # OSX has an old Berkeley curses, not good enough for the _curses module. if (self.compiler.find_library_file(lib_dirs, 'terminfo')): -@@ -417,8 +422,8 @@ class PyBuildExt(build_ext): +@@ -417,8 +439,8 @@ class PyBuildExt(build_ext): else: curses_libs = ['curses', 'termcap'] @@ -117,7 +174,7 @@ $NetBSD: patch-ac,v 1.8 2005/05/29 08:03:25 minskim Exp $ # If the curses module is enabled, check for the panel module if (os.path.exists('Modules/_curses_panel.c') and -@@ -451,23 +456,7 @@ class PyBuildExt(build_ext): +@@ -451,23 +473,7 @@ class PyBuildExt(build_ext): # Andrew Kuchling's zlib module. # This require zlib 1.1.3 (or later). # See http://www.cdrom.com/pub/infozip/zlib/ @@ -142,7 +199,7 @@ $NetBSD: patch-ac,v 1.8 2005/05/29 08:03:25 minskim Exp $ # Interface to the Expat XML parser # -@@ -609,7 +598,7 @@ def main(): +@@ -609,7 +615,7 @@ def main(): ext_modules=[Extension('struct', ['structmodule.c'])], # Scripts to install diff --git a/lang/python21/patches/patch-ae b/lang/python21/patches/patch-ae new file mode 100644 index 00000000000..dee14a6cbbf --- /dev/null +++ b/lang/python21/patches/patch-ae @@ -0,0 +1,14 @@ +$NetBSD: patch-ae,v 1.1 2005/05/29 08:41:34 minskim Exp $ + +--- Modules/dbmmodule.c.orig 2001-01-22 09:29:14.000000000 -0600 ++++ Modules/dbmmodule.c +@@ -20,6 +20,9 @@ static char *which_dbm = "BSD db"; + #elif defined(HAVE_GDBM_NDBM_H) + #include + static char *which_dbm = "GNU gdbm"; ++#elif defined(HAVE_BERKDB_H) ++#include ++static char *which_dbm = "Berkeley DB"; + #else + #error "No ndbm.h available!" + #endif -- cgit v1.2.3