diff options
author | adam <adam@pkgsrc.org> | 2018-06-17 19:21:21 +0000 |
---|---|---|
committer | adam <adam@pkgsrc.org> | 2018-06-17 19:21:21 +0000 |
commit | 48d53fb236b4f70d783a86d332c3b8e98671bd55 (patch) | |
tree | da8dd702a0f92e1b7a5ec75f13173f324fcd21da /lang/python36 | |
parent | f13c72ec88107b8aaecae9df94160d292ff95c75 (diff) | |
download | pkgsrc-48d53fb236b4f70d783a86d332c3b8e98671bd55.tar.gz |
python: pkgsrc changes
- Fix buidling curses (consistent across platforms)
- Fix finding libraries with ctypes.util.find_library
- Enable spwd module on Linux
- Cleanup
Diffstat (limited to 'lang/python36')
-rw-r--r-- | lang/python36/Makefile | 72 | ||||
-rw-r--r-- | lang/python36/PLIST.Linux | 3 | ||||
-rw-r--r-- | lang/python36/distinfo | 7 | ||||
-rw-r--r-- | lang/python36/patches/patch-Lib_ctypes_util.py | 16 | ||||
-rw-r--r-- | lang/python36/patches/patch-Lib_distutils_command_install.py | 4 | ||||
-rw-r--r-- | lang/python36/patches/patch-setup.py | 56 |
6 files changed, 120 insertions, 38 deletions
diff --git a/lang/python36/Makefile b/lang/python36/Makefile index a2684617b69..89159db7c01 100644 --- a/lang/python36/Makefile +++ b/lang/python36/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.13 2017/12/19 09:37:14 adam Exp $ +# $NetBSD: Makefile,v 1.14 2018/06/17 19:21:22 adam Exp $ .include "dist.mk" PKGNAME= python36-${PY_DISTVERSION} +PKGREVISION= 1 CATEGORIES= lang python MAINTAINER= pkgsrc-users@NetBSD.org @@ -22,12 +23,12 @@ PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")} USE_LANGUAGES= c c++ GNU_CONFIGURE= yes -CONFIGURE_ARGS+= --with-threads CONFIGURE_ARGS+= --enable-shared -CONFIGURE_ARGS+= OPT=${CFLAGS:M*:Q} CONFIGURE_ARGS+= --with-system-ffi -CONFIGURE_ARGS+= --without-pymalloc +CONFIGURE_ARGS+= --with-threads CONFIGURE_ARGS+= --without-ensurepip +CONFIGURE_ARGS+= --without-pymalloc +CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q} CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir} PKGCONFIG_OVERRIDE+= Misc/python.pc.in @@ -104,15 +105,60 @@ PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \ TEST_TARGET= test INSTALL_TARGET= altinstall -REPLACE_INTERPRETER+= py36 -REPLACE.py36.old= .*python[^ ]* -REPLACE.py36.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} -REPLACE_FILES.py36= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py +REPLACE_INTERPRETER+= python +REPLACE.python.old= .*python[^ ]* +REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} +REPLACE_FILES.python= Lib/base64.py +REPLACE_FILES.python+= Lib/cProfile.py +REPLACE_FILES.python+= Lib/cgi.py +REPLACE_FILES.python+= Lib/encodings/rot_13.py +REPLACE_FILES.python+= Lib/idlelib/pyshell.py +REPLACE_FILES.python+= Lib/keyword.py +REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py +REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py +REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py +REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py +REPLACE_FILES.python+= Lib/pdb.py +REPLACE_FILES.python+= Lib/platform.py +REPLACE_FILES.python+= Lib/profile.py +REPLACE_FILES.python+= Lib/pydoc.py +REPLACE_FILES.python+= Lib/quopri.py +REPLACE_FILES.python+= Lib/smtpd.py +REPLACE_FILES.python+= Lib/smtplib.py +REPLACE_FILES.python+= Lib/symbol.py +REPLACE_FILES.python+= Lib/tabnanny.py +REPLACE_FILES.python+= Lib/tarfile.py +REPLACE_FILES.python+= Lib/test/bisect.py +REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py +REPLACE_FILES.python+= Lib/test/curses_tests.py +REPLACE_FILES.python+= Lib/test/pystone.py +REPLACE_FILES.python+= Lib/test/re_tests.py +REPLACE_FILES.python+= Lib/test/regrtest.py +REPLACE_FILES.python+= Lib/timeit.py +REPLACE_FILES.python+= Lib/trace.py +REPLACE_FILES.python+= Lib/turtledemo/__main__.py +REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py +REPLACE_FILES.python+= Lib/turtledemo/clock.py +REPLACE_FILES.python+= Lib/turtledemo/forest.py +REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py +REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py +REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py +REPLACE_FILES.python+= Lib/turtledemo/paint.py +REPLACE_FILES.python+= Lib/turtledemo/peace.py +REPLACE_FILES.python+= Lib/turtledemo/penrose.py +REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py +REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py +REPLACE_FILES.python+= Lib/turtledemo/tree.py +REPLACE_FILES.python+= Lib/turtledemo/yinyang.py +REPLACE_FILES.python+= Lib/uu.py +REPLACE_FILES.python+= Lib/webbrowser.py SUBST_CLASSES+= findlib SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin. SUBST_STAGE.findlib= pre-configure -SUBST_FILES.findlib= Lib/distutils/unixccompiler.py +SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py +SUBST_FILES.findlib+= Lib/ctypes/util.py +SUBST_FILES.findlib+= Lib/distutils/unixccompiler.py SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib @@ -120,18 +166,12 @@ SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' # >>> from ctypes.util import find_library # >>> find_library("m") # 'libm.so.0' -# >>> find_library("crypto") -# 'libcrypto.so.11' -# >>> find_library("GL") -# 'libGL.so.2' -# >>> find_library("curl") -# 'libcurl.so.4' SUBST_CLASSES+= pfindlib SUBST_MESSAGE.pfindlib= Fixing find_library() on POSIX-like (excluding Darwin) systems. SUBST_STAGE.pfindlib= pre-configure SUBST_FILES.pfindlib= Lib/ctypes/util.py -SUBST_SED.pfindlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!' +SUBST_SED.pfindlib= -e "s!\('-Wl,-t', \)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!" .include "options.mk" diff --git a/lang/python36/PLIST.Linux b/lang/python36/PLIST.Linux index 531748d7bdb..a63bc9c9e3f 100644 --- a/lang/python36/PLIST.Linux +++ b/lang/python36/PLIST.Linux @@ -1,2 +1,3 @@ -@comment $NetBSD: PLIST.Linux,v 1.2 2017/01/19 11:15:52 leot Exp $ +@comment $NetBSD: PLIST.Linux,v 1.3 2018/06/17 19:21:22 adam Exp $ lib/python${PY_VER_SUFFIX}/lib-dynload/ossaudiodev.so +lib/python${PY_VER_SUFFIX}/lib-dynload/spwd.so diff --git a/lang/python36/distinfo b/lang/python36/distinfo index 0253f21c284..e3513f934bf 100644 --- a/lang/python36/distinfo +++ b/lang/python36/distinfo @@ -1,10 +1,11 @@ -$NetBSD: distinfo,v 1.19 2018/06/02 23:31:48 youri Exp $ +$NetBSD: distinfo,v 1.20 2018/06/17 19:21:22 adam Exp $ SHA1 (Python-3.6.5.tar.xz) = 5a7a833a36f1006257d298787f4c38493c5d1689 RMD160 (Python-3.6.5.tar.xz) = 213ced5e09552468b1efc855727b743a3ab30e8b SHA512 (Python-3.6.5.tar.xz) = 6b26fcd296b9bd8e67861eff10d14db7507711ddba947288d16d6def53135c39326b7f969c04bb2b2993f924d9e7ad3f5c5282a3915760bc0885cf0a8ea5eb51 Size (Python-3.6.5.tar.xz) = 17049912 bytes -SHA1 (patch-Lib_distutils_command_install.py) = 6fc6f5d918b7581fc62cd0fe55857ee932c3a341 +SHA1 (patch-Lib_ctypes_util.py) = 9f8b674e06eea11e723a34c8af762436a5e3f52e +SHA1 (patch-Lib_distutils_command_install.py) = 29204f34296f36ab2b21c745f915ba73caf2b71c SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf SHA1 (patch-Lib_distutils_unixccompiler.py) = e7aa684fa186de7a01486c3d8bfa177afdd22ef9 SHA1 (patch-Lib_sysconfig.py) = a4f009ed73ebbd9d9c4bf7e12b7981182ed8fd7c @@ -16,4 +17,4 @@ SHA1 (patch-Modules_socketmodule.h) = 13a3290eb72078067060d3e71b7baa08f3eb591c SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be SHA1 (patch-configure) = ab2fb05bb25ba11baecfeb58918f436d3717b2ae SHA1 (patch-pyconfig.h.in) = 58e2c03489f9b6e4d88f144d8c09773f92eacd61 -SHA1 (patch-setup.py) = 95d4b411b81e18635556af6c8c4e7af6a8a2a14c +SHA1 (patch-setup.py) = 56851b30c8a1538012e7c78e7d33af25da5f7db4 diff --git a/lang/python36/patches/patch-Lib_ctypes_util.py b/lang/python36/patches/patch-Lib_ctypes_util.py new file mode 100644 index 00000000000..da7b0d54c8b --- /dev/null +++ b/lang/python36/patches/patch-Lib_ctypes_util.py @@ -0,0 +1,16 @@ +$NetBSD: patch-Lib_ctypes_util.py,v 1.1 2018/06/17 19:21:22 adam Exp $ + +Look for shared libraries in PkgSrc prefix. +Note: /usr/local will get replaced by SUBST. + +--- Lib/ctypes/util.py.orig 2018-03-28 09:19:31.000000000 +0000 ++++ Lib/ctypes/util.py +@@ -278,7 +278,7 @@ elif os.name == "posix": + def _findLib_ld(name): + # See issue #9998 for why this is needed + expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) +- cmd = ['ld', '-t'] ++ cmd = ['ld', '-t', '-L', '/usr/local/lib'] + libpath = os.environ.get('LD_LIBRARY_PATH') + if libpath: + for d in libpath.split(':'): diff --git a/lang/python36/patches/patch-Lib_distutils_command_install.py b/lang/python36/patches/patch-Lib_distutils_command_install.py index fa19a7d2c9a..633f8baaba5 100644 --- a/lang/python36/patches/patch-Lib_distutils_command_install.py +++ b/lang/python36/patches/patch-Lib_distutils_command_install.py @@ -1,4 +1,6 @@ -$NetBSD: patch-Lib_distutils_command_install.py,v 1.1 2017/01/01 14:34:27 adam Exp $ +$NetBSD: patch-Lib_distutils_command_install.py,v 1.2 2018/06/17 19:21:22 adam Exp $ + +Conditionally install Python eggs. --- Lib/distutils/command/install.py.orig 2016-12-23 02:21:19.000000000 +0000 +++ Lib/distutils/command/install.py diff --git a/lang/python36/patches/patch-setup.py b/lang/python36/patches/patch-setup.py index 3208feb38c7..a4470fbd785 100644 --- a/lang/python36/patches/patch-setup.py +++ b/lang/python36/patches/patch-setup.py @@ -1,28 +1,31 @@ -$NetBSD: patch-setup.py,v 1.4 2017/12/19 09:37:14 adam Exp $ +$NetBSD: patch-setup.py,v 1.5 2018/06/17 19:21:22 adam Exp $ -Disable modules, so they can be built as separate packages. +Disable certain modules, so they can be built as separate packages. +Do not look for ncursesw. +Assume panel_library is correct; this is a fix for ncurses' gnupanel + which will get transformed to panel in buildlink. ---- setup.py.orig 2017-12-19 04:53:56.000000000 +0000 +--- setup.py.orig 2018-03-28 09:19:31.000000000 +0000 +++ setup.py -@@ -8,6 +8,7 @@ import importlib.util +@@ -7,7 +7,7 @@ import importlib._bootstrap + import importlib.util import sysconfig - from distutils import log -+from distutils import text_file +-from distutils import log ++from distutils import log, text_file from distutils.errors import * from distutils.core import Extension, setup from distutils.command.build_ext import build_ext -@@ -43,7 +44,8 @@ host_platform = get_platform() +@@ -43,7 +43,7 @@ host_platform = get_platform() COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) # This global variable is used to hold the list of modules to be disabled. -disabled_module_list = [] -+disabled_module_list = ["_curses", "_curses_panel", "_elementtree", -+"_sqlite3", "_tkinter", "_gdbm", "pyexpat", "readline", "spwd", "xxlimited"] ++disabled_module_list = ["_curses", "_curses_panel", "_elementtree", "_gdbm", "pyexpat", "readline", "_sqlite3", "_tkinter", "xxlimited"] def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (after any relative -@@ -512,15 +514,15 @@ class PyBuildExt(build_ext): +@@ -512,15 +512,15 @@ class PyBuildExt(build_ext): return ['m'] def detect_modules(self): @@ -47,7 +50,16 @@ Disable modules, so they can be built as separate packages. self.add_multiarch_paths() # Add paths specified in the environment variables LDFLAGS and -@@ -842,8 +844,7 @@ class PyBuildExt(build_ext): +@@ -776,8 +776,6 @@ class PyBuildExt(build_ext): + # use the same library for the readline and curses modules. + if 'curses' in readline_termcap_library: + curses_library = readline_termcap_library +- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'): +- curses_library = 'ncursesw' + elif self.compiler.find_library_file(lib_dirs, 'ncurses'): + curses_library = 'ncurses' + elif self.compiler.find_library_file(lib_dirs, 'curses'): +@@ -842,8 +840,7 @@ class PyBuildExt(build_ext): depends = ['socketmodule.h']) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ @@ -57,7 +69,7 @@ Disable modules, so they can be built as separate packages. ] ssl_incs = find_file('openssl/ssl.h', inc_dirs, search_for_ssl_incs_in -@@ -854,9 +855,7 @@ class PyBuildExt(build_ext): +@@ -854,9 +851,7 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, @@ -68,7 +80,7 @@ Disable modules, so they can be built as separate packages. if (ssl_incs is not None and ssl_libs is not None): -@@ -875,7 +874,7 @@ class PyBuildExt(build_ext): +@@ -875,7 +870,7 @@ class PyBuildExt(build_ext): # look for the openssl version header on the compiler search path. opensslv_h = find_file('openssl/opensslv.h', [], @@ -77,7 +89,7 @@ Disable modules, so they can be built as separate packages. if opensslv_h: name = os.path.join(opensslv_h[0], 'openssl/opensslv.h') if host_platform == 'darwin' and is_macosx_sdk_path(name): -@@ -1275,6 +1274,30 @@ class PyBuildExt(build_ext): +@@ -1275,6 +1270,30 @@ class PyBuildExt(build_ext): dbm_order = ['gdbm'] # The standard Unix dbm module: if host_platform not in ['cygwin']: @@ -108,7 +120,7 @@ Disable modules, so they can be built as separate packages. config_args = [arg.strip("'") for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] dbm_args = [arg for arg in config_args -@@ -1286,7 +1309,7 @@ class PyBuildExt(build_ext): +@@ -1286,7 +1305,7 @@ class PyBuildExt(build_ext): dbmext = None for cand in dbm_order: if cand == "ndbm": @@ -117,7 +129,17 @@ Disable modules, so they can be built as separate packages. # Some systems have -lndbm, others have -lgdbm_compat, # others don't have either if self.compiler.find_library_file(lib_dirs, -@@ -2105,10 +2128,7 @@ class PyBuildExt(build_ext): +@@ -1418,8 +1437,7 @@ class PyBuildExt(build_ext): + missing.append('_curses') + + # If the curses module is enabled, check for the panel module +- if (module_enabled(exts, '_curses') and +- self.compiler.find_library_file(lib_dirs, panel_library)): ++ if (module_enabled(exts, '_curses')): + exts.append( Extension('_curses_panel', ['_curses_panel.c'], + include_dirs=curses_includes, + define_macros=curses_defines, +@@ -2103,10 +2121,7 @@ class PyBuildExt(build_ext): depends = ['_decimal/docstrings.h'] else: srcdir = sysconfig.get_config_var('srcdir') @@ -129,7 +151,7 @@ Disable modules, so they can be built as separate packages. libraries = self.detect_math_libs() sources = [ '_decimal/_decimal.c', -@@ -2345,7 +2365,7 @@ def main(): +@@ -2389,7 +2404,7 @@ def main(): # If you change the scripts installed here, you also need to # check the PyBuildScripts command above, and change the links # created by the bininstall target in Makefile.pre.in |