Fix a possibly long-standing issue, but also possibly fallout from the db4

changes.  The "dbm" module could fail to build correctly, erroring out with:

*** WARNING: renaming "dbm" since importing it failed: build/lib.linux-i686-2.5/dbm.so: undefined symbol: dbm_firstkey

In this case, the "dbm" module has accidentally linked with "databases/gdbm",
which happens to be installed, but was never buildlinked in.  It may be
relevant that /usr/include/gdbm/ndbm.h is installed on this system.

Remove the "gdbm" test from the "dbm" module configuration, leaving the "ndbm"
support, and the fall-back "bdb" support (which will likely fall back to db4).

Bump PKGREVISION - the package would still install, but with missing
functionality.
This commit is contained in:
dsainty 2009-09-09 05:37:51 +00:00
parent df031e6813
commit 8eaa2569b0
3 changed files with 38 additions and 41 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.18 2009/09/08 10:06:35 drochner Exp $
# $NetBSD: Makefile,v 1.19 2009/09/09 05:37:51 dsainty Exp $
DISTNAME= Python-2.5.4
PKGNAME= python25-2.5.4
PKGREVISION= 2
PKGREVISION= 3
CATEGORIES= lang python
MASTER_SITES= http://www.python.org/ftp/python/2.5.4/
EXTRACT_SUFX= .tar.bz2

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.9 2009/07/24 14:50:33 schmonz Exp $
$NetBSD: distinfo,v 1.10 2009/09/09 05:37:51 dsainty Exp $
SHA1 (Python-2.5.4.tar.bz2) = 0f2e819d6381f72f26c734e00a6780b3933ea404
RMD160 (Python-2.5.4.tar.bz2) = 3a76c83464c3b1c38a60351ab054e33ac7195663
@ -14,7 +14,7 @@ SHA1 (patch-ai) = a89bee00860910f53a23b1c670d9c091846a03c1
SHA1 (patch-aj) = a75d680a6b8b1ad3c9222dcb841f4fb10db6d16d
SHA1 (patch-ak) = 948362c15ad59abeef46971f9b870b70655a62c7
SHA1 (patch-al) = 6247e3f85d555bae7850befbd7bfffbb233cecb3
SHA1 (patch-am) = 8910340d0a54ac0a053d50199e0dd77162c3b613
SHA1 (patch-am) = f444bb78a0ca8ea3fa3435e5946c8d9251cb5102
SHA1 (patch-an) = 17b4e17b3b562c29a050e9bb20447084ce82b8ab
SHA1 (patch-ao) = 9bbd5561c010e0a1ab8e0a70d27a5f77fd2089d2
SHA1 (patch-ap) = b864db92761c843a91374663bd2dbcfa57b317cf

View file

@ -1,8 +1,8 @@
$NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
$NetBSD: patch-am,v 1.4 2009/09/09 05:37:51 dsainty Exp $
--- setup.py.orig 2008-10-16 14:58:19.000000000 -0400
+++ setup.py
@@ -15,7 +15,7 @@ from distutils.command.install import in
@@ -15,7 +15,7 @@
from distutils.command.install_lib import install_lib
# This global variable is used to hold the list of modules to be disabled.
@ -11,7 +11,7 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -243,9 +243,15 @@ class PyBuildExt(build_ext):
@@ -243,9 +243,15 @@
return sys.platform
def detect_modules(self):
@ -30,7 +30,7 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
# Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files.
@@ -534,9 +540,7 @@ class PyBuildExt(build_ext):
@@ -534,9 +540,7 @@
if krb5_h:
ssl_incs += krb5_h
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
@ -41,7 +41,7 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
if (ssl_incs is not None and
ssl_libs is not None):
@@ -609,269 +613,51 @@ class PyBuildExt(build_ext):
@@ -609,269 +613,51 @@
# a release. Most open source OSes come with one or more
# versions of BerkeleyDB already installed.
@ -290,7 +290,25 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
- runtime_library_dirs=sqlite_libdir,
- extra_link_args=sqlite_extra_link_args,
- libraries=["sqlite3",]))
-
+ # check if db_incs/db.h really is db 1.85
+ f = "%s/db.h" % db_incs[0]
+ if os.path.exists(f):
+ data = open(f).read()
+ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
+ if m is None:
+ # check for 1.85 compat header
+ if os.path.exists("%s/db_185.h" % db_incs[0]):
+ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
+ else:
+ raise NotFound
+ try:
+ bltransform = os.environ['PY_BDB_TRANSFORM']
+ m = re.search(r"l:db:(db.)\s*", bltransform)
+ if m is not None and m.group(1) is not None:
+ dblibs = [m.group(1)]
+ except:
+ pass
- # Look for Berkeley db 1.85. Note that it is built as a different
- # module name so it can be included even when later versions are
- # available. A very restrictive search is performed to avoid
@ -317,25 +335,6 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
- libraries=libraries))
- else:
- exts.append(Extension('bsddb185', ['bsddbmodule.c']))
+ # check if db_incs/db.h really is db 1.85
+ f = "%s/db.h" % db_incs[0]
+ if os.path.exists(f):
+ data = open(f).read()
+ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
+ if m is None:
+ # check for 1.85 compat header
+ if os.path.exists("%s/db_185.h" % db_incs[0]):
+ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
+ else:
+ raise NotFound
+ try:
+ bltransform = os.environ['PY_BDB_TRANSFORM']
+ m = re.search(r"l:db:(db.)\s*", bltransform)
+ if m is not None and m.group(1) is not None:
+ dblibs = [m.group(1)]
+ except:
+ pass
+
+ # build the bsddb185 extension module
+ exts.append(Extension('bsddb185', ['bsddbmodule.c'],
+ library_dirs=dblib_dir,
@ -350,21 +349,19 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
# The standard Unix dbm module:
if platform not in ['cygwin']:
@@ -884,6 +670,13 @@ class PyBuildExt(build_ext):
@@ -884,11 +670,6 @@
exts.append( Extension('dbm', ['dbmmodule.c'],
define_macros=[('HAVE_NDBM_H',None)],
libraries = ndbm_libs ) )
+ elif find_file("ndbm.h", db_incs, []) is not None:
+ exts.append( Extension('dbm', ['dbmmodule.c'],
+ library_dirs=dblib_dir,
+ runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ define_macros=[('HAVE_NDBM_H',None)],
+ libraries=dblibs))
elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
- elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
- and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
- exts.append( Extension('dbm', ['dbmmodule.c'],
- define_macros=[('HAVE_GDBM_NDBM_H',None)],
- libraries = ['gdbm'] ) )
elif db_incs is not None:
exts.append( Extension('dbm', ['dbmmodule.c'],
@@ -899,9 +692,9 @@ class PyBuildExt(build_ext):
library_dirs=dblib_dir,
@@ -899,9 +680,9 @@
libraries=dblibs))
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
@ -377,7 +374,7 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $
# Unix-only modules
if platform not in ['mac', 'win32']:
@@ -1536,8 +1329,8 @@ def main():
@@ -1536,8 +1317,8 @@
ext_modules=[Extension('_struct', ['_struct.c'])],
# Scripts to install