| @@ -1,35 +1,35 @@ | | | @@ -1,35 +1,35 @@ |
1 | $NetBSD: patch-am,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $ | | 1 | $NetBSD: patch-am,v 1.2 2011/05/06 16:27:04 abs Exp $ |
2 | | | 2 | |
3 | Disabled modules for normal build: | | 3 | Disabled modules for normal build: |
4 | bsddb | | 4 | bsddb |
5 | curses | | 5 | curses |
6 | curses_panel | | 6 | curses_panel |
7 | elementtree | | 7 | elementtree |
8 | sqlite3 | | 8 | sqlite3 |
9 | tkinter | | 9 | tkinter |
10 | gdbm | | 10 | gdbm |
11 | pyexpat | | 11 | pyexpat |
12 | readline | | 12 | readline |
13 | {linux,oss,sun}audiodev | | 13 | {linux,oss,sun}audiodev |
14 | spwd | | 14 | spwd |
15 | Those have separate packages where needed. | | 15 | Those have separate packages where needed. |
16 | | | 16 | |
17 | Only check the BUILDLINK_DIR for libraries etc, do not pick up random | | 17 | Only check the BUILDLINK_DIR for libraries etc, do not pick up random |
18 | headers and libraries from the system. | | 18 | headers and libraries from the system. |
19 | | | 19 | |
20 | Build the 1.85 compat module all the time against the BDB version of choice. | | 20 | Build the 1.85 compat module all the time against the BDB version of choice. |
21 | | | 21 | |
22 | --- setup.py.orig 2010-06-27 12:36:16.000000000 +0000 | | 22 | --- setup.py.orig 2010-10-31 16:40:21.000000000 +0000 |
23 | +++ setup.py | | 23 | +++ setup.py |
24 | @@ -21,7 +21,7 @@ from distutils.spawn import find_executa | | 24 | @@ -21,7 +21,7 @@ from distutils.spawn import find_executa |
25 | COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') | | 25 | COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') |
26 | | | 26 | |
27 | # This global variable is used to hold the list of modules to be disabled. | | 27 | # This global variable is used to hold the list of modules to be disabled. |
28 | -disabled_module_list = [] | | 28 | -disabled_module_list = [] |
29 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] | | 29 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] |
30 | | | 30 | |
31 | def add_dir_to_list(dirlist, dir): | | 31 | def add_dir_to_list(dirlist, dir): |
32 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | | 32 | """Add the directory 'dir' to the list 'dirlist' (at the front) if |
33 | @@ -346,9 +346,15 @@ class PyBuildExt(build_ext): | | 33 | @@ -346,9 +346,15 @@ class PyBuildExt(build_ext): |
34 | return sys.platform | | 34 | return sys.platform |
35 | | | 35 | |
| @@ -39,38 +39,38 @@ Build the 1.85 compat module all the tim | | | @@ -39,38 +39,38 @@ Build the 1.85 compat module all the tim |
39 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | | 39 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
40 | + # Add the buildlink directories for pkgsrc | | 40 | + # Add the buildlink directories for pkgsrc |
41 | + if os.environ.has_key('BUILDLINK_DIR'): | | 41 | + if os.environ.has_key('BUILDLINK_DIR'): |
42 | + dir = os.environ['BUILDLINK_DIR'] | | 42 | + dir = os.environ['BUILDLINK_DIR'] |
43 | + libdir = dir + '/lib' | | 43 | + libdir = dir + '/lib' |
44 | + incdir = dir + '/include' | | 44 | + incdir = dir + '/include' |
45 | + if libdir not in self.compiler.library_dirs: | | 45 | + if libdir not in self.compiler.library_dirs: |
46 | + self.compiler.library_dirs.insert(0, libdir) | | 46 | + self.compiler.library_dirs.insert(0, libdir) |
47 | + if incdir not in self.compiler.include_dirs: | | 47 | + if incdir not in self.compiler.include_dirs: |
48 | + self.compiler.include_dirs.insert(0, incdir) | | 48 | + self.compiler.include_dirs.insert(0, incdir) |
49 | | | 49 | |
50 | # Add paths specified in the environment variables LDFLAGS and | | 50 | # Add paths specified in the environment variables LDFLAGS and |
51 | # CPPFLAGS for header and library files. | | 51 | # CPPFLAGS for header and library files. |
52 | @@ -681,9 +687,7 @@ class PyBuildExt(build_ext): | | 52 | @@ -692,9 +698,7 @@ class PyBuildExt(build_ext): |
53 | if krb5_h: | | 53 | if krb5_h: |
54 | ssl_incs += krb5_h | | 54 | ssl_incs += krb5_h |
55 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, | | 55 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, |
56 | - ['/usr/local/ssl/lib', | | 56 | - ['/usr/local/ssl/lib', |
57 | - '/usr/contrib/ssl/lib/' | | 57 | - '/usr/contrib/ssl/lib/' |
58 | - ] ) | | 58 | - ] ) |
59 | + [] ) | | 59 | + [] ) |
60 | | | 60 | |
61 | if (ssl_incs is not None and | | 61 | if (ssl_incs is not None and |
62 | ssl_libs is not None): | | 62 | ssl_libs is not None): |
63 | @@ -798,172 +802,6 @@ class PyBuildExt(build_ext): | | 63 | @@ -809,172 +813,6 @@ class PyBuildExt(build_ext): |
64 | else: | | 64 | else: |
65 | raise ValueError("unknown major BerkeleyDB version", major) | | 65 | raise ValueError("unknown major BerkeleyDB version", major) |
66 | | | 66 | |
67 | - # construct a list of paths to look for the header file in on | | 67 | - # construct a list of paths to look for the header file in on |
68 | - # top of the normal inc_dirs. | | 68 | - # top of the normal inc_dirs. |
69 | - db_inc_paths = [ | | 69 | - db_inc_paths = [ |
70 | - '/usr/include/db4', | | 70 | - '/usr/include/db4', |
71 | - '/usr/local/include/db4', | | 71 | - '/usr/local/include/db4', |
72 | - '/opt/sfw/include/db4', | | 72 | - '/opt/sfw/include/db4', |
73 | - '/usr/include/db3', | | 73 | - '/usr/include/db3', |
74 | - '/usr/local/include/db3', | | 74 | - '/usr/local/include/db3', |
75 | - '/opt/sfw/include/db3', | | 75 | - '/opt/sfw/include/db3', |
76 | - # Fink defaults (http://fink.sourceforge.net/) | | 76 | - # Fink defaults (http://fink.sourceforge.net/) |
| @@ -223,27 +223,27 @@ Build the 1.85 compat module all the tim | | | @@ -223,27 +223,27 @@ Build the 1.85 compat module all the tim |
223 | - runtime_library_dirs=dblib_dir, | | 223 | - runtime_library_dirs=dblib_dir, |
224 | - include_dirs=db_incs, | | 224 | - include_dirs=db_incs, |
225 | - libraries=dblibs)) | | 225 | - libraries=dblibs)) |
226 | - else: | | 226 | - else: |
227 | - if db_setup_debug: print "db: no appropriate library found" | | 227 | - if db_setup_debug: print "db: no appropriate library found" |
228 | - db_incs = None | | 228 | - db_incs = None |
229 | - dblibs = [] | | 229 | - dblibs = [] |
230 | - dblib_dir = None | | 230 | - dblib_dir = None |
231 | - missing.append('_bsddb') | | 231 | - missing.append('_bsddb') |
232 | - | | 232 | - |
233 | # The sqlite interface | | 233 | # The sqlite interface |
234 | sqlite_setup_debug = False # verbose debug prints from this script? | | 234 | sqlite_setup_debug = False # verbose debug prints from this script? |
235 | | | 235 | |
236 | @@ -1079,31 +917,12 @@ class PyBuildExt(build_ext): | | 236 | @@ -1090,31 +928,12 @@ class PyBuildExt(build_ext): |
237 | # we do not build this one. Otherwise this build will pick up | | 237 | # we do not build this one. Otherwise this build will pick up |
238 | # the more recent berkeleydb's db.h file first in the include path | | 238 | # the more recent berkeleydb's db.h file first in the include path |
239 | # when attempting to compile and it will fail. | | 239 | # when attempting to compile and it will fail. |
240 | - f = "/usr/include/db.h" | | 240 | - f = "/usr/include/db.h" |
241 | - | | 241 | - |
242 | - if sys.platform == 'darwin': | | 242 | - if sys.platform == 'darwin': |
243 | - if is_macosx_sdk_path(f): | | 243 | - if is_macosx_sdk_path(f): |
244 | - sysroot = macosx_sdk_root() | | 244 | - sysroot = macosx_sdk_root() |
245 | - f = os.path.join(sysroot, f[1:]) | | 245 | - f = os.path.join(sysroot, f[1:]) |
246 | - | | 246 | - |
247 | - if os.path.exists(f) and not db_incs: | | 247 | - if os.path.exists(f) and not db_incs: |
248 | - data = open(f).read() | | 248 | - data = open(f).read() |
249 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) | | 249 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) |
| @@ -260,42 +260,53 @@ Build the 1.85 compat module all the tim | | | @@ -260,42 +260,53 @@ Build the 1.85 compat module all the tim |
260 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) | | 260 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) |
261 | - else: | | 261 | - else: |
262 | - missing.append('bsddb185') | | 262 | - missing.append('bsddb185') |
263 | + libraries = os.getenv("PY_BDB_TYPE", "") | | 263 | + libraries = os.getenv("PY_BDB_TYPE", "") |
264 | + if libraries: | | 264 | + if libraries: |
265 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'], | | 265 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'], |
266 | + libraries=['db'])) | | 266 | + libraries=['db'])) |
267 | else: | | 267 | else: |
268 | - missing.append('bsddb185') | | 268 | - missing.append('bsddb185') |
269 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'])) | | 269 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'])) |
270 | | | 270 | |
271 | dbm_order = ['gdbm'] | | 271 | dbm_order = ['gdbm'] |
272 | # The standard Unix dbm module: | | 272 | # The standard Unix dbm module: |
273 | @@ -1162,14 +981,11 @@ class PyBuildExt(build_ext): | | 273 | @@ -1170,18 +989,14 @@ class PyBuildExt(build_ext): |
274 | if db_incs is not None: | | 274 | libraries = gdbm_libs) |
275 | print "building dbm using bdb" | | 275 | break |
276 | dbmext = Extension('dbm', ['dbmmodule.c'], | | 276 | elif cand == "bdb": |
| | | 277 | - if db_incs is not None: |
| | | 278 | - print "building dbm using bdb" |
| | | 279 | - dbmext = Extension('dbm', ['dbmmodule.c'], |
277 | - library_dirs=dblib_dir, | | 280 | - library_dirs=dblib_dir, |
278 | - runtime_library_dirs=dblib_dir, | | 281 | - runtime_library_dirs=dblib_dir, |
279 | - include_dirs=db_incs, | | 282 | - include_dirs=db_incs, |
280 | define_macros=[ | | 283 | - define_macros=[ |
281 | ('HAVE_BERKDB_H', None), | | 284 | - ('HAVE_BERKDB_H', None), |
282 | ('DB_DBM_HSEARCH', None), | | 285 | - ('DB_DBM_HSEARCH', None), |
283 | ], | | 286 | - ], |
284 | - libraries=dblibs) | | 287 | - libraries=dblibs) |
285 | + libraries=["db"]) | | 288 | - break |
286 | break | | 289 | + print "building dbm using bdb" |
| | | 290 | + dbmext = Extension('dbm', ['dbmmodule.c'], |
| | | 291 | + define_macros=[ |
| | | 292 | + ('HAVE_BERKDB_H', None), |
| | | 293 | + ('DB_DBM_HSEARCH', None), |
| | | 294 | + ], |
| | | 295 | + libraries=["db"]) |
| | | 296 | + break |
287 | if dbmext is not None: | | 297 | if dbmext is not None: |
288 | exts.append(dbmext) | | 298 | exts.append(dbmext) |
289 | @@ -2032,9 +1848,9 @@ def main(): | | 299 | else: |
| | | 300 | @@ -2043,9 +1858,9 @@ def main(): |
290 | ext_modules=[Extension('_struct', ['_struct.c'])], | | 301 | ext_modules=[Extension('_struct', ['_struct.c'])], |
291 | | | 302 | |
292 | # Scripts to install | | 303 | # Scripts to install |
293 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', | | 304 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', |
294 | - 'Tools/scripts/2to3', | | 305 | - 'Tools/scripts/2to3', |
295 | - 'Lib/smtpd.py'] | | 306 | - 'Lib/smtpd.py'] |
296 | + scripts = ['Tools/scripts/pydoc2.7', | | 307 | + scripts = ['Tools/scripts/pydoc2.7', |
297 | + 'Tools/scripts/2to3-2.7', | | 308 | + 'Tools/scripts/2to3-2.7', |
298 | + 'Lib/smtpd2.7.py'] | | 309 | + 'Lib/smtpd2.7.py'] |
299 | ) | | 310 | ) |
300 | | | 311 | |
301 | # --install-platlib | | 312 | # --install-platlib |