Add an option for Python: x11 Fix build on systems with disabled X11 Reported by <schmonz>, Andreas Kusalananda Kahari Tested by Andreas Kusalananda Kahari Possible direction is to make this switch by default disabled on Darwin.diff -r1.65 -r1.66 pkgsrc/lang/python27/Makefile
(kamil)
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.65 2016/07/23 21:12:48 kamil Exp $ | 1 | # $NetBSD: Makefile,v 1.66 2016/07/26 16:44:28 kamil Exp $ | |
2 | 2 | |||
3 | .include "dist.mk" | 3 | .include "dist.mk" | |
4 | 4 | |||
5 | PKGNAME= python27-${PY_DISTVERSION} | 5 | PKGNAME= python27-${PY_DISTVERSION} | |
6 | PKGREVISION= 3 | 6 | PKGREVISION= 3 | |
7 | CATEGORIES= lang python | 7 | CATEGORIES= lang python | |
8 | 8 | |||
9 | MAINTAINER= pkgsrc-users@NetBSD.org | 9 | MAINTAINER= pkgsrc-users@NetBSD.org | |
10 | HOMEPAGE= http://www.python.org/ | 10 | HOMEPAGE= http://www.python.org/ | |
11 | COMMENT= Interpreted, interactive, object-oriented programming language | 11 | COMMENT= Interpreted, interactive, object-oriented programming language | |
12 | LICENSE= python-software-foundation | 12 | LICENSE= python-software-foundation | |
13 | 13 | |||
14 | DEPENDS= mozilla-rootcerts>=1.0.20150804nb1:../../security/mozilla-rootcerts | 14 | DEPENDS= mozilla-rootcerts>=1.0.20150804nb1:../../security/mozilla-rootcerts | |
@@ -168,36 +168,29 @@ SUBST_SED.findlib= -e 's,/usr/local,${PR | @@ -168,36 +168,29 @@ SUBST_SED.findlib= -e 's,/usr/local,${PR | |||
168 | # >>> find_library("m") | 168 | # >>> find_library("m") | |
169 | # 'libm.so.0' | 169 | # 'libm.so.0' | |
170 | # >>> find_library("crypto") | 170 | # >>> find_library("crypto") | |
171 | # 'libcrypto.so.11' | 171 | # 'libcrypto.so.11' | |
172 | # >>> find_library("GL") | 172 | # >>> find_library("GL") | |
173 | # 'libGL.so.2' | 173 | # 'libGL.so.2' | |
174 | # >>> find_library("curl") | 174 | # >>> find_library("curl") | |
175 | # 'libcurl.so.4' | 175 | # 'libcurl.so.4' | |
176 | 176 | |||
177 | SUBST_CLASSES+= pfindlib | 177 | SUBST_CLASSES+= pfindlib | |
178 | SUBST_MESSAGE.pfindlib= Fixing find_library() on POSIX-like (excluding Darwin) systems. | 178 | SUBST_MESSAGE.pfindlib= Fixing find_library() on POSIX-like (excluding Darwin) systems. | |
179 | SUBST_STAGE.pfindlib= pre-configure | 179 | SUBST_STAGE.pfindlib= pre-configure | |
180 | SUBST_FILES.pfindlib= Lib/ctypes/util.py | 180 | SUBST_FILES.pfindlib= Lib/ctypes/util.py | |
181 | SUBST_SED.pfindlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${X11BASE}/lib -L${X11BASE}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!' | 181 | SUBST_SED.pfindlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!' | |
182 | 182 | |||
183 | SUBST_CLASSES+= cdlopen | 183 | .include "options.mk" | |
184 | SUBST_MESSAGE.cdlopen= Handle X11BASE paths in dlopen(3) calls of _ctypes.so | |||
185 | SUBST_STAGE.cdlopen= pre-configure | |||
186 | SUBST_FILES.cdlopen= setup.py | |||
187 | SUBST_VARS.cdlopen= X11BASE | |||
188 | ||||
189 | # Required to detect X11BASE paths in dlopen(3) calls of _ctypes.so | |||
190 | USE_X11= yes | |||
191 | 184 | |||
192 | SUBST_CLASSES+= sslbase | 185 | SUBST_CLASSES+= sslbase | |
193 | SUBST_MESSAGE.sslbase= Fixing find-file for openssl with SSLBASE. | 186 | SUBST_MESSAGE.sslbase= Fixing find-file for openssl with SSLBASE. | |
194 | SUBST_STAGE.sslbase= pre-configure | 187 | SUBST_STAGE.sslbase= pre-configure | |
195 | SUBST_FILES.sslbase= setup.py | 188 | SUBST_FILES.sslbase= setup.py | |
196 | SUBST_VARS.sslbase= SSLBASE | 189 | SUBST_VARS.sslbase= SSLBASE | |
197 | 190 | |||
198 | SUBST_CLASSES+= cacert | 191 | SUBST_CLASSES+= cacert | |
199 | SUBST_MESSAGE.cacert= Configuring location of default CA certificate file. | 192 | SUBST_MESSAGE.cacert= Configuring location of default CA certificate file. | |
200 | SUBST_STAGE.cacert= pre-configure | 193 | SUBST_STAGE.cacert= pre-configure | |
201 | SUBST_FILES.cacert= Modules/_ssl.c | 194 | SUBST_FILES.cacert= Modules/_ssl.c | |
202 | SUBST_SED.cacert= -e 's,@PREFIX@,${PREFIX},' | 195 | SUBST_SED.cacert= -e 's,@PREFIX@,${PREFIX},' | |
203 | 196 |
@@ -1,32 +1,32 @@ | @@ -1,32 +1,32 @@ | |||
1 | $NetBSD: distinfo,v 1.57 2016/07/23 18:28:26 kamil Exp $ | 1 | $NetBSD: distinfo,v 1.58 2016/07/26 16:44:28 kamil Exp $ | |
2 | 2 | |||
3 | SHA1 (Python-2.7.12.tar.xz) = 05360b8ade117b35e266b2004a7f1f11250c6dcd | 3 | SHA1 (Python-2.7.12.tar.xz) = 05360b8ade117b35e266b2004a7f1f11250c6dcd | |
4 | RMD160 (Python-2.7.12.tar.xz) = c330f6ac08ed67f307de0e726a288bab16c832d5 | 4 | RMD160 (Python-2.7.12.tar.xz) = c330f6ac08ed67f307de0e726a288bab16c832d5 | |
5 | SHA512 (Python-2.7.12.tar.xz) = 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f | 5 | SHA512 (Python-2.7.12.tar.xz) = 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f | |
6 | Size (Python-2.7.12.tar.xz) = 12390820 bytes | 6 | Size (Python-2.7.12.tar.xz) = 12390820 bytes | |
7 | SHA1 (patch-Include_pyerrors.h) = 0d2cd52d18cc719b895fa32ed7e11c6cb15bae54 | 7 | SHA1 (patch-Include_pyerrors.h) = 0d2cd52d18cc719b895fa32ed7e11c6cb15bae54 | |
8 | SHA1 (patch-Include_pyport.h) = f3e4ddbc954425a65301465410911222ca471320 | 8 | SHA1 (patch-Include_pyport.h) = f3e4ddbc954425a65301465410911222ca471320 | |
9 | SHA1 (patch-Lib_distutils_unixccompiler.py) = db16c9aca2f29730945f28247b88b18828739bbb | 9 | SHA1 (patch-Lib_distutils_unixccompiler.py) = db16c9aca2f29730945f28247b88b18828739bbb | |
10 | SHA1 (patch-Lib_multiprocessing_process.py) = 15699bd8ec822bf54a0631102e00e0a34f882803 | 10 | SHA1 (patch-Lib_multiprocessing_process.py) = 15699bd8ec822bf54a0631102e00e0a34f882803 | |
11 | SHA1 (patch-Modules___multiprocessing_semaphore.c) = 03b9c33ef38da383d5f7c2c84c17fe38cdd2911e | 11 | SHA1 (patch-Modules___multiprocessing_semaphore.c) = 03b9c33ef38da383d5f7c2c84c17fe38cdd2911e | |
12 | SHA1 (patch-Modules__ssl.c) = 6e68f88ad205106691900f091a897ffe0a4c363c | 12 | SHA1 (patch-Modules__ssl.c) = 6e68f88ad205106691900f091a897ffe0a4c363c | |
13 | SHA1 (patch-Modules_getaddrinfo.c) = aa699d257f1bc98b9a3183a21324053e134409d1 | 13 | SHA1 (patch-Modules_getaddrinfo.c) = aa699d257f1bc98b9a3183a21324053e134409d1 | |
14 | SHA1 (patch-Modules_getpath.c) = 9bb2c040895ad6bbe4d0b5807803723b5437d47b | 14 | SHA1 (patch-Modules_getpath.c) = 9bb2c040895ad6bbe4d0b5807803723b5437d47b | |
15 | SHA1 (patch-Modules_posixmodule.c) = 5105d380cd49bf49b8adbd9aa5ffb245195728ed | 15 | SHA1 (patch-Modules_posixmodule.c) = 5105d380cd49bf49b8adbd9aa5ffb245195728ed | |
16 | SHA1 (patch-Modules_socketmodule.c) = 16848d90947b3de1f921a0813fa5c317f76961d4 | 16 | SHA1 (patch-Modules_socketmodule.c) = 16848d90947b3de1f921a0813fa5c317f76961d4 | |
17 | SHA1 (patch-aa) = d9626c1648d7ff2a7da7352665bcb05f4ab0412a | 17 | SHA1 (patch-aa) = d9626c1648d7ff2a7da7352665bcb05f4ab0412a | |
18 | SHA1 (patch-ab) = ea4feba4e93dbcff07050c82a00d591bb650e934 | 18 | SHA1 (patch-ab) = ea4feba4e93dbcff07050c82a00d591bb650e934 | |
19 | SHA1 (patch-ad) = 96ae702995d434e2d7ec0ac62e37427a90b61d13 | 19 | SHA1 (patch-ad) = 96ae702995d434e2d7ec0ac62e37427a90b61d13 | |
20 | SHA1 (patch-ae) = d836d77854a2b3d79fa34a06a8e2493bf0a503e6 | 20 | SHA1 (patch-ae) = d836d77854a2b3d79fa34a06a8e2493bf0a503e6 | |
21 | SHA1 (patch-ah) = 90b19239d8a7c8abc3bbc05d49408a2c5da6174d | 21 | SHA1 (patch-ah) = 90b19239d8a7c8abc3bbc05d49408a2c5da6174d | |
22 | SHA1 (patch-al) = 541936b79f281db06761f4fa6a65a04e852b02b4 | 22 | SHA1 (patch-al) = 541936b79f281db06761f4fa6a65a04e852b02b4 | |
23 | SHA1 (patch-am) = 5e763a0fe26be562cf5e49e6313a9f18d9ee9908 | 23 | SHA1 (patch-am) = cf82bd1996aea8a8536bd37a74563bb85817c968 | |
24 | SHA1 (patch-an) = 9aad78714c4fe1a21cf66a6627d97d164ecea196 | 24 | SHA1 (patch-an) = 9aad78714c4fe1a21cf66a6627d97d164ecea196 | |
25 | SHA1 (patch-ao) = 5bcfad96f8e490351160f1a7c1f4ece7706a33fa | 25 | SHA1 (patch-ao) = 5bcfad96f8e490351160f1a7c1f4ece7706a33fa | |
26 | SHA1 (patch-au) = 0ecdb937cbd58e3dbfa6fb94d1af5838619c77fd | 26 | SHA1 (patch-au) = 0ecdb937cbd58e3dbfa6fb94d1af5838619c77fd | |
27 | SHA1 (patch-av) = e6aef090b444b455fe351308d251e670329b7dc3 | 27 | SHA1 (patch-av) = e6aef090b444b455fe351308d251e670329b7dc3 | |
28 | SHA1 (patch-aw) = d07129531ec1427669092c504c12247206408c2d | 28 | SHA1 (patch-aw) = d07129531ec1427669092c504c12247206408c2d | |
29 | SHA1 (patch-ax) = 8a7a0e5cbfec279a05945dffafea1b1131a76f0e | 29 | SHA1 (patch-ax) = 8a7a0e5cbfec279a05945dffafea1b1131a76f0e | |
30 | SHA1 (patch-az) = 01e113b0bd251978b555caaaa60b79c372edebce | 30 | SHA1 (patch-az) = 01e113b0bd251978b555caaaa60b79c372edebce | |
31 | SHA1 (patch-pyconfig.h.in) = a0143ecdc2a3fb10220d0e3ee94fb9779a45e9e1 | 31 | SHA1 (patch-pyconfig.h.in) = a0143ecdc2a3fb10220d0e3ee94fb9779a45e9e1 | |
32 | SHA1 (patch-xa) = 517cfefc2f2e13631d22bad28c327513cdf17c10 | 32 | SHA1 (patch-xa) = 517cfefc2f2e13631d22bad28c327513cdf17c10 |
# $NetBSD: options.mk,v 1.1 2016/07/26 16:44:28 kamil Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.python27
PKG_SUPPORTED_OPTIONS+= x11
PKG_SUGGESTED_OPTIONS= x11
.include "../../mk/bsd.prefs.mk"
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Mx11)
# Support for native X11 paths as an option
# This code is no-op for modular X11, however for simplicity don't make it conditional.
SUBST_CLASSES+= x11findlib
SUBST_MESSAGE.x11findlib= Fixing find_library() for native X11.
SUBST_STAGE.x11findlib= pre-configure
SUBST_FILES.x11findlib= Lib/ctypes/util.py
SUBST_SED.x11findlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${X11BASE}/lib -L${X11BASE}/lib \1!'
# Required to get definition of X11BASE and retain X11 rpath paths for linker
# We need to pass rpath to _ctypes.so to get functional dlopen(3) for X11 libs
USE_X11= yes
SUBST_CLASSES+= cdlopen
SUBST_MESSAGE.cdlopen= Handle X11BASE paths in dlopen(3) calls of _ctypes.so
SUBST_STAGE.cdlopen= pre-configure
SUBST_FILES.cdlopen= setup.py
SUBST_SED.cdlopen= -e "s!\(libraries=\[\],\)!\1 runtime_library_dirs=\['${X11BASE}/lib'\],!"
.endif
@@ -1,41 +1,38 @@ | @@ -1,41 +1,38 @@ | |||
1 | $NetBSD: patch-am,v 1.20 2016/07/23 18:28:26 kamil Exp $ | 1 | $NetBSD: patch-am,v 1.21 2016/07/26 16:44:28 kamil 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. | 20 | Build the _ssl module with pkgsrc choiced OpenSSL. | |
21 | 21 | |||
22 | 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. | |
23 | 23 | |||
24 | cygwin 2.7.3-no-libm.patch | 24 | cygwin 2.7.3-no-libm.patch | |
25 | 25 | |||
26 | Set X11BASE rpath value for _ctypes.so, it's required as it calls dlopen(3) | |||
27 | and dynamic linker cannot find without it X11 libraries. | |||
28 | ||||
29 | --- setup.py.orig 2016-06-25 21:49:32.000000000 +0000 | 26 | --- setup.py.orig 2016-06-25 21:49:32.000000000 +0000 | |
30 | +++ setup.py | 27 | +++ setup.py | |
31 | @@ -33,7 +33,7 @@ host_platform = get_platform() | 28 | @@ -33,7 +33,7 @@ host_platform = get_platform() | |
32 | COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) | 29 | COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) | |
33 | 30 | |||
34 | # This global variable is used to hold the list of modules to be disabled. | 31 | # This global variable is used to hold the list of modules to be disabled. | |
35 | -disabled_module_list = [] | 32 | -disabled_module_list = [] | |
36 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] | 33 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] | |
37 | 34 | |||
38 | def add_dir_to_list(dirlist, dir): | 35 | def add_dir_to_list(dirlist, dir): | |
39 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | 36 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | |
40 | @@ -454,10 +454,15 @@ class PyBuildExt(build_ext): | 37 | @@ -454,10 +454,15 @@ class PyBuildExt(build_ext): | |
41 | os.unlink(tmpfile) | 38 | os.unlink(tmpfile) | |
@@ -367,34 +364,26 @@ and dynamic linker cannot find without i | @@ -367,34 +364,26 @@ and dynamic linker cannot find without i | |||
367 | - libraries=dblibs) | 364 | - libraries=dblibs) | |
368 | - break | 365 | - break | |
369 | + print "building dbm using bdb" | 366 | + print "building dbm using bdb" | |
370 | + dbmext = Extension('dbm', ['dbmmodule.c'], | 367 | + dbmext = Extension('dbm', ['dbmmodule.c'], | |
371 | + define_macros=[ | 368 | + define_macros=[ | |
372 | + ('HAVE_BERKDB_H', None), | 369 | + ('HAVE_BERKDB_H', None), | |
373 | + ('DB_DBM_HSEARCH', None), | 370 | + ('DB_DBM_HSEARCH', None), | |
374 | + ], | 371 | + ], | |
375 | + libraries=["db"]) | 372 | + libraries=["db"]) | |
376 | + break | 373 | + break | |
377 | if dbmext is not None: | 374 | if dbmext is not None: | |
378 | exts.append(dbmext) | 375 | exts.append(dbmext) | |
379 | else: | 376 | else: | |
380 | @@ -2113,6 +1946,7 @@ class PyBuildExt(build_ext): | 377 | @@ -2250,9 +2083,9 @@ def main(): | |
381 | extra_compile_args=extra_compile_args, | |||
382 | extra_link_args=extra_link_args, | |||
383 | libraries=[], | |||
384 | + runtime_library_dirs=['@X11BASE@/lib'], | |||
385 | sources=sources, | |||
386 | depends=depends) | |||
387 | ext_test = Extension('_ctypes_test', | |||
388 | @@ -2250,9 +2084,9 @@ def main(): | |||
389 | ext_modules=[Extension('_struct', ['_struct.c'])], | 378 | ext_modules=[Extension('_struct', ['_struct.c'])], | |
390 | 379 | |||
391 | # Scripts to install | 380 | # Scripts to install | |
392 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', | 381 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', | |
393 | - 'Tools/scripts/2to3', | 382 | - 'Tools/scripts/2to3', | |
394 | - 'Lib/smtpd.py'] | 383 | - 'Lib/smtpd.py'] | |
395 | + scripts = ['Tools/scripts/pydoc2.7', | 384 | + scripts = ['Tools/scripts/pydoc2.7', | |
396 | + 'Tools/scripts/2to3-2.7', | 385 | + 'Tools/scripts/2to3-2.7', | |
397 | + 'Tools/scripts/smtpd2.7.py'] | 386 | + 'Tools/scripts/smtpd2.7.py'] | |
398 | ) | 387 | ) | |
399 | 388 | |||
400 | # --install-platlib | 389 | # --install-platlib |