| @@ -1,57 +1,57 @@ | | | @@ -1,57 +1,57 @@ |
1 | $NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $ | | 1 | $NetBSD: patch-am,v 1.4 2009/09/09 05:37:51 dsainty Exp $ |
2 | | | 2 | |
3 | --- setup.py.orig 2008-10-16 14:58:19.000000000 -0400 | | 3 | --- setup.py.orig 2008-10-16 14:58:19.000000000 -0400 |
4 | +++ setup.py | | 4 | +++ setup.py |
5 | @@ -15,7 +15,7 @@ from distutils.command.install import in | | 5 | @@ -15,7 +15,7 @@ |
6 | from distutils.command.install_lib import install_lib | | 6 | from distutils.command.install_lib import install_lib |
7 | | | 7 | |
8 | # This global variable is used to hold the list of modules to be disabled. | | 8 | # This global variable is used to hold the list of modules to be disabled. |
9 | -disabled_module_list = [] | | 9 | -disabled_module_list = [] |
10 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"] | | 10 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"] |
11 | | | 11 | |
12 | def add_dir_to_list(dirlist, dir): | | 12 | def add_dir_to_list(dirlist, dir): |
13 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | | 13 | """Add the directory 'dir' to the list 'dirlist' (at the front) if |
14 | @@ -243,9 +243,15 @@ class PyBuildExt(build_ext): | | 14 | @@ -243,9 +243,15 @@ |
15 | return sys.platform | | 15 | return sys.platform |
16 | | | 16 | |
17 | def detect_modules(self): | | 17 | def detect_modules(self): |
18 | - # Ensure that /usr/local is always used | | 18 | - # Ensure that /usr/local is always used |
19 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | | 19 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') |
20 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | | 20 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
21 | + # Add the buildlink directories for pkgsrc | | 21 | + # Add the buildlink directories for pkgsrc |
22 | + if os.environ.has_key('BUILDLINK_DIR'): | | 22 | + if os.environ.has_key('BUILDLINK_DIR'): |
23 | + dir = os.environ['BUILDLINK_DIR'] | | 23 | + dir = os.environ['BUILDLINK_DIR'] |
24 | + libdir = dir + '/lib' | | 24 | + libdir = dir + '/lib' |
25 | + incdir = dir + '/include' | | 25 | + incdir = dir + '/include' |
26 | + if libdir not in self.compiler.library_dirs: | | 26 | + if libdir not in self.compiler.library_dirs: |
27 | + self.compiler.library_dirs.insert(0, libdir) | | 27 | + self.compiler.library_dirs.insert(0, libdir) |
28 | + if incdir not in self.compiler.include_dirs: | | 28 | + if incdir not in self.compiler.include_dirs: |
29 | + self.compiler.include_dirs.insert(0, incdir) | | 29 | + self.compiler.include_dirs.insert(0, incdir) |
30 | | | 30 | |
31 | # Add paths specified in the environment variables LDFLAGS and | | 31 | # Add paths specified in the environment variables LDFLAGS and |
32 | # CPPFLAGS for header and library files. | | 32 | # CPPFLAGS for header and library files. |
33 | @@ -534,9 +540,7 @@ class PyBuildExt(build_ext): | | 33 | @@ -534,9 +540,7 @@ |
34 | if krb5_h: | | 34 | if krb5_h: |
35 | ssl_incs += krb5_h | | 35 | ssl_incs += krb5_h |
36 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, | | 36 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, |
37 | - ['/usr/local/ssl/lib', | | 37 | - ['/usr/local/ssl/lib', |
38 | - '/usr/contrib/ssl/lib/' | | 38 | - '/usr/contrib/ssl/lib/' |
39 | - ] ) | | 39 | - ] ) |
40 | + [] ) | | 40 | + [] ) |
41 | | | 41 | |
42 | if (ssl_incs is not None and | | 42 | if (ssl_incs is not None and |
43 | ssl_libs is not None): | | 43 | ssl_libs is not None): |
44 | @@ -609,269 +613,51 @@ class PyBuildExt(build_ext): | | 44 | @@ -609,269 +613,51 @@ |
45 | # a release. Most open source OSes come with one or more | | 45 | # a release. Most open source OSes come with one or more |
46 | # versions of BerkeleyDB already installed. | | 46 | # versions of BerkeleyDB already installed. |
47 | | | 47 | |
48 | - max_db_ver = (4, 5) | | 48 | - max_db_ver = (4, 5) |
49 | - # NOTE: while the _bsddb.c code links against BerkeleyDB 4.6.x | | 49 | - # NOTE: while the _bsddb.c code links against BerkeleyDB 4.6.x |
50 | - # we leave that version disabled by default as it has proven to be | | 50 | - # we leave that version disabled by default as it has proven to be |
51 | - # quite a buggy library release on many platforms. | | 51 | - # quite a buggy library release on many platforms. |
52 | - min_db_ver = (3, 3) | | 52 | - min_db_ver = (3, 3) |
53 | - db_setup_debug = False # verbose debug prints from this script? | | 53 | - db_setup_debug = False # verbose debug prints from this script? |
54 | - | | 54 | - |
55 | - # construct a list of paths to look for the header file in on | | 55 | - # construct a list of paths to look for the header file in on |
56 | - # top of the normal inc_dirs. | | 56 | - # top of the normal inc_dirs. |
57 | - db_inc_paths = [ | | 57 | - db_inc_paths = [ |
| @@ -280,111 +280,108 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50 | | | @@ -280,111 +280,108 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50 |
280 | + bsddb185_define_macros=[('HAVE_DB_185_H',1)] | | 280 | + bsddb185_define_macros=[('HAVE_DB_185_H',1)] |
281 | + dblib_dir = [os.environ['PY_BDB_LIBDIRS']] | | 281 | + dblib_dir = [os.environ['PY_BDB_LIBDIRS']] |
282 | else: | | 282 | else: |
283 | - sqlite_extra_link_args = () | | 283 | - sqlite_extra_link_args = () |
284 | - | | 284 | - |
285 | - exts.append(Extension('_sqlite3', sqlite_srcs, | | 285 | - exts.append(Extension('_sqlite3', sqlite_srcs, |
286 | - define_macros=sqlite_defines, | | 286 | - define_macros=sqlite_defines, |
287 | - include_dirs=["Modules/_sqlite", | | 287 | - include_dirs=["Modules/_sqlite", |
288 | - sqlite_incdir], | | 288 | - sqlite_incdir], |
289 | - library_dirs=sqlite_libdir, | | 289 | - library_dirs=sqlite_libdir, |
290 | - runtime_library_dirs=sqlite_libdir, | | 290 | - runtime_library_dirs=sqlite_libdir, |
291 | - extra_link_args=sqlite_extra_link_args, | | 291 | - extra_link_args=sqlite_extra_link_args, |
292 | - libraries=["sqlite3",])) | | 292 | - libraries=["sqlite3",])) |
293 | - | | 293 | + # check if db_incs/db.h really is db 1.85 |
| | | 294 | + f = "%s/db.h" % db_incs[0] |
| | | 295 | + if os.path.exists(f): |
| | | 296 | + data = open(f).read() |
| | | 297 | + m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) |
| | | 298 | + if m is None: |
| | | 299 | + # check for 1.85 compat header |
| | | 300 | + if os.path.exists("%s/db_185.h" % db_incs[0]): |
| | | 301 | + bsddb185_define_macros=[('HAVE_DB_185_H',1)] |
| | | 302 | + else: |
| | | 303 | + raise NotFound |
| | | 304 | + try: |
| | | 305 | + bltransform = os.environ['PY_BDB_TRANSFORM'] |
| | | 306 | + m = re.search(r"l:db:(db.)\s*", bltransform) |
| | | 307 | + if m is not None and m.group(1) is not None: |
| | | 308 | + dblibs = [m.group(1)] |
| | | 309 | + except: |
| | | 310 | + pass |
| | | 311 | |
294 | - # Look for Berkeley db 1.85. Note that it is built as a different | | 312 | - # Look for Berkeley db 1.85. Note that it is built as a different |
295 | - # module name so it can be included even when later versions are | | 313 | - # module name so it can be included even when later versions are |
296 | - # available. A very restrictive search is performed to avoid | | 314 | - # available. A very restrictive search is performed to avoid |
297 | - # accidentally building this module with a later version of the | | 315 | - # accidentally building this module with a later version of the |
298 | - # underlying db library. May BSD-ish Unixes incorporate db 1.85 | | 316 | - # underlying db library. May BSD-ish Unixes incorporate db 1.85 |
299 | - # symbols into libc and place the include file in /usr/include. | | 317 | - # symbols into libc and place the include file in /usr/include. |
300 | - # | | 318 | - # |
301 | - # If the better bsddb library can be built (db_incs is defined) | | 319 | - # If the better bsddb library can be built (db_incs is defined) |
302 | - # we do not build this one. Otherwise this build will pick up | | 320 | - # we do not build this one. Otherwise this build will pick up |
303 | - # the more recent berkeleydb's db.h file first in the include path | | 321 | - # the more recent berkeleydb's db.h file first in the include path |
304 | - # when attempting to compile and it will fail. | | 322 | - # when attempting to compile and it will fail. |
305 | - f = "/usr/include/db.h" | | 323 | - f = "/usr/include/db.h" |
306 | - if os.path.exists(f) and not db_incs: | | 324 | - if os.path.exists(f) and not db_incs: |
307 | - data = open(f).read() | | 325 | - data = open(f).read() |
308 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) | | 326 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) |
309 | - if m is not None: | | 327 | - if m is not None: |
310 | - # bingo - old version used hash file format version 2 | | 328 | - # bingo - old version used hash file format version 2 |
311 | - ### XXX this should be fixed to not be platform-dependent | | 329 | - ### XXX this should be fixed to not be platform-dependent |
312 | - ### but I don't have direct access to an osf1 platform and | | 330 | - ### but I don't have direct access to an osf1 platform and |
313 | - ### seemed to be muffing the search somehow | | 331 | - ### seemed to be muffing the search somehow |
314 | - libraries = platform == "osf1" and ['db'] or None | | 332 | - libraries = platform == "osf1" and ['db'] or None |
315 | - if libraries is not None: | | 333 | - if libraries is not None: |
316 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'], | | 334 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'], |
317 | - libraries=libraries)) | | 335 | - libraries=libraries)) |
318 | - else: | | 336 | - else: |
319 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) | | 337 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) |
320 | + # check if db_incs/db.h really is db 1.85 | | | |
321 | + f = "%s/db.h" % db_incs[0] | | | |
322 | + if os.path.exists(f): | | | |
323 | + data = open(f).read() | | | |
324 | + m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) | | | |
325 | + if m is None: | | | |
326 | + # check for 1.85 compat header | | | |
327 | + if os.path.exists("%s/db_185.h" % db_incs[0]): | | | |
328 | + bsddb185_define_macros=[('HAVE_DB_185_H',1)] | | | |
329 | + else: | | | |
330 | + raise NotFound | | | |
331 | + try: | | | |
332 | + bltransform = os.environ['PY_BDB_TRANSFORM'] | | | |
333 | + m = re.search(r"l:db:(db.)\s*", bltransform) | | | |
334 | + if m is not None and m.group(1) is not None: | | | |
335 | + dblibs = [m.group(1)] | | | |
336 | + except: | | | |
337 | + pass | | | |
338 | + | | | |
339 | + # build the bsddb185 extension module | | 338 | + # build the bsddb185 extension module |
340 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'], | | 339 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'], |
341 | + library_dirs=dblib_dir, | | 340 | + library_dirs=dblib_dir, |
342 | + runtime_library_dirs=dblib_dir, | | 341 | + runtime_library_dirs=dblib_dir, |
343 | + include_dirs=db_incs, | | 342 | + include_dirs=db_incs, |
344 | + define_macros=bsddb185_define_macros, | | 343 | + define_macros=bsddb185_define_macros, |
345 | + libraries=dblibs)) | | 344 | + libraries=dblibs)) |
346 | + except: | | 345 | + except: |
347 | + db_incs = None | | 346 | + db_incs = None |
348 | + dblibs = [] | | 347 | + dblibs = [] |
349 | + dblib_dir = None | | 348 | + dblib_dir = None |
350 | | | 349 | |
351 | # The standard Unix dbm module: | | 350 | # The standard Unix dbm module: |
352 | if platform not in ['cygwin']: | | 351 | if platform not in ['cygwin']: |
353 | @@ -884,6 +670,13 @@ class PyBuildExt(build_ext): | | 352 | @@ -884,11 +670,6 @@ |
354 | exts.append( Extension('dbm', ['dbmmodule.c'], | | 353 | exts.append( Extension('dbm', ['dbmmodule.c'], |
355 | define_macros=[('HAVE_NDBM_H',None)], | | 354 | define_macros=[('HAVE_NDBM_H',None)], |
356 | libraries = ndbm_libs ) ) | | 355 | libraries = ndbm_libs ) ) |
357 | + elif find_file("ndbm.h", db_incs, []) is not None: | | 356 | - elif (self.compiler.find_library_file(lib_dirs, 'gdbm') |
358 | + exts.append( Extension('dbm', ['dbmmodule.c'], | | 357 | - and find_file("gdbm/ndbm.h", inc_dirs, []) is not None): |
359 | + library_dirs=dblib_dir, | | 358 | - exts.append( Extension('dbm', ['dbmmodule.c'], |
360 | + runtime_library_dirs=dblib_dir, | | 359 | - define_macros=[('HAVE_GDBM_NDBM_H',None)], |
361 | + include_dirs=db_incs, | | 360 | - libraries = ['gdbm'] ) ) |
362 | + define_macros=[('HAVE_NDBM_H',None)], | | 361 | elif db_incs is not None: |
363 | + libraries=dblibs)) | | | |
364 | elif (self.compiler.find_library_file(lib_dirs, 'gdbm') | | | |
365 | and find_file("gdbm/ndbm.h", inc_dirs, []) is not None): | | | |
366 | exts.append( Extension('dbm', ['dbmmodule.c'], | | 362 | exts.append( Extension('dbm', ['dbmmodule.c'], |
367 | @@ -899,9 +692,9 @@ class PyBuildExt(build_ext): | | 363 | library_dirs=dblib_dir, |
| | | 364 | @@ -899,9 +680,9 @@ |
368 | libraries=dblibs)) | | 365 | libraries=dblibs)) |
369 | | | 366 | |
370 | # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: | | 367 | # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: |
371 | - if (self.compiler.find_library_file(lib_dirs, 'gdbm')): | | 368 | - if (self.compiler.find_library_file(lib_dirs, 'gdbm')): |
372 | - exts.append( Extension('gdbm', ['gdbmmodule.c'], | | 369 | - exts.append( Extension('gdbm', ['gdbmmodule.c'], |
373 | - libraries = ['gdbm'] ) ) | | 370 | - libraries = ['gdbm'] ) ) |
374 | + #if (self.compiler.find_library_file(lib_dirs, 'gdbm')): | | 371 | + #if (self.compiler.find_library_file(lib_dirs, 'gdbm')): |
375 | + # exts.append( Extension('gdbm', ['gdbmmodule.c'], | | 372 | + # exts.append( Extension('gdbm', ['gdbmmodule.c'], |
376 | + # libraries = ['gdbm'] ) ) | | 373 | + # libraries = ['gdbm'] ) ) |
377 | | | 374 | |
378 | # Unix-only modules | | 375 | # Unix-only modules |
379 | if platform not in ['mac', 'win32']: | | 376 | if platform not in ['mac', 'win32']: |
380 | @@ -1536,8 +1329,8 @@ def main(): | | 377 | @@ -1536,8 +1317,8 @@ |
381 | ext_modules=[Extension('_struct', ['_struct.c'])], | | 378 | ext_modules=[Extension('_struct', ['_struct.c'])], |
382 | | | 379 | |
383 | # Scripts to install | | 380 | # Scripts to install |
384 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', | | 381 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', |
385 | - 'Lib/smtpd.py'] | | 382 | - 'Lib/smtpd.py'] |
386 | + scripts = ['Tools/scripts/pydoc2.5', | | 383 | + scripts = ['Tools/scripts/pydoc2.5', |
387 | + 'Lib/smtpd2.5.py'] | | 384 | + 'Lib/smtpd2.5.py'] |
388 | ) | | 385 | ) |
389 | | | 386 | |
390 | # --install-platlib | | 387 | # --install-platlib |