| @@ -1,49 +1,51 @@ | | | @@ -1,49 +1,51 @@ |
1 | $NetBSD: patch-am,v 1.20 2014/03/12 12:57:06 obache Exp $ | | 1 | $NetBSD: patch-am,v 1.21 2014/03/27 05:15:00 obache 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 _ssl module with pkgsrc choiced OpenSSL. |
| | | 21 | |
20 | Build the 1.85 compat module all the time against the BDB version of choice. | | 22 | Build the 1.85 compat module all the time against the BDB version of choice. |
21 | | | 23 | |
22 | Add in Debian multiarch support (retrofitted from Python 2.7.2) to | | 24 | Add in Debian multiarch support (retrofitted from Python 2.7.2) to |
23 | support building the "nis" and "crypt" modules. | | 25 | support building the "nis" and "crypt" modules. |
24 | | | 26 | |
25 | --- setup.py 2010-07-18 00:31:09.000000000 +1200 | | 27 | --- setup.py.orig 2013-10-29 15:04:39.000000000 +0000 |
26 | +++ setup.py 2011-09-23 01:51:17.757519638 +1200 | | 28 | +++ setup.py |
27 | @@ -18,7 +18,7 @@ | | 29 | @@ -18,7 +18,7 @@ from distutils.command.install_lib impor |
28 | from distutils.spawn import find_executable | | 30 | from distutils.spawn import find_executable |
29 | | | 31 | |
30 | # This global variable is used to hold the list of modules to be disabled. | | 32 | # This global variable is used to hold the list of modules to be disabled. |
31 | -disabled_module_list = [] | | 33 | -disabled_module_list = [] |
32 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] | | 34 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] |
33 | | | 35 | |
34 | def add_dir_to_list(dirlist, dir): | | 36 | def add_dir_to_list(dirlist, dir): |
35 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | | 37 | """Add the directory 'dir' to the list 'dirlist' (at the front) if |
36 | @@ -354,10 +354,40 @@ | | 38 | @@ -354,10 +354,40 @@ class PyBuildExt(build_ext): |
37 | return platform | | 39 | return platform |
38 | return sys.platform | | 40 | return sys.platform |
39 | | | 41 | |
40 | + def add_multiarch_paths(self): | | 42 | + def add_multiarch_paths(self): |
41 | + # Debian/Ubuntu multiarch support. | | 43 | + # Debian/Ubuntu multiarch support. |
42 | + # https://wiki.ubuntu.com/MultiarchSpec | | 44 | + # https://wiki.ubuntu.com/MultiarchSpec |
43 | + if not find_executable('dpkg-architecture'): | | 45 | + if not find_executable('dpkg-architecture'): |
44 | + return | | 46 | + return |
45 | + tmpfile = os.path.join(self.build_temp, 'multiarch') | | 47 | + tmpfile = os.path.join(self.build_temp, 'multiarch') |
46 | + if not os.path.exists(self.build_temp): | | 48 | + if not os.path.exists(self.build_temp): |
47 | + os.makedirs(self.build_temp) | | 49 | + os.makedirs(self.build_temp) |
48 | + ret = os.system( | | 50 | + ret = os.system( |
49 | + 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' % | | 51 | + 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' % |
| @@ -67,38 +69,60 @@ support building the "nis" and "crypt" m | | | @@ -67,38 +69,60 @@ support building the "nis" and "crypt" m |
67 | + if os.environ.has_key('BUILDLINK_DIR'): | | 69 | + if os.environ.has_key('BUILDLINK_DIR'): |
68 | + dir = os.environ['BUILDLINK_DIR'] | | 70 | + dir = os.environ['BUILDLINK_DIR'] |
69 | + libdir = dir + '/lib' | | 71 | + libdir = dir + '/lib' |
70 | + incdir = dir + '/include' | | 72 | + incdir = dir + '/include' |
71 | + if libdir not in self.compiler.library_dirs: | | 73 | + if libdir not in self.compiler.library_dirs: |
72 | + self.compiler.library_dirs.insert(0, libdir) | | 74 | + self.compiler.library_dirs.insert(0, libdir) |
73 | + if incdir not in self.compiler.include_dirs: | | 75 | + if incdir not in self.compiler.include_dirs: |
74 | + self.compiler.include_dirs.insert(0, incdir) | | 76 | + self.compiler.include_dirs.insert(0, incdir) |
75 | + | | 77 | + |
76 | + self.add_multiarch_paths() | | 78 | + self.add_multiarch_paths() |
77 | | | 79 | |
78 | # Add paths specified in the environment variables LDFLAGS and | | 80 | # Add paths specified in the environment variables LDFLAGS and |
79 | # CPPFLAGS for header and library files. | | 81 | # CPPFLAGS for header and library files. |
80 | @@ -703,9 +733,7 @@ | | 82 | @@ -691,10 +721,9 @@ class PyBuildExt(build_ext): |
| | | 83 | depends = ['socketmodule.h']) ) |
| | | 84 | # Detect SSL support for the socket module (via _ssl) |
| | | 85 | search_for_ssl_incs_in = [ |
| | | 86 | - '/usr/local/ssl/include', |
| | | 87 | - '/usr/contrib/ssl/include/' |
| | | 88 | + '@SSLBASE@/include' |
| | | 89 | ] |
| | | 90 | - ssl_incs = find_file('openssl/ssl.h', inc_dirs, |
| | | 91 | + ssl_incs = find_file('openssl/ssl.h', [], |
| | | 92 | search_for_ssl_incs_in |
| | | 93 | ) |
| | | 94 | if ssl_incs is not None: |
| | | 95 | @@ -703,9 +732,7 @@ class PyBuildExt(build_ext): |
81 | if krb5_h: | | 96 | if krb5_h: |
82 | ssl_incs += krb5_h | | 97 | ssl_incs += krb5_h |
83 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, | | 98 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, |
84 | - ['/usr/local/ssl/lib', | | 99 | - ['/usr/local/ssl/lib', |
85 | - '/usr/contrib/ssl/lib/' | | 100 | - '/usr/contrib/ssl/lib/' |
86 | - ] ) | | 101 | - ] ) |
87 | + [] ) | | 102 | + [] ) |
88 | | | 103 | |
89 | if (ssl_incs is not None and | | 104 | if (ssl_incs is not None and |
90 | ssl_libs is not None): | | 105 | ssl_libs is not None): |
91 | @@ -815,172 +843,6 @@ | | 106 | @@ -724,7 +751,7 @@ class PyBuildExt(build_ext): |
| | | 107 | |
| | | 108 | # look for the openssl version header on the compiler search path. |
| | | 109 | opensslv_h = find_file('openssl/opensslv.h', [], |
| | | 110 | - inc_dirs + search_for_ssl_incs_in) |
| | | 111 | + search_for_ssl_incs_in) |
| | | 112 | if opensslv_h: |
| | | 113 | name = os.path.join(opensslv_h[0], 'openssl/opensslv.h') |
| | | 114 | if sys.platform == 'darwin' and is_macosx_sdk_path(name): |
| | | 115 | @@ -815,172 +842,6 @@ class PyBuildExt(build_ext): |
92 | else: | | 116 | else: |
93 | raise ValueError("unknown major BerkeleyDB version", major) | | 117 | raise ValueError("unknown major BerkeleyDB version", major) |
94 | | | 118 | |
95 | - # construct a list of paths to look for the header file in on | | 119 | - # construct a list of paths to look for the header file in on |
96 | - # top of the normal inc_dirs. | | 120 | - # top of the normal inc_dirs. |
97 | - db_inc_paths = [ | | 121 | - db_inc_paths = [ |
98 | - '/usr/include/db4', | | 122 | - '/usr/include/db4', |
99 | - '/usr/local/include/db4', | | 123 | - '/usr/local/include/db4', |
100 | - '/opt/sfw/include/db4', | | 124 | - '/opt/sfw/include/db4', |
101 | - '/usr/include/db3', | | 125 | - '/usr/include/db3', |
102 | - '/usr/local/include/db3', | | 126 | - '/usr/local/include/db3', |
103 | - '/opt/sfw/include/db3', | | 127 | - '/opt/sfw/include/db3', |
104 | - # Fink defaults (http://fink.sourceforge.net/) | | 128 | - # Fink defaults (http://fink.sourceforge.net/) |
| @@ -251,27 +275,27 @@ support building the "nis" and "crypt" m | | | @@ -251,27 +275,27 @@ support building the "nis" and "crypt" m |
251 | - runtime_library_dirs=dblib_dir, | | 275 | - runtime_library_dirs=dblib_dir, |
252 | - include_dirs=db_incs, | | 276 | - include_dirs=db_incs, |
253 | - libraries=dblibs)) | | 277 | - libraries=dblibs)) |
254 | - else: | | 278 | - else: |
255 | - if db_setup_debug: print "db: no appropriate library found" | | 279 | - if db_setup_debug: print "db: no appropriate library found" |
256 | - db_incs = None | | 280 | - db_incs = None |
257 | - dblibs = [] | | 281 | - dblibs = [] |
258 | - dblib_dir = None | | 282 | - dblib_dir = None |
259 | - missing.append('_bsddb') | | 283 | - missing.append('_bsddb') |
260 | - | | 284 | - |
261 | # The sqlite interface | | 285 | # The sqlite interface |
262 | sqlite_setup_debug = False # verbose debug prints from this script? | | 286 | sqlite_setup_debug = False # verbose debug prints from this script? |
263 | | | 287 | |
264 | @@ -1094,35 +956,40 @@ | | 288 | @@ -1094,35 +955,40 @@ class PyBuildExt(build_ext): |
265 | # we do not build this one. Otherwise this build will pick up | | 289 | # we do not build this one. Otherwise this build will pick up |
266 | # the more recent berkeleydb's db.h file first in the include path | | 290 | # the more recent berkeleydb's db.h file first in the include path |
267 | # when attempting to compile and it will fail. | | 291 | # when attempting to compile and it will fail. |
268 | - f = "/usr/include/db.h" | | 292 | - f = "/usr/include/db.h" |
269 | - | | 293 | - |
270 | - if sys.platform == 'darwin': | | 294 | - if sys.platform == 'darwin': |
271 | - if is_macosx_sdk_path(f): | | 295 | - if is_macosx_sdk_path(f): |
272 | - sysroot = macosx_sdk_root() | | 296 | - sysroot = macosx_sdk_root() |
273 | - f = os.path.join(sysroot, f[1:]) | | 297 | - f = os.path.join(sysroot, f[1:]) |
274 | - | | 298 | - |
275 | - if os.path.exists(f) and not db_incs: | | 299 | - if os.path.exists(f) and not db_incs: |
276 | - data = open(f).read() | | 300 | - data = open(f).read() |
277 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) | | 301 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) |
| @@ -317,68 +341,68 @@ support building the "nis" and "crypt" m | | | @@ -317,68 +341,68 @@ support building the "nis" and "crypt" m |
317 | + line = input.readline() | | 341 | + line = input.readline() |
318 | + if not line: break | | 342 | + if not line: break |
319 | + if re.search('This file is part of GDBM', line): | | 343 | + if re.search('This file is part of GDBM', line): |
320 | + ret = None | | 344 | + ret = None |
321 | + break | | 345 | + break |
322 | + input.close() | | 346 | + input.close() |
323 | + break | | 347 | + break |
324 | + return ret | | 348 | + return ret |
325 | + | | 349 | + |
326 | + if find_ndbm_h(inc_dirs) is not None: | | 350 | + if find_ndbm_h(inc_dirs) is not None: |
327 | # Some systems have -lndbm, others don't | | 351 | # Some systems have -lndbm, others don't |
328 | if self.compiler.find_library_file(lib_dirs, 'ndbm'): | | 352 | if self.compiler.find_library_file(lib_dirs, 'ndbm'): |
329 | ndbm_libs = ['ndbm'] | | 353 | ndbm_libs = ['ndbm'] |
330 | @@ -1131,7 +998,7 @@ | | 354 | @@ -1131,7 +997,7 @@ class PyBuildExt(build_ext): |
331 | exts.append( Extension('dbm', ['dbmmodule.c'], | | 355 | exts.append( Extension('dbm', ['dbmmodule.c'], |
332 | define_macros=[('HAVE_NDBM_H',None)], | | 356 | define_macros=[('HAVE_NDBM_H',None)], |
333 | libraries = ndbm_libs ) ) | | 357 | libraries = ndbm_libs ) ) |
334 | - elif self.compiler.find_library_file(lib_dirs, 'gdbm'): | | 358 | - elif self.compiler.find_library_file(lib_dirs, 'gdbm'): |
335 | + elif 1==0 and self.compiler.find_library_file(lib_dirs, 'gdbm'): | | 359 | + elif 1==0 and self.compiler.find_library_file(lib_dirs, 'gdbm'): |
336 | gdbm_libs = ['gdbm'] | | 360 | gdbm_libs = ['gdbm'] |
337 | if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): | | 361 | if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): |
338 | gdbm_libs.append('gdbm_compat') | | 362 | gdbm_libs.append('gdbm_compat') |
339 | @@ -1147,14 +1014,12 @@ | | 363 | @@ -1147,14 +1013,12 @@ class PyBuildExt(build_ext): |
340 | libraries = gdbm_libs ) ) | | 364 | libraries = gdbm_libs ) ) |
341 | else: | | 365 | else: |
342 | missing.append('dbm') | | 366 | missing.append('dbm') |
343 | - elif db_incs is not None: | | 367 | - elif db_incs is not None: |
344 | + | | 368 | + |
345 | + if not module_enabled(exts, 'dbm'): | | 369 | + if not module_enabled(exts, 'dbm'): |
346 | exts.append( Extension('dbm', ['dbmmodule.c'], | | 370 | exts.append( Extension('dbm', ['dbmmodule.c'], |
347 | - library_dirs=dblib_dir, | | 371 | - library_dirs=dblib_dir, |
348 | - runtime_library_dirs=dblib_dir, | | 372 | - runtime_library_dirs=dblib_dir, |
349 | - include_dirs=db_incs, | | 373 | - include_dirs=db_incs, |
350 | define_macros=[('HAVE_BERKDB_H',None), | | 374 | define_macros=[('HAVE_BERKDB_H',None), |
351 | ('DB_DBM_HSEARCH',None)], | | 375 | ('DB_DBM_HSEARCH',None)], |
352 | - libraries=dblibs)) | | 376 | - libraries=dblibs)) |
353 | + libraries=["db"])) | | 377 | + libraries=["db"])) |
354 | else: | | 378 | else: |
355 | missing.append('dbm') | | 379 | missing.append('dbm') |
356 | | | 380 | |
357 | @@ -1408,6 +1273,14 @@ | | 381 | @@ -1408,6 +1272,14 @@ class PyBuildExt(build_ext): |
358 | ) | | 382 | ) |
359 | libraries = [] | | 383 | libraries = [] |
360 | | | 384 | |
361 | + elif platform.startswith('dragonfly'): | | 385 | + elif platform.startswith('dragonfly'): |
362 | + macros = dict( | | 386 | + macros = dict( |
363 | + HAVE_SEM_OPEN=0, | | 387 | + HAVE_SEM_OPEN=0, |
364 | + HAVE_SEM_TIMEDWAIT=0, | | 388 | + HAVE_SEM_TIMEDWAIT=0, |
365 | + HAVE_FD_TRANSFER=1, | | 389 | + HAVE_FD_TRANSFER=1, |
366 | + ) | | 390 | + ) |
367 | + libraries = [] | | 391 | + libraries = [] |
368 | + | | 392 | + |
369 | else: # Linux and other unices | | 393 | else: # Linux and other unices |
370 | macros = dict( | | 394 | macros = dict( |
371 | HAVE_SEM_OPEN=1, | | 395 | HAVE_SEM_OPEN=1, |
372 | @@ -2026,9 +1899,9 @@ | | 396 | @@ -2026,9 +1898,9 @@ def main(): |
373 | ext_modules=[Extension('_struct', ['_struct.c'])], | | 397 | ext_modules=[Extension('_struct', ['_struct.c'])], |
374 | | | 398 | |
375 | # Scripts to install | | 399 | # Scripts to install |
376 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', | | 400 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', |
377 | - 'Tools/scripts/2to3', | | 401 | - 'Tools/scripts/2to3', |
378 | - 'Lib/smtpd.py'] | | 402 | - 'Lib/smtpd.py'] |
379 | + scripts = ['Tools/scripts/pydoc2.6', | | 403 | + scripts = ['Tools/scripts/pydoc2.6', |
380 | + 'Tools/scripts/2to3-2.6', | | 404 | + 'Tools/scripts/2to3-2.6', |
381 | + 'Tools/scripts/smtpd2.6.py'] | | 405 | + 'Tools/scripts/smtpd2.6.py'] |
382 | ) | | 406 | ) |
383 | | | 407 | |
384 | # --install-platlib | | 408 | # --install-platlib |