pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/python21 Make the dbm module build when pkgsrc bd...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4b4b82e5c042
branches:  trunk
changeset: 494739:4b4b82e5c042
user:      minskim <minskim%pkgsrc.org@localhost>
date:      Sun May 29 08:41:34 2005 +0000

description:
Make the dbm module build when pkgsrc bdb is used.

diffstat:

 lang/python21/distinfo         |   5 +-
 lang/python21/patches/patch-ac |  69 ++++++++++++++++++++++++++++++++++++++---
 lang/python21/patches/patch-ae |  14 ++++++++
 3 files changed, 80 insertions(+), 8 deletions(-)

diffs (148 lines):

diff -r 5751aab4a13c -r 4b4b82e5c042 lang/python21/distinfo
--- a/lang/python21/distinfo    Sun May 29 08:03:25 2005 +0000
+++ b/lang/python21/distinfo    Sun May 29 08:41:34 2005 +0000
@@ -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 -r 5751aab4a13c -r 4b4b82e5c042 lang/python21/patches/patch-ac
--- a/lang/python21/patches/patch-ac    Sun May 29 08:03:25 2005 +0000
+++ b/lang/python21/patches/patch-ac    Sun May 29 08:41:34 2005 +0000
@@ -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 @@
  
          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 @@
                                     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 @@
          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 @@
  
          # 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 @@
  
          # 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 -r 5751aab4a13c -r 4b4b82e5c042 lang/python21/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python21/patches/patch-ae    Sun May 29 08:41:34 2005 +0000
@@ -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 <gdbm/ndbm.h>
+ static char *which_dbm = "GNU gdbm";
++#elif defined(HAVE_BERKDB_H)
++#include <db.h>
++static char *which_dbm = "Berkeley DB";
+ #else
+ #error "No ndbm.h available!"
+ #endif



Home | Main Index | Thread Index | Old Index