diff options
author | adam <adam> | 2015-12-05 17:12:13 +0000 |
---|---|---|
committer | adam <adam> | 2015-12-05 17:12:13 +0000 |
commit | 2fed671cc8562ab3c6a29953cc5f50dfc56603cb (patch) | |
tree | 2e4392e4999e7c8755cb03109b316314e95e6e8d /lang/python35/patches | |
parent | 86fe5f78628287328e9ce270071ba3844253cb70 (diff) | |
download | pkgsrc-2fed671cc8562ab3c6a29953cc5f50dfc56603cb.tar.gz |
What’s New In Python 3.5
New syntax features:
* PEP 492, coroutines with async and await syntax.
* PEP 465, a new matrix multiplication operator: a @ b.
* PEP 448, additional unpacking generalizations.
New library modules:
* typing: PEP 484 – Type Hints.
* zipapp: PEP 441 Improving Python ZIP Application Support.
New built-in features:
* bytes % args, bytearray % args: PEP 461 – Adding % formatting to bytes and bytearray.
* New bytes.hex(), bytearray.hex() and memoryview.hex() methods. (Contributed by Arnon Yaari in issue 9951.)
* memoryview now supports tuple indexing (including multi-dimensional). (Contributed by Antoine Pitrou in issue 23632.)
* Generators have a new gi_yieldfrom attribute, which returns the object being iterated by yield from expressions. (Contributed by Benno Leslie and Yury Selivanov in issue 24450.)
* A new RecursionError exception is now raised when maximum recursion depth is reached. (Contributed by Georg Brandl in issue 19235.)
CPython implementation improvements:
* When the LC_TYPE locale is the POSIX locale (C locale), sys.stdin and sys.stdout now use the surrogateescape error handler, instead of the strict error handler. (Contributed by Victor Stinner in issue 19977.)
* .pyo files are no longer used and have been replaced by a more flexible scheme that includes the optimization level explicitly in .pyc name. (See PEP 488 overview.)
* Builtin and extension modules are now initialized in a multi-phase process, which is similar to how Python modules are loaded. (See PEP 489 overview.)
Significant improvements in the standard library:
* collections.OrderedDict is now implemented in C, which makes it 4 to 100 times faster.
* The ssl module gained support for Memory BIO, which decouples SSL protocol handling from network IO.
* The new os.scandir() function provides a better and significantly faster way of directory traversal.
* functools.lru_cache() has been mostly reimplemented in C, yielding much better performance.
* The new subprocess.run() function provides a streamlined way to run subprocesses.
* The traceback module has been significantly enhanced for improved performance and developer convenience.
Security improvements:
* SSLv3 is now disabled throughout the standard library. It can still be enabled by instantiating a ssl.SSLContext manually. (See issue 22638 for more details; this change was backported to CPython 3.4 and 2.7.)
* HTTP cookie parsing is now stricter, in order to protect against potential injection attacks. (Contributed by Antoine Pitrou in issue 22796.)
Windows improvements:
* A new installer for Windows has replaced the old MSI. See Using Python on Windows for more information.
* Windows builds now use Microsoft Visual C++ 14.0, and extension modules should use the same.
Diffstat (limited to 'lang/python35/patches')
-rw-r--r-- | lang/python35/patches/patch-Include_py__curses.h | 30 | ||||
-rw-r--r-- | lang/python35/patches/patch-Lib_distutils_command_install.py | 12 | ||||
-rw-r--r-- | lang/python35/patches/patch-Lib_distutils_unixccompiler.py | 13 | ||||
-rw-r--r-- | lang/python35/patches/patch-Makefile.pre.in | 66 | ||||
-rw-r--r-- | lang/python35/patches/patch-Modules___cursesmodule.c | 89 | ||||
-rw-r--r-- | lang/python35/patches/patch-Modules_makesetup | 15 | ||||
-rw-r--r-- | lang/python35/patches/patch-Modules_nismodule.c | 16 | ||||
-rw-r--r-- | lang/python35/patches/patch-Python_thread__pthread.h | 14 | ||||
-rw-r--r-- | lang/python35/patches/patch-configure | 90 | ||||
-rw-r--r-- | lang/python35/patches/patch-setup.py | 130 |
10 files changed, 475 insertions, 0 deletions
diff --git a/lang/python35/patches/patch-Include_py__curses.h b/lang/python35/patches/patch-Include_py__curses.h new file mode 100644 index 00000000000..7c6efc03339 --- /dev/null +++ b/lang/python35/patches/patch-Include_py__curses.h @@ -0,0 +1,30 @@ +$NetBSD: patch-Include_py__curses.h,v 1.1 2015/12/05 17:12:13 adam Exp $ + +* On NetBSD, [n]curses.h and stdlib.h/wchar.h use different guards + against multiple definition of wchar_t and wint_t. +http://bugs.python.org/issue21457 + +--- Include/py_curses.h.orig 2009-09-06 21:26:46.000000000 +0000 ++++ Include/py_curses.h +@@ -44,6 +44,21 @@ + #endif + #endif + ++#ifdef __NetBSD__ ++/* ++** On NetBSD, [n]curses.h and stdlib.h/wchar.h use different guards ++** against multiple definition of wchar_t and wint_t. ++*/ ++#ifdef _XOPEN_SOURCE_EXTENDED ++#ifndef _WCHAR_T ++#define _WCHAR_T ++#endif ++#ifndef _WINT_T ++#define _WINT_T ++#endif ++#endif ++#endif ++ + #ifdef HAVE_NCURSES_H + #include <ncurses.h> + #else diff --git a/lang/python35/patches/patch-Lib_distutils_command_install.py b/lang/python35/patches/patch-Lib_distutils_command_install.py new file mode 100644 index 00000000000..d5fe32b9c4d --- /dev/null +++ b/lang/python35/patches/patch-Lib_distutils_command_install.py @@ -0,0 +1,12 @@ +$NetBSD: patch-Lib_distutils_command_install.py,v 1.1 2015/12/05 17:12:13 adam Exp $ + +--- Lib/distutils/command/install.py.orig 2012-02-23 20:22:44.000000000 +0000 ++++ Lib/distutils/command/install.py +@@ -676,5 +676,6 @@ class install(Command): + ('install_headers', has_headers), + ('install_scripts', has_scripts), + ('install_data', has_data), +- ('install_egg_info', lambda self:True), + ] ++ if not os.environ.get('PKGSRC_PYTHON_NO_EGG'): ++ sub_commands += [('install_egg_info', lambda self:True),] diff --git a/lang/python35/patches/patch-Lib_distutils_unixccompiler.py b/lang/python35/patches/patch-Lib_distutils_unixccompiler.py new file mode 100644 index 00000000000..42856ca9a4a --- /dev/null +++ b/lang/python35/patches/patch-Lib_distutils_unixccompiler.py @@ -0,0 +1,13 @@ +$NetBSD: patch-Lib_distutils_unixccompiler.py,v 1.1 2015/12/05 17:12:13 adam Exp $ + +--- Lib/distutils/unixccompiler.py.orig 2013-05-15 16:32:54.000000000 +0000 ++++ Lib/distutils/unixccompiler.py +@@ -232,7 +232,7 @@ class UnixCCompiler(CCompiler): + elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5": + return ["-rpath", dir] + else: +- if self._is_gcc(compiler): ++ if True: + # gcc on non-GNU systems does not need -Wl, but can + # use it anyway. Since distutils has always passed in + # -Wl whenever gcc was used in the past it is probably diff --git a/lang/python35/patches/patch-Makefile.pre.in b/lang/python35/patches/patch-Makefile.pre.in new file mode 100644 index 00000000000..aa7343b7972 --- /dev/null +++ b/lang/python35/patches/patch-Makefile.pre.in @@ -0,0 +1,66 @@ +$NetBSD: patch-Makefile.pre.in,v 1.1 2015/12/05 17:12:13 adam Exp $ + +Use only one optimisation level; needed for PLIST and setuptools compatibility. + +--- Makefile.pre.in.orig 2015-09-13 11:41:23.000000000 +0000 ++++ Makefile.pre.in +@@ -86,7 +86,7 @@ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODI + # be able to build extension modules using the directories specified in the + # environment variables + PY_CPPFLAGS= $(BASECPPFLAGS) -I. -IInclude -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS) +-PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) ++PY_LDFLAGS= -L. $(CONFIGURE_LDFLAGS) $(LDFLAGS) + NO_AS_NEEDED= @NO_AS_NEEDED@ + LDLAST= @LDLAST@ + SGI_ABI= @SGI_ABI@ +@@ -700,7 +700,7 @@ Python/importlib_external.h: $(srcdir)/L + ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h + +-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib ++Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib $(LIBRARY_OBJS_OMIT_FROZEN) + ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h + +@@ -845,7 +845,7 @@ Objects/setobject.o: $(srcdir)/Objects/s + $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) + $(OPCODETARGETGEN) $(OPCODETARGETS_H) + +-Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h ++#Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h + + Python/frozen.o: Python/importlib.h Python/importlib_external.h + +@@ -1085,7 +1085,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK + if test -n "$(PY3LIBRARY)"; then \ + $(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \ + fi; \ +- else true; \ ++ elif test -f $(INSTSONAME); then \ ++ $(INSTALL_SHARED) $(INSTSONAME) $(DESTDIR)$(LIBDIR); \ + fi + if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ + rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \ +@@ -1271,11 +1272,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +@@ -1284,10 +1280,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt diff --git a/lang/python35/patches/patch-Modules___cursesmodule.c b/lang/python35/patches/patch-Modules___cursesmodule.c new file mode 100644 index 00000000000..5541d37c604 --- /dev/null +++ b/lang/python35/patches/patch-Modules___cursesmodule.c @@ -0,0 +1,89 @@ +$NetBSD: patch-Modules___cursesmodule.c,v 1.1 2015/12/05 17:12:13 adam Exp $ + +Ncurses will be used by devel/py-curses and devel/py-cursespanel. +http://bugs.python.org/issue21457 + +--- Modules/_cursesmodule.c.orig 2015-09-13 11:41:24.000000000 +0000 ++++ Modules/_cursesmodule.c +@@ -486,17 +486,9 @@ Window_NoArg2TupleReturnFunction(getpary + + Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)") + Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)") +-#if defined(__NetBSD__) +-Window_OneArgNoReturnVoidFunction(keypad, int, "i;True(1) or False(0)") +-#else + Window_OneArgNoReturnFunction(keypad, int, "i;True(1) or False(0)") +-#endif + Window_OneArgNoReturnFunction(leaveok, int, "i;True(1) or False(0)") +-#if defined(__NetBSD__) +-Window_OneArgNoReturnVoidFunction(nodelay, int, "i;True(1) or False(0)") +-#else + Window_OneArgNoReturnFunction(nodelay, int, "i;True(1) or False(0)") +-#endif + 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") +@@ -1156,11 +1148,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje + return Py_BuildValue("C", rtn); + } else { + const char *knp; +-#if defined(__NetBSD__) +- knp = unctrl(rtn); +-#else + knp = keyname(rtn); +-#endif + return PyUnicode_FromString((knp == NULL) ? "" : knp); + } + } +@@ -2595,7 +2583,6 @@ PyCurses_Is_Term_Resized(PyObject *self, + } + #endif /* HAVE_CURSES_IS_TERM_RESIZED */ + +-#if !defined(__NetBSD__) + static PyObject * + PyCurses_KeyName(PyObject *self, PyObject *args) + { +@@ -2669,7 +2656,6 @@ PyCurses_MouseMask(PyObject *self, PyObj + availmask = mousemask(newmask, &oldmask); + return Py_BuildValue("(ll)", (long)availmask, (long)oldmask); + } +-#endif + + static PyObject * + PyCurses_Napms(PyObject *self, PyObject *args) +@@ -3228,9 +3214,7 @@ static PyMethodDef PyCurses_methods[] = + #ifdef HAVE_CURSES_IS_TERM_RESIZED + {"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS}, + #endif +-#if !defined(__NetBSD__) + {"keyname", (PyCFunction)PyCurses_KeyName, METH_VARARGS}, +-#endif + {"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS}, + {"longname", (PyCFunction)PyCurses_longname, METH_NOARGS}, + {"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS}, +@@ -3359,9 +3343,7 @@ PyInit__curses(void) + SetDictInt("A_DIM", A_DIM); + SetDictInt("A_BOLD", A_BOLD); + SetDictInt("A_ALTCHARSET", A_ALTCHARSET); +-#if !defined(__NetBSD__) + SetDictInt("A_INVIS", A_INVIS); +-#endif + SetDictInt("A_PROTECT", A_PROTECT); + SetDictInt("A_CHARTEXT", A_CHARTEXT); + SetDictInt("A_COLOR", A_COLOR); +@@ -3433,7 +3415,6 @@ PyInit__curses(void) + int key; + char *key_n; + char *key_n2; +-#if !defined(__NetBSD__) + 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 +3442,6 @@ PyInit__curses(void) + if (key_n2 != key_n) + PyMem_Free(key_n2); + } +-#endif + SetDictInt("KEY_MIN", KEY_MIN); + SetDictInt("KEY_MAX", KEY_MAX); + } diff --git a/lang/python35/patches/patch-Modules_makesetup b/lang/python35/patches/patch-Modules_makesetup new file mode 100644 index 00000000000..f674b7396e9 --- /dev/null +++ b/lang/python35/patches/patch-Modules_makesetup @@ -0,0 +1,15 @@ +$NetBSD: patch-Modules_makesetup,v 1.1 2015/12/05 17:12:13 adam Exp $ + +Support -pthread compiler flag. +http://bugs.python.org/issue21461 + +--- Modules/makesetup.orig 2008-06-11 05:26:20.000000000 +0000 ++++ Modules/makesetup +@@ -164,6 +164,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | + -rpath) libs="$libs $arg"; skip=libs;; + --rpath) libs="$libs $arg"; skip=libs;; + -[A-Zl]*) libs="$libs $arg";; ++ -pthread) libs="$libs $arg";; + *.a) libs="$libs $arg";; + *.so) libs="$libs $arg";; + *.sl) libs="$libs $arg";; diff --git a/lang/python35/patches/patch-Modules_nismodule.c b/lang/python35/patches/patch-Modules_nismodule.c new file mode 100644 index 00000000000..fc2b144cae3 --- /dev/null +++ b/lang/python35/patches/patch-Modules_nismodule.c @@ -0,0 +1,16 @@ +$NetBSD: patch-Modules_nismodule.c,v 1.1 2015/12/05 17:12:13 adam Exp $ + +DragonFlyBSD support +http://bugs.python.org/issue21459 + +--- Modules/nismodule.c.orig 2010-08-19 09:03:03.000000000 +0000 ++++ Modules/nismodule.c +@@ -89,7 +89,7 @@ nis_mapname (char *map, int *pfix) + return map; + } + +-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) ++#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) + typedef int (*foreachfunc)(unsigned long, char *, int, char *, int, void *); + #else + typedef int (*foreachfunc)(int, char *, int, char *, int, char *); diff --git a/lang/python35/patches/patch-Python_thread__pthread.h b/lang/python35/patches/patch-Python_thread__pthread.h new file mode 100644 index 00000000000..0782861d20b --- /dev/null +++ b/lang/python35/patches/patch-Python_thread__pthread.h @@ -0,0 +1,14 @@ +$NetBSD: patch-Python_thread__pthread.h,v 1.1 2015/12/05 17:12:13 adam Exp $ + +--- Python/thread_pthread.h.orig 2013-05-15 16:33:00.000000000 +0000 ++++ Python/thread_pthread.h +@@ -50,6 +50,9 @@ + we need to add 0 to make it work there as well. */ + #if (_POSIX_SEMAPHORES+0) == -1 + #define HAVE_BROKEN_POSIX_SEMAPHORES ++#elif defined(__NetBSD__) ++/* XXX accesses to closed file descriptors, needs debugging */ ++#define HAVE_BROKEN_POSIX_SEMAPHORES + #else + #include <semaphore.h> + #include <errno.h> diff --git a/lang/python35/patches/patch-configure b/lang/python35/patches/patch-configure new file mode 100644 index 00000000000..9b6b8838ce2 --- /dev/null +++ b/lang/python35/patches/patch-configure @@ -0,0 +1,90 @@ +$NetBSD: patch-configure,v 1.1 2015/12/05 17:12:13 adam Exp $ + +MirBSD support +http://bugs.python.org/issue21458 + +Changes for consistency across pkgsrc platforms. + +XXX: Not sure what the BLDSHARED changes are about. + +--- configure.orig 2015-09-13 11:41:26.000000000 +0000 ++++ configure +@@ -3374,7 +3374,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. +- OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.[0123456]) ++ OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.[0123456] | MirBSD/*) + 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 +@@ -5787,7 +5787,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >> + PY3LIBRARY=libpython3.so + fi + ;; +- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) ++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|MirBSD*) + LDLIBRARY='libpython$(LDVERSION).so' + BLDLIBRARY='-L. -lpython$(LDVERSION)' + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +@@ -8832,8 +8832,8 @@ then + LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' + else + # No framework, use the Python app as bundle-loader +- BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)' +- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' ++ BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)' ++ LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' + LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' + fi ;; + Darwin/*) +@@ -8857,9 +8857,9 @@ then + LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' + else + # No framework, use the Python app as bundle-loader +- BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)' +- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' +- LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' ++ BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)' ++ LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' ++ LDCXXSHARED="$LDCXXSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' + fi + else + # building for OS X 10.3 and later +@@ -8898,6 +8898,9 @@ then + ;; + esac + fi;; ++ MirBSD*) ++ LDSHARED='$(CC) -shared $(CCSHARED)' ++ LDCXXSHARED='$(CXX) -shared $(CCSHARED)';; + NetBSD*|DragonFly*) + LDSHARED='$(CC) -shared' + LDCXXSHARED='$(CXX) -shared';; +@@ -8941,7 +8944,7 @@ then + fi;; + Linux*|GNU*) CCSHARED="-fPIC";; + BSD/OS*/4*) CCSHARED="-fpic";; +- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; ++ FreeBSD*|NetBSD*|OpenBSD*|MirBSD*|DragonFly*) CCSHARED="-fPIC";; + OpenUNIX*|UnixWare*) + if test "$GCC" = "yes" + then CCSHARED="-fPIC" +@@ -8990,7 +8993,7 @@ then + OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; + SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; + ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; +- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) ++ FreeBSD*|NetBSD*|OpenBSD*|MirBSD*|DragonFly*) + if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ] + then + LINKFORSHARED="-Wl,--export-dynamic" +@@ -14371,8 +14374,6 @@ $as_echo "$SOABI" >&6; } + + + case $ac_sys_system in +- Linux*|GNU*|Darwin) +- EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; + *) + EXT_SUFFIX=${SHLIB_SUFFIX};; + esac diff --git a/lang/python35/patches/patch-setup.py b/lang/python35/patches/patch-setup.py new file mode 100644 index 00000000000..19039d007a9 --- /dev/null +++ b/lang/python35/patches/patch-setup.py @@ -0,0 +1,130 @@ +$NetBSD: patch-setup.py,v 1.1 2015/12/05 17:12:13 adam Exp $ + +--- setup.py.orig 2014-03-17 02:31:31.000000000 +0000 ++++ setup.py +@@ -33,7 +33,8 @@ 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 = ["_bsddb", "_curses", "_curses_panel", "_elementtree", ++"_sqlite3", "_tkinter", "_gdbm", "pyexpat", "readline", "spwd", "xxlimited"] + + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (after any relative +@@ -441,15 +442,15 @@ class PyBuildExt(build_ext): + os.unlink(tmpfile) + + def detect_modules(self): +- # Ensure that /usr/local is always used, but the local build +- # directories (i.e. '.' and 'Include') must be first. See issue +- # 10520. +- if not cross_compiling: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') +- # only change this for cross builds for 3.3, issues on Mageia +- if cross_compiling: +- self.add_gcc_paths() ++ # Add the buildlink directories for pkgsrc ++ if os.environ.get('BUILDLINK_DIR'): ++ dir = os.environ['BUILDLINK_DIR'] ++ libdir = dir + '/lib' ++ incdir = dir + '/include' ++ if libdir not in self.compiler.library_dirs: ++ self.compiler.library_dirs.insert(0, libdir) ++ if incdir not in self.compiler.include_dirs: ++ self.compiler.include_dirs.insert(0, incdir) + self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and +@@ -751,8 +752,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/' ++ '@SSLBASE@/include' + ] + ssl_incs = find_file('openssl/ssl.h', inc_dirs, + search_for_ssl_incs_in +@@ -763,9 +763,7 @@ class PyBuildExt(build_ext): + if krb5_h: + ssl_incs += krb5_h + ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, +- ['/usr/local/ssl/lib', +- '/usr/contrib/ssl/lib/' +- ] ) ++ [] ) + + if (ssl_incs is not None and + ssl_libs is not None): +@@ -784,7 +782,7 @@ class PyBuildExt(build_ext): + + # look for the openssl version header on the compiler search path. + opensslv_h = find_file('openssl/opensslv.h', [], +- inc_dirs + search_for_ssl_incs_in) ++ search_for_ssl_incs_in + inc_dirs) + if opensslv_h: + name = os.path.join(opensslv_h[0], 'openssl/opensslv.h') + if host_platform == 'darwin' and is_macosx_sdk_path(name): +@@ -1148,6 +1146,30 @@ class PyBuildExt(build_ext): + dbm_order = ['gdbm'] + # The standard Unix dbm module: + if host_platform not in ['cygwin']: ++ ++ ## Top half based on find_file ++ def find_ndbm_h(dirs): ++ ret = None ++ if sys.platform == 'darwin': ++ sysroot = macosx_sdk_root() ++ for dir in dirs: ++ f = os.path.join(dir, 'ndbm.h') ++ if sys.platform == 'darwin' and is_macosx_sdk_path(dir): ++ f = os.path.join(sysroot, dir[1:], 'ndbm.h') ++ if not os.path.exists(f): continue ++ ++ ret = 'True' ++ input = text_file.TextFile(f) ++ while 1: ++ line = input.readline() ++ if not line: break ++ if re.search('This file is part of GDBM', line): ++ ret = None ++ break ++ input.close() ++ break ++ return ret ++ + config_args = [arg.strip("'") + for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] + dbm_args = [arg for arg in config_args +@@ -1159,7 +1181,7 @@ class PyBuildExt(build_ext): + dbmext = None + for cand in dbm_order: + if cand == "ndbm": +- if find_file("ndbm.h", inc_dirs, []) is not None: ++ if find_ndbm_h(inc_dirs) is not None: + # Some systems have -lndbm, others have -lgdbm_compat, + # others don't have either + if self.compiler.find_library_file(lib_dirs, +@@ -1956,10 +1986,7 @@ class PyBuildExt(build_ext): + depends = ['_decimal/docstrings.h'] + else: + srcdir = sysconfig.get_config_var('srcdir') +- include_dirs = [os.path.abspath(os.path.join(srcdir, +- 'Modules', +- '_decimal', +- 'libmpdec'))] ++ include_dirs = ['Modules/_decimal/libmpdec'] + libraries = [] + sources = [ + '_decimal/_decimal.c', +@@ -2205,7 +2232,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 +- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", ++ scripts = ["Tools/scripts/pydoc3", + "Tools/scripts/2to3", "Tools/scripts/pyvenv"] + ) + |