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/python35 | |
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/python35')
-rw-r--r-- | lang/python35/Makefile | 71 | ||||
-rw-r--r-- | lang/python35/PLIST.Linux | 3 | ||||
-rw-r--r-- | lang/python35/distinfo | 11 | ||||
-rw-r--r-- | lang/python35/patches/patch-Lib_ctypes_util.py | 41 | ||||
-rw-r--r-- | lang/python35/patches/patch-Modules___cursesmodule.c | 123 | ||||
-rw-r--r-- | lang/python35/patches/patch-configure | 71 | ||||
-rw-r--r-- | lang/python35/patches/patch-pyconfig.h.in | 21 | ||||
-rw-r--r-- | lang/python35/patches/patch-setup.py | 53 |
8 files changed, 250 insertions, 144 deletions
diff --git a/lang/python35/Makefile b/lang/python35/Makefile index 0025786583f..05c33330de9 100644 --- a/lang/python35/Makefile +++ b/lang/python35/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.13 2018/02/05 17:34:18 adam Exp $ +# $NetBSD: Makefile,v 1.14 2018/06/17 19:21:22 adam Exp $ .include "dist.mk" PKGNAME= python35-${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,59 @@ PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \ TEST_TARGET= test INSTALL_TARGET= altinstall -REPLACE_INTERPRETER+= py35 -REPLACE.py35.old= .*python[^ ]* -REPLACE.py35.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} -REPLACE_FILES.py35= 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_SED.findlib= -e 's,/usr/local,${PREFIX},' # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib @@ -120,18 +165,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/python35/PLIST.Linux b/lang/python35/PLIST.Linux index 421c031c667..dc7591a753d 100644 --- a/lang/python35/PLIST.Linux +++ b/lang/python35/PLIST.Linux @@ -1,5 +1,6 @@ -@comment $NetBSD: PLIST.Linux,v 1.1 2015/12/05 17:12:13 adam Exp $ +@comment $NetBSD: PLIST.Linux,v 1.2 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 lib/python${PY_VER_SUFFIX}/plat-${PY_PLATNAME}/CDROM.py lib/python${PY_VER_SUFFIX}/plat-${PY_PLATNAME}/CDROM.pyc lib/python${PY_VER_SUFFIX}/plat-${PY_PLATNAME}/CDROM.pyo diff --git a/lang/python35/distinfo b/lang/python35/distinfo index 65d36b5f685..0aa4fcd017c 100644 --- a/lang/python35/distinfo +++ b/lang/python35/distinfo @@ -1,18 +1,19 @@ -$NetBSD: distinfo,v 1.15 2018/02/05 17:34:18 adam Exp $ +$NetBSD: distinfo,v 1.16 2018/06/17 19:21:22 adam Exp $ SHA1 (Python-3.5.5.tar.xz) = 66c4cfc0f64b545ee5a7725f26a2fd834cdf1682 RMD160 (Python-3.5.5.tar.xz) = dd0b7b9e093312b854b7ba56afbe12a655934744 SHA512 (Python-3.5.5.tar.xz) = c9056baee6a2d1fe7f14b1f310db95b78e8972766d086f8ae10954f38f8182956171580bde01ddadebe897f2545a6fbe47669ca3e4887026ac1fae5ee9197f22 Size (Python-3.5.5.tar.xz) = 15351440 bytes +SHA1 (patch-Lib_ctypes_util.py) = 24ee6d33e39edc2168adabb2065941ff4efb977c SHA1 (patch-Lib_distutils_command_install.py) = 9b44f339f65f029b7f17dbc654739a7ae3c12780 SHA1 (patch-Lib_distutils_unixccompiler.py) = 7d0b70a64b79ee6084c41d8fbb01c8e8e4553419 SHA1 (patch-Makefile.pre.in) = 213f57b7130507e541ee23d6b8da097fd6168fb7 -SHA1 (patch-Modules___cursesmodule.c) = 2ab2779e0418a4529987641c254686ba05d28593 +SHA1 (patch-Modules___cursesmodule.c) = 5b0e9253186c58f5364f2dcd230b1c04f4eba7b7 SHA1 (patch-Modules_makesetup) = c9b571eb54fdf0b1e93524a6de6780e8c4119221 SHA1 (patch-Modules_nismodule.c) = bd290417c265846e238660180e60e76c0f5f696a SHA1 (patch-Modules_socketmodule.c) = 63d583340b071b07ff3e31cf332fcc2ca9ab50e3 SHA1 (patch-Modules_socketmodule.h) = 13a3290eb72078067060d3e71b7baa08f3eb591c SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be -SHA1 (patch-configure) = fcdc55c8cc84017364f840f35e7ec4a131074520 -SHA1 (patch-pyconfig.h.in) = 5d11bd737a949f89b3fbd14db4920873bcc3282e -SHA1 (patch-setup.py) = 7d8afe5e799c8373fe41fbb65e283e0c6f3967d2 +SHA1 (patch-configure) = bce1b2f7dfedb23c561e1d8f32959cd043cdd0df +SHA1 (patch-pyconfig.h.in) = e0aa80eb1ed3677da77fcd0a93f72b61ce148d0d +SHA1 (patch-setup.py) = 26ea130352cf73a49110d86bbccf1803795211e5 diff --git a/lang/python35/patches/patch-Lib_ctypes_util.py b/lang/python35/patches/patch-Lib_ctypes_util.py new file mode 100644 index 00000000000..8802872d200 --- /dev/null +++ b/lang/python35/patches/patch-Lib_ctypes_util.py @@ -0,0 +1,41 @@ +$NetBSD: patch-Lib_ctypes_util.py,v 1.1 2018/06/17 19:21:22 adam Exp $ + +Find libraries using 'ld' (taken from Python 3.7). +Note: /usr/local will get replaced by SUBST. + +--- Lib/ctypes/util.py.orig 2018-05-14 15:07:31.000000000 +0000 ++++ Lib/ctypes/util.py +@@ -285,8 +285,32 @@ elif os.name == "posix": + except OSError: + pass + ++ def _findLib_ld(name): ++ # See issue #9998 for why this is needed ++ expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) ++ cmd = ['ld', '-t', '-L', '/usr/local/lib'] ++ libpath = os.environ.get('LD_LIBRARY_PATH') ++ if libpath: ++ for d in libpath.split(':'): ++ cmd.extend(['-L', d]) ++ cmd.extend(['-o', os.devnull, '-l%s' % name]) ++ result = None ++ try: ++ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE, ++ universal_newlines=True) ++ out, _ = p.communicate() ++ res = re.search(expr, os.fsdecode(out)) ++ if res: ++ result = res.group(0) ++ except Exception as e: ++ pass # result will be None ++ return result ++ + def find_library(name): +- return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ++ # See issue #9998 ++ return _findSoname_ldconfig(name) or \ ++ _get_soname(_findLib_gcc(name) or _findLib_ld(name)) + + ################################################################ + # test code diff --git a/lang/python35/patches/patch-Modules___cursesmodule.c b/lang/python35/patches/patch-Modules___cursesmodule.c index b56ad9f92b7..21f259406b9 100644 --- a/lang/python35/patches/patch-Modules___cursesmodule.c +++ b/lang/python35/patches/patch-Modules___cursesmodule.c @@ -1,11 +1,12 @@ -$NetBSD: patch-Modules___cursesmodule.c,v 1.4 2017/01/05 23:16:42 roy Exp $ +$NetBSD: patch-Modules___cursesmodule.c,v 1.5 2018/06/17 19:21:22 adam Exp $ Allow py-curses to use NetBSD curses as well as ncurses http://bugs.python.org/issue21457 +Use is_pad() when supported (taken from Python 3.7). ---- Modules/_cursesmodule.c.orig 2016-06-25 21:38:38.000000000 +0000 +--- Modules/_cursesmodule.c.orig 2018-02-04 23:40:56.000000000 +0000 +++ Modules/_cursesmodule.c -@@ -112,12 +112,7 @@ char *PyCursesVersion = "2.2"; +@@ -112,13 +112,13 @@ char *PyCursesVersion = "2.2"; #define CURSES_MODULE #include "py_curses.h" @@ -15,11 +16,17 @@ http://bugs.python.org/issue21457 - explicit prototypes here. */ -extern int setupterm(char *,int,int *); -#ifdef __sgi -+#ifdef HAVE_TERM_H ++#if defined(HAVE_TERM_H) || defined(__sgi) ++/* For termname, longname, putp, tigetflag, tigetnum, tigetstr, tparm ++ which are not declared in SysV curses and for setupterm. */ #include <term.h> ++/* Including <term.h> #defines many common symbols. */ ++#undef lines ++#undef columns #endif -@@ -486,17 +481,9 @@ Window_NoArg2TupleReturnFunction(getpary + #ifdef HAVE_LANGINFO_H +@@ -494,17 +494,9 @@ Window_NoArg2TupleReturnFunction(getpary Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)") Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)") @@ -37,16 +44,29 @@ http://bugs.python.org/issue21457 Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)") Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)") Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines") -@@ -1070,7 +1057,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb +@@ -940,6 +932,12 @@ int py_mvwdelch(WINDOW *w, int y, int x) + } + #endif + ++#if defined(HAVE_CURSES_IS_PAD) ++#define py_is_pad(win) is_pad(win) ++#elif defined(WINDOW_HAS_FLAGS) ++#define py_is_pad(win) ((win) ? ((win)->_flags & _ISPAD) != 0 : FALSE) ++#endif ++ + /* chgat, added by Fabian Kreutz <fabian.kreutz at gmx.net> */ + + static PyObject * +@@ -1080,7 +1078,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb return NULL; #ifdef WINDOW_HAS_FLAGS - if (self->win->_flags & _ISPAD) -+ if (is_pad(self->win)) ++ if (py_is_pad(self->win)) return PyCursesCheckERR(pechochar(self->win, ch | attr), "echochar"); else -@@ -1156,11 +1143,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje +@@ -1166,11 +1164,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje return Py_BuildValue("C", rtn); } else { const char *knp; @@ -58,54 +78,34 @@ http://bugs.python.org/issue21457 return PyUnicode_FromString((knp == NULL) ? "" : knp); } } -@@ -1593,7 +1576,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind +@@ -1619,7 +1613,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind #ifndef WINDOW_HAS_FLAGS if (0) #else - if (self->win->_flags & _ISPAD) -+ if (is_pad(self->win)) ++ if (py_is_pad(self->win)) #endif { switch(PyTuple_Size(args)) { -@@ -1768,7 +1751,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj +@@ -1794,7 +1788,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj #ifndef WINDOW_HAS_FLAGS if (0) #else - if (self->win->_flags & _ISPAD) -+ if (is_pad(self->win)) ++ if (py_is_pad(self->win)) #endif { switch(PyTuple_Size(args)) { -@@ -1835,7 +1818,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje +@@ -1861,7 +1855,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */ #ifdef WINDOW_HAS_FLAGS - if (self->win->_flags & _ISPAD) -+ if (is_pad(self->win)) ++ if (py_is_pad(self->win)) win = subpad(self->win, nlines, ncols, begin_y, begin_x); else #endif -@@ -2576,15 +2559,15 @@ PyCurses_IntrFlush(PyObject *self, PyObj - static PyObject * - PyCurses_Is_Term_Resized(PyObject *self, PyObject *args) - { -- int lines; -- int columns; -+ int nlines; -+ int ncolumns; - int result; - - PyCursesInitialised; - -- if (!PyArg_ParseTuple(args,"ii:is_term_resized", &lines, &columns)) -+ if (!PyArg_ParseTuple(args,"ii:is_term_resized", &nlines, &ncolumns)) - return NULL; -- result = is_term_resized(lines, columns); -+ result = is_term_resized(nlines, ncolumns); - if (result == TRUE) { - Py_INCREF(Py_True); - return Py_True; -@@ -2595,7 +2578,6 @@ PyCurses_Is_Term_Resized(PyObject *self, +@@ -2621,7 +2615,6 @@ PyCurses_Is_Term_Resized(PyObject *self, } #endif /* HAVE_CURSES_IS_TERM_RESIZED */ @@ -113,7 +113,7 @@ http://bugs.python.org/issue21457 static PyObject * PyCurses_KeyName(PyObject *self, PyObject *args) { -@@ -2614,7 +2596,6 @@ PyCurses_KeyName(PyObject *self, PyObjec +@@ -2640,7 +2633,6 @@ PyCurses_KeyName(PyObject *self, PyObjec return PyBytes_FromString((knp == NULL) ? "" : knp); } @@ -121,50 +121,7 @@ http://bugs.python.org/issue21457 static PyObject * PyCurses_KillChar(PyObject *self) -@@ -2879,16 +2860,16 @@ PyCurses_update_lines_cols(PyObject *sel - static PyObject * - PyCurses_ResizeTerm(PyObject *self, PyObject *args) - { -- int lines; -- int columns; -+ int nlines; -+ int ncolumns; - PyObject *result; - - PyCursesInitialised; - -- if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns)) -+ if (!PyArg_ParseTuple(args,"ii:resizeterm", &nlines, &ncolumns)) - return NULL; - -- result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm"); -+ result = PyCursesCheckERR(resizeterm(nlines, ncolumns), "resizeterm"); - if (!result) - return NULL; - if (!update_lines_cols()) -@@ -2902,17 +2883,17 @@ PyCurses_ResizeTerm(PyObject *self, PyOb - static PyObject * - PyCurses_Resize_Term(PyObject *self, PyObject *args) - { -- int lines; -- int columns; -+ int nlines; -+ int ncolumns; - - PyObject *result; - - PyCursesInitialised; - -- if (!PyArg_ParseTuple(args,"ii:resize_term", &lines, &columns)) -+ if (!PyArg_ParseTuple(args,"ii:resize_term", &nlines, &ncolumns)) - return NULL; - -- result = PyCursesCheckERR(resize_term(lines, columns), "resize_term"); -+ result = PyCursesCheckERR(resize_term(nlines, ncolumns), "resize_term"); - if (!result) - return NULL; - if (!update_lines_cols()) -@@ -3228,9 +3209,7 @@ static PyMethodDef PyCurses_methods[] = +@@ -3254,9 +3246,7 @@ static PyMethodDef PyCurses_methods[] = #ifdef HAVE_CURSES_IS_TERM_RESIZED {"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS}, #endif @@ -174,7 +131,7 @@ http://bugs.python.org/issue21457 {"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS}, {"longname", (PyCFunction)PyCurses_longname, METH_NOARGS}, {"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS}, -@@ -3359,9 +3338,7 @@ PyInit__curses(void) +@@ -3385,9 +3375,7 @@ PyInit__curses(void) SetDictInt("A_DIM", A_DIM); SetDictInt("A_BOLD", A_BOLD); SetDictInt("A_ALTCHARSET", A_ALTCHARSET); @@ -184,7 +141,7 @@ http://bugs.python.org/issue21457 SetDictInt("A_PROTECT", A_PROTECT); SetDictInt("A_CHARTEXT", A_CHARTEXT); SetDictInt("A_COLOR", A_COLOR); -@@ -3433,7 +3410,6 @@ PyInit__curses(void) +@@ -3459,7 +3447,6 @@ PyInit__curses(void) int key; char *key_n; char *key_n2; @@ -192,7 +149,7 @@ http://bugs.python.org/issue21457 for (key=KEY_MIN;key < KEY_MAX; key++) { key_n = (char *)keyname(key); if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0) -@@ -3461,7 +3437,6 @@ PyInit__curses(void) +@@ -3487,7 +3474,6 @@ PyInit__curses(void) if (key_n2 != key_n) PyMem_Free(key_n2); } diff --git a/lang/python35/patches/patch-configure b/lang/python35/patches/patch-configure index 88c33511de9..e264f15b107 100644 --- a/lang/python35/patches/patch-configure +++ b/lang/python35/patches/patch-configure @@ -1,17 +1,13 @@ -$NetBSD: patch-configure,v 1.2 2017/05/30 14:04:54 bouyer Exp $ - -MirBSD support -http://bugs.python.org/issue21458 +$NetBSD: patch-configure,v 1.3 2018/06/17 19:21:22 adam Exp $ +MirBSD support: http://bugs.python.org/issue21458 Changes for consistency across pkgsrc platforms. +Detect is_pad() (taken from Python 3.7). +Detect netcan/can.h on NetBSD -XXX: Not sure what the BLDSHARED changes are about. - -detect netcan/can.h on NetBSD - ---- configure.orig 2017-01-17 08:57:54.000000000 +0100 -+++ configure 2017-05-30 15:40:52.322257152 +0200 -@@ -3462,7 +3462,7 @@ +--- configure.orig 2018-02-04 23:40:56.000000000 +0000 ++++ configure +@@ -3441,7 +3441,7 @@ case $ac_sys_system/$ac_sys_release in # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. # In addition, Stefan Krah confirms that issue #1244610 exists through # OpenBSD 4.6, but is fixed in 4.7. @@ -20,7 +16,7 @@ detect netcan/can.h on NetBSD define_xopen_source=no # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is # also defined. This can be overridden by defining _BSD_SOURCE -@@ -5996,7 +5996,7 @@ +@@ -5975,7 +5975,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >> PY3LIBRARY=libpython3.so fi ;; @@ -29,7 +25,7 @@ detect netcan/can.h on NetBSD LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -@@ -7991,7 +7991,7 @@ +@@ -7990,7 +7990,7 @@ done # On Linux, can.h and can/raw.h require sys/socket.h @@ -38,7 +34,7 @@ detect netcan/can.h on NetBSD do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " -@@ -9269,8 +9269,8 @@ +@@ -9268,8 +9268,8 @@ then LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' else # No framework, use the Python app as bundle-loader @@ -49,7 +45,7 @@ detect netcan/can.h on NetBSD LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' fi ;; Darwin/*) -@@ -9294,9 +9294,9 @@ +@@ -9293,9 +9293,9 @@ then LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' else # No framework, use the Python app as bundle-loader @@ -62,7 +58,7 @@ detect netcan/can.h on NetBSD fi else # building for OS X 10.3 and later -@@ -9335,6 +9335,9 @@ +@@ -9334,6 +9334,9 @@ then ;; esac fi;; @@ -72,7 +68,7 @@ detect netcan/can.h on NetBSD NetBSD*|DragonFly*) LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; -@@ -9378,7 +9381,7 @@ +@@ -9377,7 +9380,7 @@ then fi;; Linux*|GNU*) CCSHARED="-fPIC";; BSD/OS*/4*) CCSHARED="-fpic";; @@ -81,7 +77,7 @@ detect netcan/can.h on NetBSD OpenUNIX*|UnixWare*) if test "$GCC" = "yes" then CCSHARED="-fPIC" -@@ -9427,7 +9430,7 @@ +@@ -9426,7 +9429,7 @@ then OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; @@ -90,7 +86,7 @@ detect netcan/can.h on NetBSD if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ] then LINKFORSHARED="-Wl,--export-dynamic" -@@ -14758,8 +14761,6 @@ +@@ -14757,8 +14760,6 @@ $as_echo "$SOABI" >&6; } case $ac_sys_system in @@ -99,3 +95,40 @@ detect netcan/can.h on NetBSD *) EXT_SUFFIX=${SHLIB_SUFFIX};; esac +@@ -15694,6 +15695,36 @@ $as_echo "#define WINDOW_HAS_FLAGS 1" >> + + fi + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_pad" >&5 ++$as_echo_n "checking for is_pad... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <curses.h> ++int ++main () ++{ ++ ++#ifndef is_pad ++void *x=is_pad ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ++$as_echo "#define HAVE_CURSES_IS_PAD 1" >>confdefs.h ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_term_resized" >&5 + $as_echo_n "checking for is_term_resized... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff --git a/lang/python35/patches/patch-pyconfig.h.in b/lang/python35/patches/patch-pyconfig.h.in index 6c73eb502bb..4970e14c0bb 100644 --- a/lang/python35/patches/patch-pyconfig.h.in +++ b/lang/python35/patches/patch-pyconfig.h.in @@ -1,10 +1,21 @@ -$NetBSD: patch-pyconfig.h.in,v 1.1 2017/05/30 14:04:54 bouyer Exp $ +$NetBSD: patch-pyconfig.h.in,v 1.2 2018/06/17 19:21:22 adam Exp $ -detect netcan/can.h on NetBSD +Detect is_pad() (taken from Python 3.7). +Detect netcan/can.h on NetBSD ---- pyconfig.h.in.orig 2017-01-17 08:57:54.000000000 +0100 -+++ pyconfig.h.in 2017-05-30 15:41:41.207090795 +0200 -@@ -540,6 +540,9 @@ +--- pyconfig.h.in.orig 2018-02-04 23:40:56.000000000 +0000 ++++ pyconfig.h.in +@@ -146,6 +146,9 @@ + /* Define to 1 if you have the <curses.h> header file. */ + #undef HAVE_CURSES_H + ++/* Define if you have the 'is_pad' function or macro. */ ++#undef HAVE_CURSES_IS_PAD ++ + /* Define if you have the 'is_term_resized' function. */ + #undef HAVE_CURSES_IS_TERM_RESIZED + +@@ -540,6 +543,9 @@ /* Define to 1 if you have the <linux/can/raw.h> header file. */ #undef HAVE_LINUX_CAN_RAW_H diff --git a/lang/python35/patches/patch-setup.py b/lang/python35/patches/patch-setup.py index 64e3ebf5383..60f9c294e87 100644 --- a/lang/python35/patches/patch-setup.py +++ b/lang/python35/patches/patch-setup.py @@ -1,27 +1,31 @@ -$NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ +$NetBSD: patch-setup.py,v 1.5 2018/06/17 19:21:22 adam Exp $ ---- setup.py.orig 2017-01-17 07:57:54.000000000 +0000 +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 2018-02-04 23:40:56.000000000 +0000 +++ setup.py @@ -7,7 +7,7 @@ import importlib._bootstrap import importlib.util import sysconfig -from distutils import log -+from distutils import log,text_file ++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 +43,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 -@@ -487,15 +488,15 @@ class PyBuildExt(build_ext): +@@ -487,15 +487,15 @@ class PyBuildExt(build_ext): return ['m'] def detect_modules(self): @@ -46,17 +50,26 @@ $NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ self.add_multiarch_paths() # Add paths specified in the environment variables LDFLAGS and -@@ -808,8 +809,7 @@ class PyBuildExt(build_ext): +@@ -742,8 +742,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'): +@@ -808,8 +806,7 @@ class PyBuildExt(build_ext): depends = ['socketmodule.h']) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ - '/usr/local/ssl/include', - '/usr/contrib/ssl/include/' -+ '/usr/include' ++ '@SSLBASE@/include' ] ssl_incs = find_file('openssl/ssl.h', inc_dirs, search_for_ssl_incs_in -@@ -820,9 +820,7 @@ class PyBuildExt(build_ext): +@@ -820,9 +817,7 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, @@ -67,7 +80,7 @@ $NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ if (ssl_incs is not None and ssl_libs is not None): -@@ -841,7 +839,7 @@ class PyBuildExt(build_ext): +@@ -841,7 +836,7 @@ class PyBuildExt(build_ext): # look for the openssl version header on the compiler search path. opensslv_h = find_file('openssl/opensslv.h', [], @@ -76,7 +89,7 @@ $NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ if opensslv_h: name = os.path.join(opensslv_h[0], 'openssl/opensslv.h') if host_platform == 'darwin' and is_macosx_sdk_path(name): -@@ -1215,6 +1213,30 @@ class PyBuildExt(build_ext): +@@ -1215,6 +1210,30 @@ class PyBuildExt(build_ext): dbm_order = ['gdbm'] # The standard Unix dbm module: if host_platform not in ['cygwin']: @@ -107,7 +120,7 @@ $NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ config_args = [arg.strip("'") for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] dbm_args = [arg for arg in config_args -@@ -1226,7 +1248,7 @@ class PyBuildExt(build_ext): +@@ -1226,7 +1245,7 @@ class PyBuildExt(build_ext): dbmext = None for cand in dbm_order: if cand == "ndbm": @@ -116,7 +129,17 @@ $NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ # Some systems have -lndbm, others have -lgdbm_compat, # others don't have either if self.compiler.find_library_file(lib_dirs, -@@ -2028,10 +2050,7 @@ class PyBuildExt(build_ext): +@@ -1363,8 +1382,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, +@@ -2031,10 +2049,7 @@ class PyBuildExt(build_ext): depends = ['_decimal/docstrings.h'] else: srcdir = sysconfig.get_config_var('srcdir') @@ -128,7 +151,7 @@ $NetBSD: patch-setup.py,v 1.4 2017/01/26 09:45:23 jperkin Exp $ libraries = [] sources = [ '_decimal/_decimal.c', -@@ -2277,7 +2296,7 @@ def main(): +@@ -2280,7 +2295,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 |