diff options
author | recht <recht@pkgsrc.org> | 2004-04-13 22:48:41 +0000 |
---|---|---|
committer | recht <recht@pkgsrc.org> | 2004-04-13 22:48:41 +0000 |
commit | 70fe0c5f5481fbc2aeb9ba495d69dc5cdebca855 (patch) | |
tree | 81b5a982678aa8df98c37803fa49efabb0fec3db /lang/python23-pth | |
parent | 858493671844e34a47fc45c012f4430506edc5bd (diff) | |
download | pkgsrc-70fe0c5f5481fbc2aeb9ba495d69dc5cdebca855.tar.gz |
Rework bdb detection: Since we're using buildlink we could save rely
on the variables it sets (eg. BDB_TYPE). While at bl3ify.
Thanks to minskim@ for fixes and testing.
Diffstat (limited to 'lang/python23-pth')
-rw-r--r-- | lang/python23-pth/Makefile | 4 | ||||
-rw-r--r-- | lang/python23-pth/distinfo | 4 | ||||
-rw-r--r-- | lang/python23-pth/patches/patch-am | 323 |
3 files changed, 276 insertions, 55 deletions
diff --git a/lang/python23-pth/Makefile b/lang/python23-pth/Makefile index ffec3b8cd93..c289dad490a 100644 --- a/lang/python23-pth/Makefile +++ b/lang/python23-pth/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.19 2004/03/26 02:27:42 wiz Exp $ +# $NetBSD: Makefile,v 1.20 2004/04/13 22:48:41 recht Exp $ # PKGNAME= python23-pth-2.3.3 PKGREVISION= 2 PTHREAD_OPTS= require -.include "../../mk/pthread.buildlink2.mk" +.include "../../mk/pthread.buildlink3.mk" .if ${PTHREAD_TYPE} == "pth" CONFIGURE_ARGS+= --with-pth .endif diff --git a/lang/python23-pth/distinfo b/lang/python23-pth/distinfo index c67dc95f3b3..ced088c0697 100644 --- a/lang/python23-pth/distinfo +++ b/lang/python23-pth/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.13 2004/04/09 23:10:36 recht Exp $ +$NetBSD: distinfo,v 1.14 2004/04/13 22:48:42 recht Exp $ SHA1 (Python-2.3.3.tgz) = 034d2e3ed011ea753d4fee7efab16e31029b1e5e Size (Python-2.3.3.tgz) = 8491380 bytes @@ -9,5 +9,5 @@ SHA1 (patch-ae) = 544af90b9b7c5eb5cbad0ba0cefa3d9496b5efe3 SHA1 (patch-af) = 2989a1975c8ea435903eafc9add57cb7c4d7de14 SHA1 (patch-ah) = 4bc95e775a2b3f4f1997d0779c561db2e9e7b575 SHA1 (patch-al) = 2dfed1a40493b571e3477cfb56c2d0ed1b1deddf -SHA1 (patch-am) = 74e8d87ecd4cb17634e992a985393c72193b2892 +SHA1 (patch-am) = eda4c6161b4237e1281cc6b82b26c5195444dcff SHA1 (patch-ba) = dd8f89952d7f40c9a979e362758775f093e047bc diff --git a/lang/python23-pth/patches/patch-am b/lang/python23-pth/patches/patch-am index 1770cc3a88c..e61b77b82ab 100644 --- a/lang/python23-pth/patches/patch-am +++ b/lang/python23-pth/patches/patch-am @@ -1,4 +1,4 @@ -$NetBSD: patch-am,v 1.4 2004/03/22 06:33:58 minskim Exp $ +$NetBSD: patch-am,v 1.5 2004/04/13 22:48:42 recht Exp $ --- setup.py.orig 2003-10-21 15:01:21.000000000 -0500 +++ setup.py @@ -52,64 +52,285 @@ $NetBSD: patch-am,v 1.4 2004/03/22 06:33:58 minskim Exp $ if (ssl_incs is not None and ssl_libs is not None): -@@ -515,6 +517,7 @@ class PyBuildExt(build_ext): - '/usr/include/db3', - )}, - } -+ db_try_this = {} +@@ -479,116 +481,162 @@ class PyBuildExt(build_ext): - db_search_order = db_try_this.keys() - db_search_order.sort() -@@ -562,9 +565,11 @@ class PyBuildExt(build_ext): + # when sorted in reverse order, keys for this dict must appear in the + # order you wish to search - e.g., search for db4 before db3 +- db_try_this = { +- 'db4': {'libs': ('db-4.2', 'db42', 'db-4.1', 'db41', 'db-4.0', 'db4',), +- 'libdirs': ('/usr/local/BerkeleyDB.4.2/lib', +- '/usr/local/BerkeleyDB.4.1/lib', +- '/usr/local/BerkeleyDB.4.0/lib', +- '/usr/local/lib', +- '/opt/sfw', +- '/sw/lib', +- ), +- 'incdirs': ('/usr/local/BerkeleyDB.4.2/include', +- '/usr/local/include/db42', +- '/usr/local/BerkeleyDB.4.1/include', +- '/usr/local/include/db41', +- '/usr/local/BerkeleyDB.4.0/include', +- '/usr/local/include/db4', +- '/opt/sfw/include/db4', +- '/sw/include/db4', +- '/usr/include/db4', +- )}, +- 'db3': {'libs': ('db-3.3', 'db-3.2', 'db-3.1', 'db3',), +- 'libdirs': ('/usr/local/BerkeleyDB.3.3/lib', +- '/usr/local/BerkeleyDB.3.2/lib', +- '/usr/local/BerkeleyDB.3.1/lib', +- '/usr/local/lib', +- '/opt/sfw/lib', +- '/sw/lib', +- ), +- 'incdirs': ('/usr/local/BerkeleyDB.3.3/include', +- '/usr/local/BerkeleyDB.3.2/include', +- '/usr/local/BerkeleyDB.3.1/include', +- '/usr/local/include/db3', +- '/opt/sfw/include/db3', +- '/sw/include/db3', +- '/usr/include/db3', +- )}, +- } +- +- db_search_order = db_try_this.keys() +- db_search_order.sort() +- db_search_order.reverse() ++ #db_try_this = { ++ #'db4': {'libs': ('db-4.2', 'db42', 'db-4.1', 'db41', 'db-4.0', 'db4',), ++ #'libdirs': ('/usr/local/BerkeleyDB.4.2/lib', ++ #'/usr/local/BerkeleyDB.4.1/lib', ++ #'/usr/local/BerkeleyDB.4.0/lib', ++ #'/usr/local/lib', ++ #'/opt/sfw', ++ #'/sw/lib', ++ #), ++ #'incdirs': ('/usr/local/BerkeleyDB.4.2/include', ++ #'/usr/local/include/db42', ++ #'/usr/local/BerkeleyDB.4.1/include', ++ #'/usr/local/include/db41', ++ #'/usr/local/BerkeleyDB.4.0/include', ++ #'/usr/local/include/db4', ++ #'/opt/sfw/include/db4', ++ #'/sw/include/db4', ++ #'/usr/include/db4', ++ #)}, ++ #'db3': {'libs': ('db-3.3', 'db-3.2', 'db-3.1', 'db3',), ++ #'libdirs': ('/usr/local/BerkeleyDB.3.3/lib', ++ #'/usr/local/BerkeleyDB.3.2/lib', ++ #'/usr/local/BerkeleyDB.3.1/lib', ++ #'/usr/local/lib', ++ #'/opt/sfw/lib', ++ #'/sw/lib', ++ #), ++ #'incdirs': ('/usr/local/BerkeleyDB.3.3/include', ++ #'/usr/local/BerkeleyDB.3.2/include', ++ #'/usr/local/BerkeleyDB.3.1/include', ++ #'/usr/local/include/db3', ++ #'/opt/sfw/include/db3', ++ #'/sw/include/db3', ++ #'/usr/include/db3', ++ #)}, ++ #} ++ ++ #db_search_order = db_try_this.keys() ++ #db_search_order.sort() ++ #db_search_order.reverse() ++ ++ #class found(Exception): pass ++ #try: ++ ## See whether there is a Sleepycat header in the standard ++ ## search path. ++ #std_dbinc = None ++ #for d in inc_dirs: ++ #f = os.path.join(d, "db.h") ++ #if os.path.exists(f): ++ #f = open(f).read() ++ #m = re.search(r"#define\WDB_VERSION_MAJOR\W([1-9]+)", f) ++ #if m: ++ #std_dbinc = 'db' + m.group(1) ++ #for dbkey in db_search_order: ++ #dbd = db_try_this[dbkey] ++ #for dblib in dbd['libs']: ++ ## Prefer version-specific includes over standard ++ ## include locations. ++ #db_incs = find_file('db.h', [], dbd['incdirs']) ++ #dblib_dir = find_library_file(self.compiler, ++ #dblib, ++ #lib_dirs, ++ #list(dbd['libdirs'])) ++ #if (db_incs or dbkey == std_dbinc) and \ ++ #dblib_dir is not None: ++ #dblibs = [dblib] ++ #raise found ++ #except found: ++ #dblibs = [dblib] ++ ## A default source build puts Berkeley DB in something like ++ ## /usr/local/Berkeley.3.3 and the lib dir under that isn't ++ ## normally on ld.so's search path, unless the sysadmin has hacked ++ ## /etc/ld.so.conf. We add the directory to runtime_library_dirs ++ ## so the proper -R/--rpath flags get passed to the linker. This ++ ## is usually correct and most trouble free, but may cause problems ++ ## in some unusual system configurations (e.g. the directory is on ++ ## an NFS server that goes away). ++ #exts.append(Extension('_bsddb', ['_bsddb.c'], ++ #library_dirs=dblib_dir, ++ #runtime_library_dirs=dblib_dir, ++ #include_dirs=db_incs, ++ #libraries=dblibs)) ++ #else: ++ #db_incs = None ++ #dblibs = [] ++ #dblib_dir = None + +- class found(Exception): 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 ++ # accidentally building this module with a later version of the ++ # underlying db library. May BSD-ish Unixes incorporate db 1.85 ++ # symbols into libc and place the include file in /usr/include. ++ #f = "/usr/include/db.h" ++ #if os.path.exists(f): ++ #data = open(f).read() ++ #m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) ++ #if m is not None: ++ ## bingo - old version used hash file format version 2 ++ #### XXX this should be fixed to not be platform-dependent ++ #### but I don't have direct access to an osf1 platform and ++ #### seemed to be muffing the search somehow ++ #libraries = platform == "osf1" and ['db'] or None ++ #if libraries is not None: ++ #exts.append(Extension('bsddb185', ['bsddbmodule.c'], ++ #libraries=libraries)) ++ #else: ++ #exts.append(Extension('bsddb185', ['bsddbmodule.c'])) ++ ++ # rely on pkgsrc for Berkeley DB ++ class NotFound(Exception): pass + try: +- # See whether there is a Sleepycat header in the standard +- # search path. +- std_dbinc = None +- for d in inc_dirs: +- f = os.path.join(d, "db.h") ++ bdb_type = os.environ['PY_BDB_TYPE'] ++ db_incs = [os.environ['PY_BDB_INCDIRS']] ++ dblib_dir = None ++ dblibs = None ++ ++ # check if need to use the db_185.h compat header ++ bsddb185_define_macros=[] ++ if bdb_type == "db2" or bdb_type == "db3" or bdb_type == "db4": ++ bsddb185_define_macros=[('HAVE_DB_185_H',1)] ++ dblib_dir = [os.environ['PY_BDB_LIBDIRS']] ++ ++ else: ++ # check if db_incs/db.h really is db 1.85 ++ f = "%s/db.h" % db_incs[0] ++ + if os.path.exists(f): +- f = open(f).read() +- m = re.search(r"#define\WDB_VERSION_MAJOR\W([1-9]+)", f) +- if m: +- std_dbinc = 'db' + m.group(1) +- for dbkey in db_search_order: +- dbd = db_try_this[dbkey] +- for dblib in dbd['libs']: +- # Prefer version-specific includes over standard +- # include locations. +- db_incs = find_file('db.h', [], dbd['incdirs']) +- dblib_dir = find_library_file(self.compiler, +- dblib, +- lib_dirs, +- list(dbd['libdirs'])) +- if (db_incs or dbkey == std_dbinc) and \ +- dblib_dir is not None: +- dblibs = [dblib] +- raise found +- except found: +- dblibs = [dblib] +- # A default source build puts Berkeley DB in something like +- # /usr/local/Berkeley.3.3 and the lib dir under that isn't +- # normally on ld.so's search path, unless the sysadmin has hacked +- # /etc/ld.so.conf. We add the directory to runtime_library_dirs +- # so the proper -R/--rpath flags get passed to the linker. This +- # is usually correct and most trouble free, but may cause problems +- # in some unusual system configurations (e.g. the directory is on +- # an NFS server that goes away). +- exts.append(Extension('_bsddb', ['_bsddb.c'], ++ 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, + runtime_library_dirs=dblib_dir, include_dirs=db_incs, ++ define_macros=bsddb185_define_macros, libraries=dblibs)) - else: -- db_incs = None -- dblibs = [] +- else: ++ except: + db_incs = None + dblibs = [] - dblib_dir = None -+ db_incs =['%%DB185_INCS%%'] -+ dblibs = ['%%DB185_LIBS%%'] -+ dblib_dir = ['%%DB185_LIBDIR%%'] -+ if len(dblibs) > 0 and dblibs[0] == '': -+ dblibs = [] - - - # Look for Berkeley db 1.85. Note that it is built as a different -@@ -573,21 +578,30 @@ class PyBuildExt(build_ext): - # accidentally building this module with a later version of the - # underlying db library. May BSD-ish Unixes incorporate db 1.85 - # symbols into libc and place the include file in /usr/include. +- +- +- # 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 +- # accidentally building this module with a later version of the +- # underlying db library. May BSD-ish Unixes incorporate db 1.85 +- # symbols into libc and place the include file in /usr/include. - f = "/usr/include/db.h" -+ f = "%%DB185_H%%" - if os.path.exists(f): - data = open(f).read() - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) - if m is not None: -+ bsddb185_define_macros = [] -+ if f.split("/")[-1] == "db_185.h": -+ bsddb185_define_macros=[('HAVE_DB_185_H',1)] - # bingo - old version used hash file format version 2 - ### XXX this should be fixed to not be platform-dependent - ### but I don't have direct access to an osf1 platform and - ### seemed to be muffing the search somehow +- if os.path.exists(f): +- data = open(f).read() +- m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) +- if m is not None: +- # bingo - old version used hash file format version 2 +- ### XXX this should be fixed to not be platform-dependent +- ### but I don't have direct access to an osf1 platform and +- ### seemed to be muffing the search somehow - libraries = platform == "osf1" and ['db'] or None -+ #libraries = platform == "osf1" and ['db'] or None -+ libraries = dblibs - if libraries is not None: - exts.append(Extension('bsddb185', ['bsddbmodule.c'], -+ library_dirs=dblib_dir, -+ runtime_library_dirs=dblib_dir, -+ include_dirs=db_incs, -+ define_macros=bsddb185_define_macros, - libraries=libraries)) - else: +- if libraries is not None: +- exts.append(Extension('bsddb185', ['bsddbmodule.c'], +- libraries=libraries)) +- else: - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) -+ exts.append(Extension('bsddb185', ['bsddbmodule.c'], -+ define_macros=bsddb185_define_macros)) - +- ++ dblib_dir = None ++ # The standard Unix dbm module: if platform not in ['cygwin']: -@@ -770,7 +784,7 @@ class PyBuildExt(build_ext): + if find_file("ndbm.h", inc_dirs, []) is not None: +@@ -600,6 +648,13 @@ class PyBuildExt(build_ext): + 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): + exts.append( Extension('dbm', ['dbmmodule.c'], +@@ -770,7 +825,7 @@ class PyBuildExt(build_ext): # Linux-specific modules exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) ) @@ -118,7 +339,7 @@ $NetBSD: patch-am,v 1.4 2004/03/22 06:33:58 minskim Exp $ exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) ) if platform == 'sunos5': -@@ -1140,7 +1154,7 @@ def main(): +@@ -1140,7 +1195,7 @@ def main(): ext_modules=[Extension('struct', ['structmodule.c'])], # Scripts to install |