diff --git a/packages/lang/Python3/package.mk b/packages/lang/Python3/package.mk index b013c8f3cd..f92a5a068f 100644 --- a/packages/lang/Python3/package.mk +++ b/packages/lang/Python3/package.mk @@ -3,8 +3,8 @@ PKG_NAME="Python3" # When changing PKG_VERSION remember to sync PKG_PYTHON_VERSION! -PKG_VERSION="3.9.15" -PKG_SHA256="12daff6809528d9f6154216950423c9e30f0e47336cb57c6aa0b4387dd5eb4b2" +PKG_VERSION="3.11.0" +PKG_SHA256="a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3" PKG_LICENSE="OSS" PKG_SITE="https://www.python.org/" PKG_URL="https://www.python.org/ftp/python/${PKG_VERSION}/${PKG_NAME::-1}-${PKG_VERSION}.tar.xz" @@ -13,7 +13,7 @@ PKG_DEPENDS_TARGET="toolchain Python3:host sqlite expat zlib bzip2 xz openssl li PKG_LONGDESC="Python3 is an interpreted object-oriented programming language." PKG_TOOLCHAIN="autotools" -PKG_PYTHON_VERSION="python3.9" +PKG_PYTHON_VERSION="python3.11" PKG_PY_DISABLED_MODULES="_tkinter nis gdbm bsddb ossaudiodev" @@ -34,7 +34,7 @@ PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false --disable-curses --disable-pydoc --disable-test-modules - --enable-lib2to3 + --disable-lib2to3 --disable-idle3 --without-cxx-main --with-expat=builtin @@ -72,7 +72,7 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false --enable-curses --disable-pydoc --disable-test-modules - --enable-lib2to3 + --disable-lib2to3 --disable-idle3 --without-cxx-main --with-expat=system @@ -82,6 +82,7 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false --without-pymalloc --without-ensurepip --enable-ipv6 + --with-build-python=${TOOLCHAIN}/bin/python " pre_configure_host() { diff --git a/packages/lang/Python3/patches/0001-Make-the-build-of-pyc-files-conditional.patch b/packages/lang/Python3/patches/0001-Make-the-build-of-pyc-files-conditional.patch new file mode 100644 index 0000000000..d3b5368903 --- /dev/null +++ b/packages/lang/Python3/patches/0001-Make-the-build-of-pyc-files-conditional.patch @@ -0,0 +1,56 @@ +From 322724e166d7ec0393aec577c12fdf6ef2b61e1d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 16:21:31 -0800 +Subject: [PATCH] Make the build of pyc files conditional + +This commit adds a new configure option --disable-pyc-build to disable +the compilation of pyc. + +Signed-off-by: Thomas Petazzoni +[ Andrey Smrinov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 2 ++ + configure.ac | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 77f91e72b1..0c809f3d8a 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1600,6 +1600,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi ++ifeq (@PYC_BUILD@,yes) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ +@@ -1627,6 +1628,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages ++endif + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +diff --git a/configure.ac b/configure.ac +index d60f05251a..1ee5a09588 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1110,6 +1110,12 @@ fi + + AC_MSG_CHECKING(LDLIBRARY) + ++AC_SUBST(PYC_BUILD) ++ ++AC_ARG_ENABLE(pyc-build, ++ AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]), ++ [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ]) ++ + # MacOSX framework builds need more magic. LDLIBRARY is the dynamic + # library that we build, but we do not want to link against it (we + # will find it with a -framework option). For this reason there is an +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch b/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch new file mode 100644 index 0000000000..77b5a977f7 --- /dev/null +++ b/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch @@ -0,0 +1,27 @@ +From 72e20220f3a592b3ab9f440fbe74efa9f9e82d49 Mon Sep 17 00:00:00 2001 +From: Vanya Sergeev +Date: Wed, 23 Dec 2015 11:30:33 +0100 +Subject: [PATCH] Disable buggy_getaddrinfo configure test when cross-compiling + with IPv6 support + +Signed-off-by: Vanya Sergeev +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 1ee5a09588..c2445edc88 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5086,7 +5086,7 @@ fi + dnl if ac_cv_func_getaddrinfo + ]) + +-if test "$ac_cv_func_getaddrinfo" = no -o "$ac_cv_buggy_getaddrinfo" = yes ++if test "$ac_cv_func_getaddrinfo" = no || test "$cross_compiling" != "yes" -a "$ac_cv_buggy_getaddrinfo" = yes + then + AS_VAR_IF([ipv6], [yes], [ + AC_MSG_ERROR([m4_normalize([ +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch b/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch new file mode 100644 index 0000000000..10762cb1a9 --- /dev/null +++ b/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch @@ -0,0 +1,108 @@ +From df7c95b4ceecf390b961d843a556c470ac9080b2 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 16:33:22 -0800 +Subject: [PATCH] Add infrastructure to disable the build of certain extensions + +Some of the extensions part of the Python core have dependencies on +external libraries (sqlite, tk, etc.) or are relatively big and not +necessarly always useful (CJK codecs for example). By extensions, we +mean part of Python modules that are written in C and therefore +compiled to binary code. + +Therefore, we introduce a small infrastructure that allows to disable +some of those extensions. This can be done inside the configure.ac by +adding values to the DISABLED_EXTENSIONS variable (which is a +word-separated list of extensions). + +The implementation works as follow : + + * configure.ac defines a DISABLED_EXTENSIONS variable, which is + substituted (so that when Makefile.pre is generated from + Makefile.pre.in, the value of the variable is substituted). For + now, this DISABLED_EXTENSIONS variable is empty, later patches will + use it. + + * Makefile.pre.in passes the DISABLED_EXTENSIONS value down to the + variables passed in the environment when calling the setup.py + script that actually builds and installs those extensions. + + * setup.py is modified so that the existing "disabled_module_list" is + filled with those pre-disabled extensions listed in + DISABLED_EXTENSIONS. + +Patch ported to python2.7 by Maxime Ripard , and +then extended by Thomas Petazzoni +. + +Signed-off-by: Thomas Petazzoni +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 6 +++++- + configure.ac | 2 ++ + setup.py | 5 ++++- + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 0c809f3d8a..7c3dde8dd4 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -239,6 +239,8 @@ FILEMODE= 644 + # configure script arguments + CONFIG_ARGS= @CONFIG_ARGS@ + ++# disabled extensions ++DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@ + + # Subdirectories with code + SRCDIRS= @SRCDIRS@ +@@ -739,6 +741,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + *) quiet="";; \ + esac; \ + echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ ++ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' + +@@ -2228,7 +2231,8 @@ libainstall: @DEF_MAKE_RULE@ python-config + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: all +- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ ++ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ ++ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +diff --git a/configure.ac b/configure.ac +index c2445edc88..73d66167de 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3091,6 +3091,8 @@ LIBS="$withval $LIBS" + + PKG_PROG_PKG_CONFIG + ++AC_SUBST(DISABLED_EXTENSIONS) ++ + # Check for use of the system expat library + AC_MSG_CHECKING(for --with-system-expat) + AC_ARG_WITH(system_expat, +diff --git a/setup.py b/setup.py +index 770866bca7..b6c829b3a5 100644 +--- a/setup.py ++++ b/setup.py +@@ -58,7 +58,10 @@ with warnings.catch_warnings(): + TEST_EXTENSIONS = (sysconfig.get_config_var('TEST_MODULES') == 'yes') + + # This global variable is used to hold the list of modules to be disabled. +-DISABLED_MODULE_LIST = [] ++try: ++ DISABLED_MODULE_LIST = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ") ++except KeyError: ++ DISABLED_MODULE_LIST = list() + + # --list-module-names option used by Tools/scripts/generate_module_names.py + LIST_MODULE_NAMES = False +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0004-Adjust-library-header-paths-for-cross-compilation.patch b/packages/lang/Python3/patches/0004-Adjust-library-header-paths-for-cross-compilation.patch new file mode 100644 index 0000000000..0311348405 --- /dev/null +++ b/packages/lang/Python3/patches/0004-Adjust-library-header-paths-for-cross-compilation.patch @@ -0,0 +1,69 @@ +From 61af65485f1dade4aa08d0cf2b24082aeda24c51 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:33:14 +0100 +Subject: [PATCH] Adjust library/header paths for cross-compilation + +When cross-compiling third-party extensions, the get_python_inc() or +get_python_lib() can be called, to return the path to headers or +libraries. However, they use the sys.prefix of the host Python, which +returns incorrect paths when cross-compiling (paths pointing to host +headers and libraries). + +In order to fix this, we introduce the _python_sysroot, _python_prefix +and _python_exec_prefix variables, that allow to override these +values, and get correct header/library paths when cross-compiling +third-party Python modules. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Adam Duskett +Refresh for 3.10.0 +--- + Lib/distutils/command/build_ext.py | 5 ++++- + Lib/sysconfig.py | 15 +++++++++++---- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index 1a9bd12..3cf7d67 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -234,7 +234,10 @@ class build_ext(Command): + if (sysconfig.get_config_var('Py_ENABLE_SHARED')): + if not sysconfig.python_build: + # building third party extensions +- self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) ++ libdir = sysconfig.get_config_var('LIBDIR') ++ if "_python_sysroot" in os.environ: ++ libdir = os.environ.get("_python_sysroot") + libdir ++ self.library_dirs.append(libdir) + else: + # building python standard extensions + self.library_dirs.append('.') +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index 95b48f6..9fb1956 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -123,10 +123,17 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', + _PY_VERSION = sys.version.split()[0] + _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}' + _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}' +-_PREFIX = os.path.normpath(sys.prefix) +-_BASE_PREFIX = os.path.normpath(sys.base_prefix) +-_EXEC_PREFIX = os.path.normpath(sys.exec_prefix) +-_BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) ++if "_python_sysroot" in os.environ: ++ _sysroot=os.environ.get('_python_sysroot') ++ _PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix')) ++ _EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix')) ++ _BASE_PREFIX = _PREFIX ++ _BASE_EXEC_PREFIX = _EXEC_PREFIX ++else: ++ _PREFIX = os.path.normpath(sys.prefix) ++ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) ++ _BASE_PREFIX = os.path.normpath(sys.base_prefix) ++ _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) + _CONFIG_VARS = None + _USER_BASE = None + +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch b/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch new file mode 100644 index 0000000000..c5b6460e7c --- /dev/null +++ b/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch @@ -0,0 +1,31 @@ +From 60d71e37d167ea89445250be436170a6cfee84e7 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:36:00 +0100 +Subject: [PATCH] Don't look in /usr/lib/termcap for libraries + +Signed-off-by: Thomas Petazzoni +--- + setup.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/setup.py b/setup.py +index 66d372a..e632b6f 100644 +--- a/setup.py ++++ b/setup.py +@@ -1147,12 +1147,9 @@ class PyBuildExt(build_ext): + pass # Issue 7384: Already linked against curses or tinfo. + elif curses_library: + readline_libs.append(curses_library) +- elif self.compiler.find_library_file(self.lib_dirs + +- ['/usr/lib/termcap'], +- 'termcap'): ++ elif self.compiler.find_library_file(self.lib_dirs, 'termcap'): + readline_libs.append('termcap') + self.add(Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], + libraries=readline_libs)) + else: + self.missing.append('readline') +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0006-Don-t-add-multiarch-paths.patch b/packages/lang/Python3/patches/0006-Don-t-add-multiarch-paths.patch new file mode 100644 index 0000000000..48d8cc790e --- /dev/null +++ b/packages/lang/Python3/patches/0006-Don-t-add-multiarch-paths.patch @@ -0,0 +1,37 @@ +From f5933b8f973cd11698b52d535a10d0474e49f5a5 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:36:27 +0100 +Subject: [PATCH] Don't add multiarch paths + +The add_multiarch_paths() function leads, in certain build +environments, to the addition of host header paths to the CFLAGS, +which is not appropriate for cross-compilation. This patch fixes that +by simply removing the call to add_multiarch_paths() when we're +cross-compiling. + +Investigation done by David . + +Signed-off-by: Thomas Petazzoni +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index ec3ba60607..e27620035c 100644 +--- a/setup.py ++++ b/setup.py +@@ -830,10 +830,10 @@ class PyBuildExt(build_ext): + 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') ++ self.add_multiarch_paths() + # only change this for cross builds for 3.3, issues on Mageia + if CROSS_COMPILING: + self.add_cross_compiling_paths() +- self.add_multiarch_paths() + self.add_ldflags_cppflags() + + def init_inc_lib_dirs(self): +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0007-Abort-on-failed-module-build.patch b/packages/lang/Python3/patches/0007-Abort-on-failed-module-build.patch new file mode 100644 index 0000000000..32e2261a05 --- /dev/null +++ b/packages/lang/Python3/patches/0007-Abort-on-failed-module-build.patch @@ -0,0 +1,30 @@ +From 188c0ebfdb71f5252fa7701013b8d1209f28aef7 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:43:24 +0100 +Subject: [PATCH] Abort on failed module build + +When building a Python module fails, the setup.py script currently +doesn't exit with an error, and simply continues. This is not a really +nice behavior, so this patch changes setup.py to abort with an error, +so that the build issue is clearly noticeable. + +Signed-off-by: Thomas Petazzoni +--- + setup.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.py b/setup.py +index e27620035c..d3f0e663f2 100644 +--- a/setup.py ++++ b/setup.py +@@ -561,6 +561,7 @@ class PyBuildExt(build_ext): + print("Failed to build these modules:") + print_three_column(failed) + print() ++ sys.exit(1) + + if self.failed_on_import: + failed = self.failed_on_import[:] +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0008-Serial-ioctl-workaround.patch b/packages/lang/Python3/patches/0008-Serial-ioctl-workaround.patch new file mode 100644 index 0000000000..df31cd6220 --- /dev/null +++ b/packages/lang/Python3/patches/0008-Serial-ioctl-workaround.patch @@ -0,0 +1,33 @@ +From 9e6211b0d6d4610e5fb7d2c7e1152eb7c64d968b Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Wed, 23 Dec 2015 11:44:02 +0100 +Subject: [PATCH] Serial ioctl() workaround + +The ioctls.h of some architectures (notably xtensa) references structs from +linux/serial.h. Make sure to include this header as well. + +Also, undef TIOCTTYGSTRUCT that require reference to internal kernel tty_struct, +but isn't actually referenced in modern kernels. + +Signed-off-by: Baruch Siach +--- + Modules/termios.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Modules/termios.c b/Modules/termios.c +index 75e5e52320..eefbddfe69 100644 +--- a/Modules/termios.c ++++ b/Modules/termios.c +@@ -15,7 +15,9 @@ + #endif + + #include ++#include + #include ++#undef TIOCTTYGSTRUCT + + /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR, + * MDTR, MRI, and MRTS (apparently used internally by some things +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0009-Do-not-adjust-the-shebang-of-Python-scripts-for-cros.patch b/packages/lang/Python3/patches/0009-Do-not-adjust-the-shebang-of-Python-scripts-for-cros.patch new file mode 100644 index 0000000000..8a77fe3708 --- /dev/null +++ b/packages/lang/Python3/patches/0009-Do-not-adjust-the-shebang-of-Python-scripts-for-cros.patch @@ -0,0 +1,35 @@ +From cb595a591c71e0bf7c63a3706b0be45ac6a642e3 Mon Sep 17 00:00:00 2001 +From: Christophe Vu-Brugier +Date: Wed, 23 Dec 2015 11:44:30 +0100 +Subject: [PATCH] Do not adjust the shebang of Python scripts for + cross-compilation + +The copy_scripts() method in distutils copies the scripts listed in +the setup file and adjusts the first line to refer to the current +Python interpreter. When cross-compiling, this means that the adjusted +shebang refers to the host Python interpreter. + +This patch modifies copy_scripts() to preserve the shebang when +cross-compilation is detected. + +Signed-off-by: Christophe Vu-Brugier +--- + Lib/distutils/command/build_scripts.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py +index ccc70e6465..d6d54195c1 100644 +--- a/Lib/distutils/command/build_scripts.py ++++ b/Lib/distutils/command/build_scripts.py +@@ -91,7 +91,7 @@ class build_scripts(Command): + adjust = True + post_interp = match.group(1) or b'' + +- if adjust: ++ if adjust and not '_python_sysroot' in os.environ: + log.info("copying and adjusting %s -> %s", script, + self.build_dir) + updated_files.append(outfile) +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0010-Misc-python-config.sh.in-ensure-sed-invocations-only.patch b/packages/lang/Python3/patches/0010-Misc-python-config.sh.in-ensure-sed-invocations-only.patch new file mode 100644 index 0000000000..a1f9ab6cd9 --- /dev/null +++ b/packages/lang/Python3/patches/0010-Misc-python-config.sh.in-ensure-sed-invocations-only.patch @@ -0,0 +1,67 @@ +From eb51497e4b5799f8ab0277426d3e54414acb9d4b Mon Sep 17 00:00:00 2001 +From: Peter Korsgaard +Date: Thu, 20 Nov 2014 13:24:59 +0100 +Subject: [PATCH] Misc/python-config.sh.in: ensure sed invocations only match + beginning of strings + +The build/real prefix handling using sed breaks if build != real and the +standard include / lib directories are used ($prefix/include and $prefix/lib). + +E.G. + +prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include". + +If this gets installed with make DESTDIR="/foo" install, then we end up with +prefix_real = prefix = "/foo/usr" as expected, but +includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of +the double sed invocation (prefix is already expanded). Work around it by +ensuring we only match the beginning of the string. + +Submitted upstream: http://bugs.python.org/issue22907 + +Signed-off-by: Peter Korsgaard +--- + Misc/python-config.sh.in | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index 2602fe24c0..a1bc3cd5f7 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -24,18 +24,19 @@ installed_prefix () + echo $RESULT + } + ++prefix_build="@prefix@" + prefix_real=$(installed_prefix "$0") + + # Use sed to fix paths from their built-to locations to their installed-to + # locations. Keep prefix & exec_prefix using their original values in case + # they are referenced in other configure variables, to prevent double + # substitution, issue #22140. +-prefix="@prefix@" +-exec_prefix="@exec_prefix@" ++prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") ++exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") + exec_prefix_real=${prefix_real} +-includedir=$(echo "@includedir@" | sed "s#$prefix#$prefix_real#") +-libdir=$(echo "@libdir@" | sed "s#$prefix#$prefix_real#") +-CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix#$prefix_real#") ++includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") ++libdir=$(echo "@libdir@" | sed "s#^$prefix_build#$prefix_real#") ++CFLAGS=$(echo "@CFLAGS@" | sed "s#^$prefix_build#$prefix_real#") + VERSION="@VERSION@" + LIBM="@LIBM@" + LIBC="@LIBC@" +@@ -49,7 +50,7 @@ OPT="@OPT@" + PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" + LDVERSION="@LDVERSION@" + LIBDEST=${prefix_real}/lib/python${VERSION} +-LIBPL=$(echo "@LIBPL@" | sed "s#$prefix#$prefix_real#") ++LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") + SO="@EXT_SUFFIX@" + PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" + INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch b/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch new file mode 100644 index 0000000000..299110464c --- /dev/null +++ b/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch @@ -0,0 +1,100 @@ +From a65e5d3caf8e076d531191164c23c6240461f675 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:07:56 -0800 +Subject: [PATCH] Add an option to disable pydoc + +It removes 0.5 MB of data from the target plus the pydoc script +itself. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 7 ++++++- + configure.ac | 6 ++++++ + setup.py | 9 +++++++-- + 3 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index c0d5511..32b3df7 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1391,7 +1391,9 @@ bininstall: altbininstall + -rm -f $(DESTDIR)$(BINDIR)/idle3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) + -rm -f $(DESTDIR)$(BINDIR)/pydoc3 ++ifeq (@PYDOC@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) ++endif + -rm -f $(DESTDIR)$(BINDIR)/2to3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) + if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ +@@ -1442,7 +1444,6 @@ LIBSUBDIRS= asyncio \ + json \ + logging \ + multiprocessing multiprocessing/dummy \ +- pydoc_data \ + re \ + site-packages \ + tkinter \ +@@ -1530,6 +1531,10 @@ TESTSUBDIRS= ctypes/test \ + tkinter/test/test_ttk \ + unittest/test unittest/test/testmock + ++ifeq (@PYDOC@,yes) ++LIBSUBDIRS += pydoc_data ++endif ++ + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ +diff --git a/configure.ac b/configure.ac +index 083a12d..9079531 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3373,6 +3373,12 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_getcpuclockid) + fi + ++AC_SUBST(PYDOC) ++ ++AC_ARG_ENABLE(pydoc, ++ AS_HELP_STRING([--disable-pydoc], [disable pydoc]), ++ [ PYDOC="${enableval}" ], [ PYDOC=yes ]) ++ + + # Check for enable-ipv6 + AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) +diff --git a/setup.py b/setup.py +index d00d389..d23f148 100644 +--- a/setup.py ++++ b/setup.py +@@ -2721,6 +2721,12 @@ def main(): + # turn off warnings when deprecated modules are imported + import warnings + warnings.filterwarnings("ignore",category=DeprecationWarning) ++ ++ scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3', ++ 'Lib/smtpd.py'] ++ if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): ++ scripts += [ 'Tools/scripts/pydoc3' ] ++ + setup(# PyPI Metadata (PEP 301) + name = "Python", + version = sys.version.split()[0], +@@ -2746,8 +2752,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", +- "Tools/scripts/2to3"] ++ scripts = scripts + ) + + # --install-platlib +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch b/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch new file mode 100644 index 0000000000..8155250e5a --- /dev/null +++ b/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch @@ -0,0 +1,119 @@ +From f034b1b0f33a7bd4dde23f0bc1fa8e00e3518c9d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:15:31 -0800 +Subject: [PATCH] Add an option to disable lib2to3 + +lib2to3 is a library to convert Python 2.x code to Python 3.x. As +such, it is probably not very useful on embedded system targets. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 17 ++++++++++++----- + configure.ac | 5 +++++ + setup.py | 6 +++--- + 3 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 28cf88e..63fa9fb 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1395,7 +1395,9 @@ ifeq (@PYDOC@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) + endif + -rm -f $(DESTDIR)$(BINDIR)/2to3 ++ifeq (@LIB2TO3@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) ++endif + if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ + rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \ + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \ +@@ -1441,7 +1443,6 @@ LIBSUBDIRS= asyncio \ + idlelib idlelib/Icons \ + importlib importlib/resources importlib/metadata \ + json \ +- lib2to3 lib2to3/fixes lib2to3/pgen2 \ + logging \ + multiprocessing multiprocessing/dummy \ + re \ +@@ -1458,10 +1459,6 @@ LIBSUBDIRS= asyncio \ + TESTSUBDIRS= ctypes/test \ + distutils/tests \ + idlelib/idle_test \ +- lib2to3/tests \ +- lib2to3/tests/data \ +- lib2to3/tests/data/fixers \ +- lib2to3/tests/data/fixers/myfixes \ + test test/audiodata \ + test/capath test/cjkencodings \ + test/data test/decimaltestdata \ +@@ -1535,6 +1532,14 @@ ifeq (@PYDOC@,yes) + LIBSUBDIRS += pydoc_data + endif + ++ifeq (@LIB2TO3@,yes) ++LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 ++TESTSUBDIRS += lib2to3/tests \ ++ lib2to3/tests/data \ ++ lib2to3/tests/data/fixers \ ++ lib2to3/tests/data/fixers/myfixes ++endif ++ + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ +@@ -1637,10 +1642,12 @@ ifeq (@PYC_BUILD@,yes) + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + endif ++ifeq (@LIB2TO3@,yes) + -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 ++endif + + # bpo-21536: Misc/python-config.sh is generated in the build directory + # from $(srcdir)Misc/python-config.sh.in. +diff --git a/configure.ac b/configure.ac +index 9079531..34c2ba9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6014,6 +6014,11 @@ else + fi + AC_SUBST(TEST_MODULES) + ++AC_SUBST(LIB2TO3) ++ ++AC_ARG_ENABLE(lib2to3, ++ AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), ++ [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) + + # generate output files + AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) +diff --git a/setup.py b/setup.py +index d23f148..663fd44 100644 +--- a/setup.py ++++ b/setup.py +@@ -2722,11 +2722,11 @@ def main(): + import warnings + warnings.filterwarnings("ignore",category=DeprecationWarning) + +- scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3', +- 'Lib/smtpd.py'] ++ scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py'] + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): + scripts += [ 'Tools/scripts/pydoc3' ] +- ++ if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"): ++ scripts += [ 'Tools/scripts/2to3' ] + setup(# PyPI Metadata (PEP 301) + name = "Python", + version = sys.version.split()[0], +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch b/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch new file mode 100644 index 0000000000..a03334e667 --- /dev/null +++ b/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch @@ -0,0 +1,63 @@ +From dd2722dec08eb9c72c36313e93661eeca3ad64d8 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:20:45 -0800 +Subject: [PATCH] Add option to disable the sqlite3 module + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 7 +++++-- + configure.ac | 9 +++++++++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 5847029..5628860 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1920,7 +1920,6 @@ LIBSUBDIRS= asyncio \ + logging \ + multiprocessing multiprocessing/dummy \ + site-packages \ +- sqlite3 \ + tkinter \ + turtledemo \ + unittest \ +@@ -2021,6 +2020,11 @@ TESTSUBDIRS += lib2to3/tests \ + lib2to3/tests/data/fixers/myfixes + endif + ++ifeq (@SQLITE3@,yes) ++LIBSUBDIRS += sqlite3 ++TESTSUBDIRS += sqlite3/test ++endif ++ + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ +diff --git a/configure.ac b/configure.ac +index 34c2ba9..dfee472 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3373,6 +3373,15 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_getcpuclockid) + fi + ++AC_SUBST(SQLITE3) ++AC_ARG_ENABLE(sqlite3, ++ AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]), ++ [ SQLITE3="${enableval}" ], [ SQLITE3=yes ]) ++ ++if test "$SQLITE3" = "no" ; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch b/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch new file mode 100644 index 0000000000..0d8dac6cf5 --- /dev/null +++ b/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch @@ -0,0 +1,74 @@ +From ad6b66b34f71ff6b60b3be5f6fd3e781cdeecd59 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:23:42 -0800 +Subject: [PATCH] Add an option to disable the tk module + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 10 +++++++--- + configure.ac | 9 +++++++++ + 2 files changed, 16 insertions(+), 3 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 5628860..c968113 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1446,7 +1446,6 @@ LIBSUBDIRS= asyncio \ + multiprocessing multiprocessing/dummy \ + re \ + site-packages \ +- tkinter \ + tomllib \ + turtledemo \ + unittest \ +@@ -1522,8 +1521,6 @@ TESTSUBDIRS= ctypes/test \ + test/tracedmodules \ + test/xmltestdata test/xmltestdata/c14n-20 \ + test/ziptestdata \ +- tkinter/test tkinter/test/test_tkinter \ +- tkinter/test/test_ttk \ + unittest/test unittest/test/testmock + + ifeq (@PYDOC@,yes) +@@ -1543,6 +1540,13 @@ LIBSUBDIRS += sqlite3 + TESTSUBDIRS += sqlite3/test + endif + ++ifeq (@TK@,yes) ++LIBSUBDIRS += tkinter ++TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ ++ tkinter/test/test_ttk ++endif ++ ++ + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ +diff --git a/configure.ac b/configure.ac +index dfee472..dc76dff 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3382,6 +3382,15 @@ if test "$SQLITE3" = "no" ; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" + fi + ++AC_SUBST(TK) ++AC_ARG_ENABLE(tk, ++ AS_HELP_STRING([--disable-tk], [disable tk]), ++ [ TK="${enableval}" ], [ TK=yes ]) ++ ++if test "$TK" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0015-Add-an-option-to-disable-the-curses-module.patch b/packages/lang/Python3/patches/0015-Add-an-option-to-disable-the-curses-module.patch new file mode 100644 index 0000000000..35d92fb7d1 --- /dev/null +++ b/packages/lang/Python3/patches/0015-Add-an-option-to-disable-the-curses-module.patch @@ -0,0 +1,61 @@ +From 962deb43f5f340a8472d432ae8e6d61186f9040e Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:31:51 -0800 +Subject: [PATCH] Add an option to disable the curses module + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 4 +++- + configure.ac | 9 +++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index c968113..f89f155 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1432,7 +1432,6 @@ LIBSUBDIRS= asyncio \ + concurrent concurrent/futures \ + csv \ + ctypes ctypes/macholib \ +- curses \ + dbm \ + distutils distutils/command \ + email email/mime \ +@@ -1546,6 +1545,9 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ + tkinter/test/test_ttk + endif + ++ifeq (@CURSES@,yes) ++LIBSUBDIRS += curses ++endif + + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c +diff --git a/configure.ac b/configure.ac +index dc76dff..4f1cda5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3391,6 +3391,15 @@ if test "$TK" = "no"; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" + fi + ++AC_SUBST(CURSES) ++AC_ARG_ENABLE(curses, ++ AS_HELP_STRING([--disable-curses], [disable curses]), ++ [ CURSES="${enableval}" ], [ CURSES=yes ]) ++ ++if test "$CURSES" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch b/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch new file mode 100644 index 0000000000..854292ef58 --- /dev/null +++ b/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch @@ -0,0 +1,79 @@ +From 7e0e7dc25f50acd6922493ae620ee5cbf107a79a Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:40:45 -0800 +Subject: [PATCH] Add an option to disable expat + +This patch replaces the existing --with-system-expat option with a +--with-expat={system,builtin,none} option, which allows to tell Python +whether we want to use the system expat (already installed), the expat +builtin the Python sources, or no expat at all (which disables the +installation of XML modules). + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 5 ++++- + configure.ac | 18 +++++++++++++----- + setup.py | 2 +- + 3 files changed, 18 insertions(+), 7 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f89f155..08c5e8a 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1450,7 +1450,6 @@ LIBSUBDIRS= asyncio \ + urllib \ + venv venv/scripts venv/scripts/common venv/scripts/posix \ + wsgiref \ +- $(XMLLIBSUBDIRS) \ + xmlrpc \ + zoneinfo + TESTSUBDIRS= ctypes/test \ +@@ -1549,6 +1548,10 @@ ifeq (@CURSES@,yes) + LIBSUBDIRS += curses + endif + ++ifeq (@EXPAT@,yes) ++LIBSUBDIRS += $(XMLLIBSUBDIRS) ++endif ++ + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ +diff --git a/configure.ac b/configure.ac +index 4f1cda5..e99a174 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3094,13 +3094,21 @@ PKG_PROG_PKG_CONFIG + AC_SUBST(DISABLED_EXTENSIONS) + + # Check for use of the system expat library +-AC_MSG_CHECKING(for --with-system-expat) +-AC_ARG_WITH(system_expat, +- AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library, see Doc/library/pyexpat.rst (default is no)]), ++AC_MSG_CHECKING(for --with-expat) ++AC_ARG_WITH(expat, ++ AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]), + [], +- [with_system_expat="no"]) ++ [with_expat="builtin"]) + +-AC_MSG_RESULT($with_system_expat) ++AC_MSG_RESULT($with_expat) ++ ++if test "$with_expat" != "none"; then ++ EXPAT=yes ++else ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat" ++ EXPAT=no ++fi ++AC_SUBST(EXPAT) + + # Check for use of the system libffi library + AC_MSG_CHECKING(for --with-system-ffi) +-- +2.30.2 diff --git a/packages/lang/Python3/patches/0017-Add-an-option-to-disable-CJK-codecs.patch b/packages/lang/Python3/patches/0017-Add-an-option-to-disable-CJK-codecs.patch new file mode 100644 index 0000000000..2afcf4526d --- /dev/null +++ b/packages/lang/Python3/patches/0017-Add-an-option-to-disable-CJK-codecs.patch @@ -0,0 +1,30 @@ +From 2c0d31bb91fc7f94283c3ab632925fbbe24e94d6 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:49:55 +0100 +Subject: [PATCH] Add an option to disable CJK codecs + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 9ef0ecd42f..18e6fd70a0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3390,6 +3390,12 @@ if test "$SQLITE3" = "no" ; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" + fi + ++AC_ARG_ENABLE(codecs-cjk, ++ AS_HELP_STRING([--disable-codecs-cjk], [disable CJK codecs]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0018-Add-an-option-to-disable-NIS.patch b/packages/lang/Python3/patches/0018-Add-an-option-to-disable-NIS.patch new file mode 100644 index 0000000000..d8fe3616c0 --- /dev/null +++ b/packages/lang/Python3/patches/0018-Add-an-option-to-disable-NIS.patch @@ -0,0 +1,33 @@ +From 2041d0c8dba87991edaf088b16e37b5189a3466d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:50:11 +0100 +Subject: [PATCH] Add an option to disable NIS + +NIS is not necessarily available in uClibc, so we need an option to +not compile support for it. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 18e6fd70a0..46d2a8131e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3396,6 +3396,12 @@ AC_ARG_ENABLE(codecs-cjk, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" + fi]) + ++AC_ARG_ENABLE(nis, ++ AS_HELP_STRING([--disable-nis], [disable NIS]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0019-Add-an-option-to-disable-unicodedata.patch b/packages/lang/Python3/patches/0019-Add-an-option-to-disable-unicodedata.patch new file mode 100644 index 0000000000..3519377b5e --- /dev/null +++ b/packages/lang/Python3/patches/0019-Add-an-option-to-disable-unicodedata.patch @@ -0,0 +1,30 @@ +From dd82a401ff6ba4ba116bf4d520e981a1808ed443 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:50:27 +0100 +Subject: [PATCH] Add an option to disable unicodedata + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 46d2a8131e..5844e3b73f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3402,6 +3402,12 @@ AC_ARG_ENABLE(nis, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" + fi]) + ++AC_ARG_ENABLE(unicodedata, ++ AS_HELP_STRING([--disable-unicodedata], [disable unicodedata]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch b/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch new file mode 100644 index 0000000000..08d733fb06 --- /dev/null +++ b/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch @@ -0,0 +1,92 @@ +From f1b15834045d0641c43014b970721df066fa71f7 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Feb 2017 17:45:14 -0800 +Subject: [PATCH] Add an option to disable IDLE + +IDLE is an IDE embedded into python, written using Tk, so it doesn't make +much sense to have it into our build. + +Signed-off-by: Maxime Ripard +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +[ Adam Duskett: ported to Python 3.10.0 ] +Signed-off-by: Adam Duskett +--- + Makefile.pre.in | 7 ++++++- + configure.ac | 6 ++++++ + setup.py | 5 ++++- + 3 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 08c5e8a..461c5e3 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1389,7 +1389,9 @@ bininstall: altbininstall + -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc) + -rm -f $(DESTDIR)$(BINDIR)/idle3 ++ifeq (@IDLE@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) ++endif + -rm -f $(DESTDIR)$(BINDIR)/pydoc3 + ifeq (@PYDOC@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) +@@ -1439,7 +1441,6 @@ LIBSUBDIRS= asyncio \ + ensurepip ensurepip/_bundled \ + html \ + http \ +- idlelib idlelib/Icons \ + importlib importlib/resources importlib/metadata \ + json \ + logging \ +@@ -1552,6 +1553,10 @@ ifeq (@EXPAT@,yes) + LIBSUBDIRS += $(XMLLIBSUBDIRS) + endif + ++ifeq (@IDLE@,yes) ++LIBSUBDIRS += idlelib idlelib/Icons ++endif ++ + TEST_MODULES=@TEST_MODULES@ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ +diff --git a/configure.ac b/configure.ac +index e99a174..baaa743 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6073,6 +6073,12 @@ AC_ARG_ENABLE(lib2to3, + AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), + [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) + ++AC_SUBST(IDLE) ++ ++AC_ARG_ENABLE(idle3, ++ AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]), ++ [ IDLE="${enableval}" ], [ IDLE=yes ]) ++ + # generate output files + AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) + AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) +diff --git a/setup.py b/setup.py +index e30ed52..4dff249 100644 +--- a/setup.py ++++ b/setup.py +@@ -2722,11 +2722,14 @@ def main(): + import warnings + warnings.filterwarnings("ignore",category=DeprecationWarning) + +- scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py'] ++ scripts = [ 'Lib/smtpd.py'] + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): + scripts += [ 'Tools/scripts/pydoc3' ] + if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"): + scripts += [ 'Tools/scripts/2to3' ] ++ if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"): ++ scripts += [ 'Tools/scripts/idle3' ] ++ + setup(# PyPI Metadata (PEP 301) + name = "Python", + version = sys.version.split()[0], +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch b/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch new file mode 100644 index 0000000000..dfe4ff9a6d --- /dev/null +++ b/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch @@ -0,0 +1,52 @@ +From d5fe81cbd51da2a84ed89d1e4c80d921d4efce26 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:51:31 +0100 +Subject: [PATCH] Add an option to disable decimal + +This patch replaces the existing --with-system-libmpdec option with a +--with-libmpdec={system,builtin,none} option, which allows to tell +Python whether we want to use the system libmpdec (already installed), +the libmpdec builtin the Python sources, or no libmpdec at all. + +Signed-off-by: Thomas Petazzoni +[aduskett@gmail.com: Update for python 3.7.0] +Signed-off-by: Adam Duskett +[james.hilliard1@gmail.com: adapt to python 3.9] +Signed-off-by: James Hilliard +--- + configure.ac | 17 ++++++++++++----- + setup.py | 2 +- + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7bd4623ccd..e513ef6a20 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3145,12 +3145,19 @@ fi + AC_SUBST(LIBFFI_INCLUDEDIR) + + # Check for use of the system libmpdec library +-AC_MSG_CHECKING(for --with-system-libmpdec) +-AC_ARG_WITH(system_libmpdec, +- AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library, see Doc/library/decimal.rst (default is no)]), ++AC_MSG_CHECKING(for --with-libmpdec) ++AC_ARG_WITH(libmpdec, ++ AS_HELP_STRING([--with-libmpdec], [select which libmpdec version to use: system, builtin, none]), + [], +- [with_system_libmpdec="no"]) ++ [with_libmpdec="builtin"]) +-AC_MSG_RESULT($with_system_libmpdec) ++AC_MSG_RESULT($with_libmpdec) ++if test "$with_libmpdec" != "none"; then ++ MPDEC=yes ++else ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _decimal" ++ MPDEC=no ++fi ++AC_SUBST(MPDEC) + + AS_VAR_IF([with_system_libmpdec], [yes], [ + LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""} +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch b/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch new file mode 100644 index 0000000000..d367cb4499 --- /dev/null +++ b/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch @@ -0,0 +1,30 @@ +From 9bedc56d2a4b8856162650a11c1fcb6ec38f160b Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:51:58 +0100 +Subject: [PATCH] Add an option to disable the ossaudiodev module + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index e513ef6a20..c07505e89e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3175,6 +3175,12 @@ fi + + AC_MSG_RESULT($with_decimal_contextvar) + ++AC_ARG_ENABLE(ossaudiodev, ++ AS_HELP_STRING([--disable-ossaudiodev], [disable OSSAUDIODEV]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ossaudiodev" ++ fi]) ++ + # Check for libmpdec machine flavor + AC_MSG_CHECKING(for decimal libmpdec machine) + AS_CASE([$ac_sys_system], +-- +2.25.1 + diff --git a/packages/lang/Python3/patches/0023-Add-an-option-to-disable-openssl-support.patch b/packages/lang/Python3/patches/0023-Add-an-option-to-disable-openssl-support.patch new file mode 100644 index 0000000000..4801a27300 --- /dev/null +++ b/packages/lang/Python3/patches/0023-Add-an-option-to-disable-openssl-support.patch @@ -0,0 +1,30 @@ +From 90ed5c692b8b5596ca0b3ae1436276c8181251d8 Mon Sep 17 00:00:00 2001 +From: Nicolas Cavallari +Date: Wed, 22 Feb 2017 17:55:59 -0800 +Subject: [PATCH] Add an option to disable openssl support. + +Signed-off-by: Nicolas Cavallari +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 08c148c..a81a24c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3421,6 +3421,12 @@ AC_ARG_ENABLE(unicodedata, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" + fi]) + ++AC_ARG_ENABLE(openssl, ++ AS_HELP_STRING([--disable-openssl], [disable openssl support]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0024-Add-an-option-to-disable-the-readline-module.patch b/packages/lang/Python3/patches/0024-Add-an-option-to-disable-the-readline-module.patch new file mode 100644 index 0000000000..adb04d69ea --- /dev/null +++ b/packages/lang/Python3/patches/0024-Add-an-option-to-disable-the-readline-module.patch @@ -0,0 +1,30 @@ +From 049e7a51e1ffd0d28d6608c707ab4b54e816d338 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Tue, 7 Mar 2017 23:29:05 +0100 +Subject: [PATCH] Add an option to disable the readline module + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index a81a24c..41a21ff 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3427,6 +3427,12 @@ AC_ARG_ENABLE(openssl, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" + fi]) + ++AC_ARG_ENABLE(readline, ++ AS_HELP_STRING([--disable-readline], [disable readline]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch b/packages/lang/Python3/patches/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch new file mode 100644 index 0000000000..d466bc3a76 --- /dev/null +++ b/packages/lang/Python3/patches/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch @@ -0,0 +1,42 @@ +From 146730a04dfe98e3d7971ebf5410801ceae88e11 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Tue, 7 Mar 2017 23:31:11 +0100 +Subject: [PATCH] Add options to disable zlib, bzip2 and xz modules + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 41a21ff..fa81bc7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3433,6 +3433,24 @@ AC_ARG_ENABLE(readline, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" + fi]) + ++AC_ARG_ENABLE(bzip2, ++ AS_HELP_STRING([--disable-bzip2], [disable bzip2]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _bz2" ++ fi]) ++ ++AC_ARG_ENABLE(zlib, ++ AS_HELP_STRING([--disable-zlib], [disable zlib]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} zlib" ++ fi]) ++ ++AC_ARG_ENABLE(xz, ++ AS_HELP_STRING([--disable-xz], [disable xz]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _lzma" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0026-python-config.sh-don-t-reassign-prefix.patch b/packages/lang/Python3/patches/0026-python-config.sh-don-t-reassign-prefix.patch new file mode 100644 index 0000000000..814a9d42e5 --- /dev/null +++ b/packages/lang/Python3/patches/0026-python-config.sh-don-t-reassign-prefix.patch @@ -0,0 +1,53 @@ +From 106d9378c61e7fa9cad0a63ba068668d54cd11b8 Mon Sep 17 00:00:00 2001 +From: Matt Weber +Date: Fri, 6 Oct 2017 09:54:15 -0500 +Subject: [PATCH] python-config.sh: don't reassign ${prefix} + +When prefix is set to a path like /usr during crossbuild +the sed operations end up executing twice, once for the prefix +reassignment and another for includedir if it is set as a string +including the ${prefix} variable. This results in an issue +when the build directory is under /usr. + +This patch updates the remaining location which uses the prefix +variable to also sed and update to use the real path. + +Upstream bug report: +https://bugs.python.org/issue31713 + +Buildroot bug: +https://bugs.busybox.net/show_bug.cgi?id=10361 + +Fixes failures like the following: +dbus-python-1.2.4 | NOK | http://autobuild.buildroot.net/results/758858efa97b6273c1b470513f5492258a6d8853 + +Signed-off-by: Matthew Weber +--- + Misc/python-config.sh.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index a1bc3cd..164d2d3 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -31,7 +31,7 @@ prefix_real=$(installed_prefix "$0") + # locations. Keep prefix & exec_prefix using their original values in case + # they are referenced in other configure variables, to prevent double + # substitution, issue #22140. +-prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") ++prefix=$prefix_build + exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") + exec_prefix_real=${prefix_real} + includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") +@@ -49,7 +49,7 @@ LDLIBRARY="@LDLIBRARY@" + OPT="@OPT@" + PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" + LDVERSION="@LDVERSION@" +-LIBDEST=${prefix_real}/lib/python${VERSION} ++LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#") + LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") + SO="@EXT_SUFFIX@" + PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0028-Add-an-option-to-disable-uuid-module.patch b/packages/lang/Python3/patches/0028-Add-an-option-to-disable-uuid-module.patch new file mode 100644 index 0000000000..fc4b64dc64 --- /dev/null +++ b/packages/lang/Python3/patches/0028-Add-an-option-to-disable-uuid-module.patch @@ -0,0 +1,33 @@ +From 3bb693408eda77dda145ec5fecee56ea73031e9f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 18 Aug 2018 10:54:56 +0200 +Subject: [PATCH] Add an option to disable uuid module + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index fa81bc7..4e733f6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3469,6 +3469,15 @@ if test "$CURSES" = "no"; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" + fi + ++AC_SUBST(UUID) ++AC_ARG_ENABLE(uuid, ++ AS_HELP_STRING([--disable-uuid], [disable uuid]), ++ [ UUID="${enableval}" ], [ UUID=yes ]) ++ ++if test "$UUID" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _uuid" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0030-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch b/packages/lang/Python3/patches/0030-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch new file mode 100644 index 0000000000..eff010fa22 --- /dev/null +++ b/packages/lang/Python3/patches/0030-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch @@ -0,0 +1,51 @@ +From d009b0142f77881dd75ff760fec728dbc8581a03 Mon Sep 17 00:00:00 2001 +From: Peter Korsgaard +Date: Fri, 2 Aug 2019 15:53:16 +0200 +Subject: [PATCH] configure.ac: fixup $CC --print-multiarch output for + musl/uclibc GCC 8+ toolchains + +GCC commit 6834b83784dcf0364eb820e8 (multiarch support for non-glibc linux +systems), which is part of GCC 8+, changed the multiarch logic to use +$arch-linux-musl / $arch-linux-uclibc rather than $arch-linux-gnu. + +This then causes the python3 configure script to error out: + +checking for the platform triplet based on compiler characteristics... powerpc-linux-gnu +configure: error: internal configure error for the platform triplet, please file a bug report + +http://autobuild.buildroot.net/results/cb4/cb49c539501342e45cbe5ade82e588fcdf51f05b + +As it requires that the --print-multiarch output (if not empty) matches the +deduced triplet (which always uses -linux-gnu). + +It isn't quite clear why --print-multiarch returns something for a +non-multiarch toolchain on some architectures (E.G. PowerPC), but as a +workaround, rewrite the --print-multiarch output to match older GCC versions +to keep the configure script happy. + +Signed-off-by: Peter Korsgaard +[Peter: updated for 3.10.2] +--- + configure.ac | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 913051c276..aba03f3779 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -876,7 +876,11 @@ AC_MSG_CHECKING([for multiarch]) + AS_CASE([$ac_sys_system], + [Darwin*], [MULTIARCH=""], + [FreeBSD*], [MULTIARCH=""], +- [MULTIARCH=$($CC --print-multiarch 2>/dev/null)] ++ [ ++ # GCC 8+ returns $arch-linux-{musl,uclibc} for musl/uClibc based ++ # toolchains confusing python. Fix that up ++ MULTIARCH=$($CC --print-multiarch 2>/dev/null | sed -E 's/-linux-(musl|uclibc)*$/-linux-gnu/') ++ ] + ) + AC_SUBST([MULTIARCH]) + AC_MSG_RESULT([$MULTIARCH]) +-- +2.20.1 + diff --git a/packages/lang/Python3/patches/0031-Add-an-option-to-disable-the-berkeleydb-module.patch b/packages/lang/Python3/patches/0031-Add-an-option-to-disable-the-berkeleydb-module.patch new file mode 100644 index 0000000000..0c0d51a7eb --- /dev/null +++ b/packages/lang/Python3/patches/0031-Add-an-option-to-disable-the-berkeleydb-module.patch @@ -0,0 +1,30 @@ +From cf4d7fd9f7cb6c1ced32ee323b2b5755640051b7 Mon Sep 17 00:00:00 2001 +From: Bernd Kuhls +Date: Sat, 11 Apr 2020 22:01:40 +0200 +Subject: [PATCH] Add an option to disable the berkeleydb module + +Signed-off-by: Bernd Kuhls +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 4e733f6..1e52f30 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3480,6 +3480,12 @@ if test "$UUID" = "no"; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _uuid" + fi + ++AC_ARG_ENABLE(berkeleydb, ++ AS_HELP_STRING([--disable-berkeleydb], [disable berkeleydb]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _dbm" ++ fi]) ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.30.2 + diff --git a/packages/lang/Python3/patches/0032-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch b/packages/lang/Python3/patches/0032-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch new file mode 100644 index 0000000000..0458283c18 --- /dev/null +++ b/packages/lang/Python3/patches/0032-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch @@ -0,0 +1,42 @@ +From 3c83eedcc2df3ecf6c4a17953ca24dff60c1378e Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Thu, 12 Nov 2020 00:16:18 +0100 +Subject: [PATCH] lib/crypt: uClibc-ng doesn't set errno when encryption method + is not available + +Since commit [1] in cpython, an exception is raised when an encryption method +is not available. This eception is handled only if errno is set to EINVAL by +crypt() but uClibc-ng doesn't set errno in crypt() [2]. + +Fixes: +https://gitlab.com/buildroot.org/buildroot/-/jobs/830981961 +https://gitlab.com/buildroot.org/buildroot/-/jobs/830981979 + +[1] https://github.com/python/cpython/commit/0d3fe8ae4961bf551e7d5e42559e2ede1a08fd7c +[2] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libcrypt/crypt.c?h=v1.0.36#n29 + +Signed-off-by: Romain Naour +[Daniel: updated for 3.10.7] +Signed-off-by: Daniel Lang +--- + Lib/crypt.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Lib/crypt.py b/Lib/crypt.py +index 33dbc46bb3..4692a5270c 100644 +--- a/Lib/crypt.py ++++ b/Lib/crypt.py +@@ -94,7 +94,9 @@ def _add_method(name, *args, rounds=None): + result = crypt('', salt) + except OSError as e: + # Not all libc libraries support all encryption methods. +- if e.errno in {errno.EINVAL, errno.EPERM, errno.ENOSYS}: ++ # Not all libc libraries set errno when encryption method is not ++ # available. ++ if e.errno in {errno.EINVAL, errno.EPERM, errno.ENOSYS} or e.errno == 0: + return False + raise + if result and len(result) == method.total_size: +-- +2.25.4 + diff --git a/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch b/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch deleted file mode 100644 index c5ad69f232..0000000000 --- a/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch +++ /dev/null @@ -1,1776 +0,0 @@ -From 586a67bb448290a98df45e9f61d803952d2aa761 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 16:21:31 -0800 -Subject: [PATCH] Make the build of pyc files conditional - -This commit adds a new configure option --disable-pyc-build to disable -the compilation of pyc. - -Signed-off-by: Thomas Petazzoni -[ Andrey Smrinov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 2 ++ - configure.ac | 6 ++++++ - 2 files changed, 8 insertions(+) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 502317aa0c..f9011c132a 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1549,6 +1549,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c - $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ - $(DESTDIR)$(LIBDEST)/distutils/tests ; \ - fi -+ifeq (@PYC_BUILD@,yes) - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ - -j0 -d $(LIBDEST) -f \ -@@ -1576,6 +1577,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c - $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ - -j0 -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -+endif - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -diff --git a/configure.ac b/configure.ac -index a189d42c2c..4690cdba9f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1128,6 +1128,12 @@ fi - - AC_MSG_CHECKING(LDLIBRARY) - -+AC_SUBST(PYC_BUILD) -+ -+AC_ARG_ENABLE(pyc-build, -+ AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]), -+ [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ]) -+ - # MacOSX framework builds need more magic. LDLIBRARY is the dynamic - # library that we build, but we do not want to link against it (we - # will find it with a -framework option). For this reason there is an --- -2.20.1 - -From 3b558cfb1670300afece09b957e1e4b7072bce6b Mon Sep 17 00:00:00 2001 -From: Vanya Sergeev -Date: Wed, 23 Dec 2015 11:30:33 +0100 -Subject: [PATCH] Disable buggy_getaddrinfo configure test when cross-compiling - with IPv6 support - -Signed-off-by: Vanya Sergeev ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 4690cdba9f..ffeec102b7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4222,7 +4222,7 @@ fi - - AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) - --if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes -+if test $have_getaddrinfo = no || test "$cross_compiling" != "yes" -a "$ac_cv_buggy_getaddrinfo" = yes - then - if test $ipv6 = yes - then --- -2.20.1 - -From 36c138c15515e80f72a570b61da324e55ae3e80c Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 16:33:22 -0800 -Subject: [PATCH] Add infrastructure to disable the build of certain extensions - -Some of the extensions part of the Python core have dependencies on -external libraries (sqlite, tk, etc.) or are relatively big and not -necessarly always useful (CJK codecs for example). By extensions, we -mean part of Python modules that are written in C and therefore -compiled to binary code. - -Therefore, we introduce a small infrastructure that allows to disable -some of those extensions. This can be done inside the configure.ac by -adding values to the DISABLED_EXTENSIONS variable (which is a -word-separated list of extensions). - -The implementation works as follow : - - * configure.ac defines a DISABLED_EXTENSIONS variable, which is - substituted (so that when Makefile.pre is generated from - Makefile.pre.in, the value of the variable is substituted). For - now, this DISABLED_EXTENSIONS variable is empty, later patches will - use it. - - * Makefile.pre.in passes the DISABLED_EXTENSIONS value down to the - variables passed in the environment when calling the setup.py - script that actually builds and installs those extensions. - - * setup.py is modified so that the existing "disabled_module_list" is - filled with those pre-disabled extensions listed in - DISABLED_EXTENSIONS. - -Patch ported to python2.7 by Maxime Ripard , and -then extended by Thomas Petazzoni -. - -Signed-off-by: Thomas Petazzoni -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 6 +++++- - configure.ac | 2 ++ - setup.py | 5 ++++- - 3 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index f9011c132a..e8a6bd5c03 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -215,6 +215,8 @@ FILEMODE= 644 - # configure script arguments - CONFIG_ARGS= @CONFIG_ARGS@ - -+# disabled extensions -+DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@ - - # Subdirectories with code - SRCDIRS= @SRCDIRS@ -@@ -631,6 +633,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o - esac; \ - echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ -+ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ - $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ -@@ -1695,7 +1698,8 @@ libainstall: @DEF_MAKE_RULE@ python-config - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ -+ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ -+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -diff --git a/configure.ac b/configure.ac -index ffeec102b7..7872b4dfee 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3093,6 +3093,8 @@ LIBS="$withval $LIBS" - - PKG_PROG_PKG_CONFIG - -+AC_SUBST(DISABLED_EXTENSIONS) -+ - # Check for use of the system expat library - AC_MSG_CHECKING(for --with-system-expat) - AC_ARG_WITH(system_expat, -diff --git a/setup.py b/setup.py -index 20d7f35652..d3f2cc1b37 100644 ---- a/setup.py -+++ b/setup.py -@@ -44,7 +44,10 @@ from distutils.spawn import find_executable - TEST_EXTENSIONS = True - - # This global variable is used to hold the list of modules to be disabled. --DISABLED_MODULE_LIST = [] -+try: -+ DISABLED_MODULE_LIST = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ") -+except KeyError: -+ DISABLED_MODULE_LIST = list() - - - def get_platform(): --- -2.20.1 - -From f5ed27c9b9efb4756630e5799be14fefdc3b2702 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:33:14 +0100 -Subject: [PATCH] Adjust library/header paths for cross-compilation - -When cross-compiling third-party extensions, the get_python_inc() or -get_python_lib() can be called, to return the path to headers or -libraries. However, they use the sys.prefix of the host Python, which -returns incorrect paths when cross-compiling (paths pointing to host -headers and libraries). - -In order to fix this, we introduce the _python_sysroot, _python_prefix -and _python_exec_prefix variables, that allow to override these -values, and get correct header/library paths when cross-compiling -third-party Python modules. - -Signed-off-by: Thomas Petazzoni ---- - Lib/distutils/command/build_ext.py | 5 ++++- - Lib/distutils/sysconfig.py | 15 +++++++++++---- - 2 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py -index 2d7cdf063f..cba150075c 100644 ---- a/Lib/distutils/command/build_ext.py -+++ b/Lib/distutils/command/build_ext.py -@@ -234,7 +234,10 @@ class build_ext(Command): - if (sysconfig.get_config_var('Py_ENABLE_SHARED')): - if not sysconfig.python_build: - # building third party extensions -- self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) -+ libdir = sysconfig.get_config_var('LIBDIR') -+ if "_python_sysroot" in os.environ: -+ libdir = os.environ.get("_python_sysroot") + libdir -+ self.library_dirs.append(libdir) - else: - # building python standard extensions - self.library_dirs.append('.') -diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index b51629eb94..011a437bcd 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -17,10 +17,17 @@ from .errors import DistutilsPlatformError - from .errors import DistutilsPlatformError - - # These are needed in a couple of spots, so just compute them once. --PREFIX = os.path.normpath(sys.prefix) --EXEC_PREFIX = os.path.normpath(sys.exec_prefix) --BASE_PREFIX = os.path.normpath(sys.base_prefix) --BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) -+if "_python_sysroot" in os.environ: -+ _sysroot=os.environ.get('_python_sysroot') -+ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix')) -+ EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix')) -+ BASE_PREFIX = PREFIX -+ BASE_EXEC_PREFIX = EXEC_PREFIX -+else: -+ PREFIX = os.path.normpath(sys.prefix) -+ EXEC_PREFIX = os.path.normpath(sys.exec_prefix) -+ BASE_PREFIX = os.path.normpath(sys.base_prefix) -+ BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) - - # Path to the base directory of the project. On Windows the binary may - # live in project/PCbuild/win32 or project/PCbuild/amd64. --- -2.20.1 - -From 5bcb991a8de2f1b9bdf44e78894417ed2ee137a5 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:36:00 +0100 -Subject: [PATCH] Don't look in /usr/lib/termcap for libraries - -Signed-off-by: Thomas Petazzoni ---- - setup.py | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/setup.py b/setup.py -index d3f2cc1b37..5d504d7638 100644 ---- a/setup.py -+++ b/setup.py -@@ -1047,12 +1047,9 @@ class PyBuildExt(build_ext): - pass # Issue 7384: Already linked against curses or tinfo. - elif curses_library: - readline_libs.append(curses_library) -- elif self.compiler.find_library_file(self.lib_dirs + -- ['/usr/lib/termcap'], -- 'termcap'): -+ elif self.compiler.find_library_file(self.lib_dirs, 'termcap'): - readline_libs.append('termcap') - self.add(Extension('readline', ['readline.c'], -- library_dirs=['/usr/lib/termcap'], - extra_link_args=readline_extra_link_args, - libraries=readline_libs)) - else: --- -2.20.1 - -From b878b174e12a5cb2e1943f1f79d94033c1ee80d7 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:36:27 +0100 -Subject: [PATCH] Don't add multiarch paths - -The add_multiarch_paths() function leads, in certain build -environments, to the addition of host header paths to the CFLAGS, -which is not appropriate for cross-compilation. This patch fixes that -by simply removing the call to add_multiarch_paths() when we're -cross-compiling. - -Investigation done by David . - -Signed-off-by: Thomas Petazzoni ---- - setup.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 5d504d7638..282a592dc6 100644 ---- a/setup.py -+++ b/setup.py -@@ -740,10 +740,10 @@ class PyBuildExt(build_ext): - 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') -+ self.add_multiarch_paths() - # only change this for cross builds for 3.3, issues on Mageia - if CROSS_COMPILING: - self.add_cross_compiling_paths() -- self.add_multiarch_paths() - self.add_ldflags_cppflags() - - def init_inc_lib_dirs(self): --- -2.20.1 - -From fceda5bae52571213b6671ce0220d1a85b38f8c7 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:43:24 +0100 -Subject: [PATCH] Abort on failed module build - -When building a Python module fails, the setup.py script currently -doesn't exit with an error, and simply continues. This is not a really -nice behavior, so this patch changes setup.py to abort with an error, -so that the build issue is clearly noticeable. - -Signed-off-by: Thomas Petazzoni ---- - setup.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/setup.py b/setup.py -index 282a592dc6..8fda3b4d47 100644 ---- a/setup.py -+++ b/setup.py -@@ -529,6 +529,7 @@ class PyBuildExt(build_ext): - print("Failed to build these modules:") - print_three_column(failed) - print() -+ sys.exit(1) - - if self.failed_on_import: - failed = self.failed_on_import[:] --- -2.20.1 - -From 91e8058cf9085795db64f43e2c9548926ea46ab0 Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Wed, 23 Dec 2015 11:44:02 +0100 -Subject: [PATCH] Serial ioctl() workaround - -The ioctls.h of some architectures (notably xtensa) references structs from -linux/serial.h. Make sure to include this header as well. - -Also, undef TIOCTTYGSTRUCT that require reference to internal kernel tty_struct, -but isn't actually referenced in modern kernels. - -Signed-off-by: Baruch Siach ---- - Modules/termios.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Modules/termios.c b/Modules/termios.c -index aee7f12c57..ba2ff77d06 100644 ---- a/Modules/termios.c -+++ b/Modules/termios.c -@@ -15,7 +15,9 @@ - #endif - - #include -+#include - #include -+#undef TIOCTTYGSTRUCT - - /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR, - * MDTR, MRI, and MRTS (apparently used internally by some things --- -2.20.1 - -From 3ec9bbf5bd9cced0005c99d7d65997b119abf2f6 Mon Sep 17 00:00:00 2001 -From: Christophe Vu-Brugier -Date: Wed, 23 Dec 2015 11:44:30 +0100 -Subject: [PATCH] Do not adjust the shebang of Python scripts for - cross-compilation - -The copy_scripts() method in distutils copies the scripts listed in -the setup file and adjusts the first line to refer to the current -Python interpreter. When cross-compiling, this means that the adjusted -shebang refers to the host Python interpreter. - -This patch modifies copy_scripts() to preserve the shebang when -cross-compilation is detected. - -Signed-off-by: Christophe Vu-Brugier ---- - Lib/distutils/command/build_scripts.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py -index ccc70e6465..d6d54195c1 100644 ---- a/Lib/distutils/command/build_scripts.py -+++ b/Lib/distutils/command/build_scripts.py -@@ -91,7 +91,7 @@ class build_scripts(Command): - adjust = True - post_interp = match.group(1) or b'' - -- if adjust: -+ if adjust and not '_python_sysroot' in os.environ: - log.info("copying and adjusting %s -> %s", script, - self.build_dir) - updated_files.append(outfile) --- -2.20.1 - -From 7b3839bcf9f79988fb944cd65717839cde166cb8 Mon Sep 17 00:00:00 2001 -From: Peter Korsgaard -Date: Thu, 20 Nov 2014 13:24:59 +0100 -Subject: [PATCH] Misc/python-config.sh.in: ensure sed invocations only match - beginning of strings - -The build/real prefix handling using sed breaks if build != real and the -standard include / lib directories are used ($prefix/include and $prefix/lib). - -E.G. - -prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include". - -If this gets installed with make DESTDIR="/foo" install, then we end up with -prefix_real = prefix = "/foo/usr" as expected, but -includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of -the double sed invocation (prefix is already expanded). Work around it by -ensuring we only match the beginning of the string. - -Submitted upstream: http://bugs.python.org/issue22907 - -Signed-off-by: Peter Korsgaard ---- - Misc/python-config.sh.in | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in -index 2602fe24c0..a1bc3cd5f7 100644 ---- a/Misc/python-config.sh.in -+++ b/Misc/python-config.sh.in -@@ -24,18 +24,19 @@ installed_prefix () - echo $RESULT - } - -+prefix_build="@prefix@" - prefix_real=$(installed_prefix "$0") - - # Use sed to fix paths from their built-to locations to their installed-to - # locations. Keep prefix & exec_prefix using their original values in case - # they are referenced in other configure variables, to prevent double - # substitution, issue #22140. --prefix="@prefix@" --exec_prefix="@exec_prefix@" -+prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") -+exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") - exec_prefix_real=${prefix_real} --includedir=$(echo "@includedir@" | sed "s#$prefix#$prefix_real#") --libdir=$(echo "@libdir@" | sed "s#$prefix#$prefix_real#") --CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix#$prefix_real#") -+includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") -+libdir=$(echo "@libdir@" | sed "s#^$prefix_build#$prefix_real#") -+CFLAGS=$(echo "@CFLAGS@" | sed "s#^$prefix_build#$prefix_real#") - VERSION="@VERSION@" - LIBM="@LIBM@" - LIBC="@LIBC@" -@@ -49,7 +50,7 @@ OPT="@OPT@" - PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" - LDVERSION="@LDVERSION@" - LIBDEST=${prefix_real}/lib/python${VERSION} --LIBPL=$(echo "@LIBPL@" | sed "s#$prefix#$prefix_real#") -+LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") - SO="@EXT_SUFFIX@" - PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" - INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" --- -2.20.1 - -From c50b8e7fb9b2e61d4d195a055cd1bbf993cc455f Mon Sep 17 00:00:00 2001 -From: Christophe Vu-Brugier -Date: Wed, 22 Feb 2017 16:48:49 -0800 -Subject: [PATCH] Add importlib fix for PEP 3147 issue - -Python 3 has a new standard for installing .pyc file, called PEP -3147. Unfortunately, this standard requires both the .py and .pyc -files to be installed for a Python module to be found. This is quite -annoying on space-constrained embedded systems, since the .py file is -technically not required for execution. - -This patch changes cache_from_source() and source_from_cache() in -importlib to get rid of the "__pycache__" directory. -This effectively disables PEP 3147 for: - -* The python standard library -* Packages built with distutils or setuptools -* Packages built with automake that use the `py-compile` helper - -Signed-off-by: Christophe Vu-Brugier -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Lib/importlib/_bootstrap_external.py | 44 ++++------------------------ - 1 file changed, 5 insertions(+), 39 deletions(-) - -diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py -index b8ac482994..db034f605a 100644 ---- a/Lib/importlib/_bootstrap_external.py -+++ b/Lib/importlib/_bootstrap_external.py -@@ -373,8 +373,6 @@ def cache_from_source(path, debug_override=None, *, optimization=None): - a True value is the same as setting 'optimization' to the empty string - while a False value is equivalent to setting 'optimization' to '1'. - -- If sys.implementation.cache_tag is None then NotImplementedError is raised. -- - """ - if debug_override is not None: - _warnings.warn('the debug_override parameter is deprecated; use ' -@@ -386,10 +384,7 @@ def cache_from_source(path, debug_override=None, *, optimization=None): - path = _os.fspath(path) - head, tail = _path_split(path) - base, sep, rest = tail.rpartition('.') -- tag = sys.implementation.cache_tag -- if tag is None: -- raise NotImplementedError('sys.implementation.cache_tag is None') -- almost_filename = ''.join([(base if base else rest), sep, tag]) -+ almost_filename = ''.join([(base if base else rest)]) - if optimization is None: - if sys.flags.optimize == 0: - optimization = '' -@@ -426,46 +421,17 @@ def cache_from_source(path, debug_override=None, *, optimization=None): - head.lstrip(path_separators), - filename, - ) -- return _path_join(head, _PYCACHE, filename) -+ return _path_join(head, filename) - - - def source_from_cache(path): - """Given the path to a .pyc. file, return the path to its .py file. - - The .pyc file does not need to exist; this simply returns the path to -- the .py file calculated to correspond to the .pyc file. If path does -- not conform to PEP 3147/488 format, ValueError will be raised. If -- sys.implementation.cache_tag is None then NotImplementedError is raised. -- -+ the .py file calculated to correspond to the .pyc file. - """ -- if sys.implementation.cache_tag is None: -- raise NotImplementedError('sys.implementation.cache_tag is None') -- path = _os.fspath(path) -- head, pycache_filename = _path_split(path) -- found_in_pycache_prefix = False -- if sys.pycache_prefix is not None: -- stripped_path = sys.pycache_prefix.rstrip(path_separators) -- if head.startswith(stripped_path + path_sep): -- head = head[len(stripped_path):] -- found_in_pycache_prefix = True -- if not found_in_pycache_prefix: -- head, pycache = _path_split(head) -- if pycache != _PYCACHE: -- raise ValueError(f'{_PYCACHE} not bottom-level directory in ' -- f'{path!r}') -- dot_count = pycache_filename.count('.') -- if dot_count not in {2, 3}: -- raise ValueError(f'expected only 2 or 3 dots in {pycache_filename!r}') -- elif dot_count == 3: -- optimization = pycache_filename.rsplit('.', 2)[-2] -- if not optimization.startswith(_OPT): -- raise ValueError("optimization portion of filename does not start " -- f"with {_OPT!r}") -- opt_level = optimization[len(_OPT):] -- if not opt_level.isalnum(): -- raise ValueError(f"optimization level {optimization!r} is not an " -- "alphanumeric value") -- base_filename = pycache_filename.partition('.')[0] -+ head, filename = _path_split(path) -+ base_filename = filename.partition('.')[0] - return _path_join(head, base_filename + SOURCE_SUFFIXES[0]) - - --- -2.20.1 - -From 5ee3e5ad62919c431b1f7b5ff91ddf606582df0e Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:01:18 -0800 -Subject: [PATCH] Add an option to disable installation of test modules - -The Python standard distribution comes with many test modules, that -are not necessarly useful on embedded targets. - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov -[james.hilliard1@gmail.com: adapt to python 3.9] -Signed-off-by: James Hilliard ---- - Makefile.pre.in | 56 ++++++++++++++++++++++++++++++++----------------- - configure.ac | 5 +++++ - 2 files changed, 42 insertions(+), 19 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index e8a6bd5c03..3abee36f49 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1405,8 +1405,29 @@ maninstall: altmaninstall - - # Install the library - XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax --LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ -- tkinter/test/test_ttk site-packages test \ -+ -+LIBSUBDIRS= tkinter site-packages \ -+ asyncio \ -+ collections concurrent concurrent/futures encodings \ -+ email email/mime \ -+ ensurepip ensurepip/_bundled \ -+ html json http dbm xmlrpc \ -+ sqlite3 \ -+ logging csv wsgiref urllib \ -+ lib2to3 lib2to3/fixes lib2to3/pgen2 \ -+ ctypes ctypes/macholib \ -+ idlelib idlelib/Icons \ -+ distutils distutils/command $(XMLLIBSUBDIRS) \ -+ importlib \ -+ turtledemo \ -+ multiprocessing multiprocessing/dummy \ -+ unittest \ -+ venv venv/scripts venv/scripts/common venv/scripts/posix \ -+ curses pydoc_data \ -+ zoneinfo -+ -+TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ -+ tkinter/test/test_ttk test \ - test/audiodata \ - test/capath test/data \ - test/cjkencodings test/decimaltestdata \ -@@ -1467,28 +1488,25 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ - test/test_importlib/zipdata02 \ - test/test_zoneinfo test/test_zoneinfo/data \ - test/ziptestdata \ -- asyncio \ - test/test_asyncio \ -- collections concurrent concurrent/futures encodings \ -- email email/mime test/test_email test/test_email/data \ -- ensurepip ensurepip/_bundled \ -- html json test/test_json http dbm xmlrpc \ -- sqlite3 sqlite3/test \ -- logging csv wsgiref urllib \ -- lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ -+ test/test_email test/test_email/data \ -+ test/test_json \ -+ sqlite3/test \ -+ lib2to3/tests \ - lib2to3/tests/data lib2to3/tests/data/fixers \ - lib2to3/tests/data/fixers/myfixes \ -- ctypes ctypes/test ctypes/macholib \ -- idlelib idlelib/Icons idlelib/idle_test \ -- distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ -+ ctypes/test \ -+ idlelib/idle_test \ -+ distutils/tests \ - test/test_peg_generator \ -+ test/test_importlib test/test_importlib/builtin \ - test/test_tools test/test_warnings test/test_warnings/data \ -- turtledemo \ -- multiprocessing multiprocessing/dummy \ -- unittest unittest/test unittest/test/testmock \ -- venv venv/scripts venv/scripts/common venv/scripts/posix \ -- curses pydoc_data \ -- zoneinfo -+ unittest/test unittest/test/testmock -+ -+ifeq (@TEST_MODULES@,yes) -+LIBSUBDIRS += $(TESTSUBDIRS) -+endif -+ - libinstall: build_all $(srcdir)/Modules/xxmodule.c - @for i in $(SCRIPTDIR) $(LIBDEST); \ - do \ -diff --git a/configure.ac b/configure.ac -index 7872b4dfee..b820d18c7c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3370,6 +3370,11 @@ if test "$posix_threads" = "yes"; then - AC_CHECK_FUNCS(pthread_getcpuclockid) - fi - -+AC_SUBST(TEST_MODULES) -+ -+AC_ARG_ENABLE(test-modules, -+ AS_HELP_STRING([--disable-test-modules], [disable test modules]), -+ [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) - - # Check for enable-ipv6 - AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) --- -2.20.1 - -From 13a8be57e79f2657c75391bfa524dc1ba4993b02 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:07:56 -0800 -Subject: [PATCH] Add an option to disable pydoc - -It removes 0.5 MB of data from the target plus the pydoc script -itself. - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 8 +++++++- - configure.ac | 6 ++++++ - setup.py | 9 +++++++-- - 3 files changed, 20 insertions(+), 3 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 3abee36f49..6fa0549a56 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1373,7 +1373,9 @@ bininstall: altbininstall - -rm -f $(DESTDIR)$(BINDIR)/idle3 - (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) - -rm -f $(DESTDIR)$(BINDIR)/pydoc3 -+ifeq (@PYDOC@,yes) - (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) -+endif - -rm -f $(DESTDIR)$(BINDIR)/2to3 - (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) - if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ -@@ -1423,7 +1425,7 @@ LIBSUBDIRS= tkinter site-packages \ - multiprocessing multiprocessing/dummy \ - unittest \ - venv venv/scripts venv/scripts/common venv/scripts/posix \ -- curses pydoc_data \ -+ curses \ - zoneinfo - - TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ -@@ -1507,6 +1509,10 @@ ifeq (@TEST_MODULES@,yes) - LIBSUBDIRS += $(TESTSUBDIRS) - endif - -+ifeq (@PYDOC@,yes) -+LIBSUBDIRS += pydoc_data -+endif -+ - libinstall: build_all $(srcdir)/Modules/xxmodule.c - @for i in $(SCRIPTDIR) $(LIBDEST); \ - do \ -diff --git a/configure.ac b/configure.ac -index b820d18c7c..f53cc86d89 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3370,6 +3370,12 @@ if test "$posix_threads" = "yes"; then - AC_CHECK_FUNCS(pthread_getcpuclockid) - fi - -+AC_SUBST(PYDOC) -+ -+AC_ARG_ENABLE(pydoc, -+ AS_HELP_STRING([--disable-pydoc], [disable pydoc]), -+ [ PYDOC="${enableval}" ], [ PYDOC=yes ]) -+ - AC_SUBST(TEST_MODULES) - - AC_ARG_ENABLE(test-modules, -diff --git a/setup.py b/setup.py -index bb7eb44213..748c269960 100644 ---- a/setup.py -+++ b/setup.py -@@ -2572,6 +2572,12 @@ def main(): - # turn off warnings when deprecated modules are imported - import warnings - warnings.filterwarnings("ignore",category=DeprecationWarning) -+ -+ scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3', -+ 'Lib/smtpd.py'] -+ if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): -+ scripts += [ 'Tools/scripts/pydoc3' ] -+ - setup(# PyPI Metadata (PEP 301) - name = "Python", - version = sys.version.split()[0], -@@ -2596,8 +2602,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", -- "Tools/scripts/2to3"] -+ scripts = scripts - ) - - # --install-platlib --- -2.20.1 - -From 868823f15bab031caf05dc5e8ce2eac076bfc82b Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:15:31 -0800 -Subject: [PATCH] Add an option to disable lib2to3 - -lib2to3 is a library to convert Python 2.x code to Python 3.x. As -such, it is probably not very useful on embedded system targets. - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 16 ++++++++++++---- - configure.ac | 6 ++++++ - setup.py | 5 +++-- - 3 files changed, 21 insertions(+), 6 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 6fa0549a56..3e1f130532 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1377,7 +1377,9 @@ ifeq (@PYDOC@,yes) - (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) - endif - -rm -f $(DESTDIR)$(BINDIR)/2to3 -+ifeq (@LIB2TO3@,yes) - (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) -+endif - if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ - rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \ - (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \ -@@ -1416,7 +1418,6 @@ LIBSUBDIRS= tkinter site-packages \ - html json http dbm xmlrpc \ - sqlite3 \ - logging csv wsgiref urllib \ -- lib2to3 lib2to3/fixes lib2to3/pgen2 \ - ctypes ctypes/macholib \ - idlelib idlelib/Icons \ - distutils distutils/command $(XMLLIBSUBDIRS) \ -@@ -1494,9 +1495,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ - test/test_email test/test_email/data \ - test/test_json \ - sqlite3/test \ -- lib2to3/tests \ -- lib2to3/tests/data lib2to3/tests/data/fixers \ -- lib2to3/tests/data/fixers/myfixes \ - ctypes/test \ - idlelib/idle_test \ - distutils/tests \ -@@ -1505,6 +1503,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ - test/test_tools test/test_warnings test/test_warnings/data \ - unittest/test unittest/test/testmock - -+ifeq (@LIB2TO3@,yes) -+LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 -+TESTSUBDIRS += lib2to3/tests \ -+ lib2to3/tests/data \ -+ lib2to3/tests/data/fixers \ -+ lib2to3/tests/data/fixers/myfixes -+endif -+ - ifeq (@TEST_MODULES@,yes) - LIBSUBDIRS += $(TESTSUBDIRS) - endif -@@ -1605,10 +1611,12 @@ ifeq (@PYC_BUILD@,yes) - -j0 -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - endif -+ifeq (@LIB2TO3@,yes) - -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 -+endif - - # bpo-21536: Misc/python-config.sh is generated in the build directory - # from $(srcdir)Misc/python-config.sh.in. -diff --git a/configure.ac b/configure.ac -index f53cc86d89..caa8eaf88a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3382,6 +3382,12 @@ AC_ARG_ENABLE(test-modules, - AS_HELP_STRING([--disable-test-modules], [disable test modules]), - [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) - -+AC_SUBST(LIB2TO3) -+ -+AC_ARG_ENABLE(lib2to3, -+ AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), -+ [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) -+ - # Check for enable-ipv6 - AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) - AC_MSG_CHECKING([if --enable-ipv6 is specified]) -diff --git a/setup.py b/setup.py -index 748c269960..1669797cad 100644 ---- a/setup.py -+++ b/setup.py -@@ -2573,10 +2573,11 @@ def main(): - import warnings - warnings.filterwarnings("ignore",category=DeprecationWarning) - -- scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3', -- 'Lib/smtpd.py'] -+ scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py'] - if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): - scripts += [ 'Tools/scripts/pydoc3' ] -+ if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"): -+ scripts += [ 'Tools/scripts/2to3' ] - - setup(# PyPI Metadata (PEP 301) - name = "Python", --- -2.20.1 - -From 1a1d13a973d9dcbd6660bfef40cf35c7638f779b Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:20:45 -0800 -Subject: [PATCH] Add option to disable the sqlite3 module - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 7 +++++-- - configure.ac | 9 +++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 3e1f130532..cf9add0bc7 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1416,7 +1416,6 @@ LIBSUBDIRS= tkinter site-packages \ - email email/mime \ - ensurepip ensurepip/_bundled \ - html json http dbm xmlrpc \ -- sqlite3 \ - logging csv wsgiref urllib \ - ctypes ctypes/macholib \ - idlelib idlelib/Icons \ -@@ -1494,7 +1493,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ - test/test_asyncio \ - test/test_email test/test_email/data \ - test/test_json \ -- sqlite3/test \ - ctypes/test \ - idlelib/idle_test \ - distutils/tests \ -@@ -1511,6 +1509,11 @@ TESTSUBDIRS += lib2to3/tests \ - lib2to3/tests/data/fixers/myfixes - endif - -+ifeq (@SQLITE3@,yes) -+LIBSUBDIRS += sqlite3 -+TESTSUBDIRS += sqlite3/test -+endif -+ - ifeq (@TEST_MODULES@,yes) - LIBSUBDIRS += $(TESTSUBDIRS) - endif -diff --git a/configure.ac b/configure.ac -index caa8eaf88a..79a8255f44 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3370,6 +3370,15 @@ if test "$posix_threads" = "yes"; then - AC_CHECK_FUNCS(pthread_getcpuclockid) - fi - -+AC_SUBST(SQLITE3) -+AC_ARG_ENABLE(sqlite3, -+ AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]), -+ [ SQLITE3="${enableval}" ], [ SQLITE3=yes ]) -+ -+if test "$SQLITE3" = "no" ; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" -+fi -+ - AC_SUBST(PYDOC) - - AC_ARG_ENABLE(pydoc, --- -2.20.1 - -From c54cb57b3bd80fa2819f6409d5d2b98d82fbfcb2 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:23:42 -0800 -Subject: [PATCH] Add an option to disable the tk module - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 11 ++++++++--- - configure.ac | 9 +++++++++ - 2 files changed, 17 insertions(+), 3 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index cf9add0bc7..5d78419fd4 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1410,7 +1410,7 @@ maninstall: altmaninstall - # Install the library - XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax - --LIBSUBDIRS= tkinter site-packages \ -+LIBSUBDIRS= site-packages \ - asyncio \ - collections concurrent concurrent/futures encodings \ - email email/mime \ -@@ -1428,8 +1428,7 @@ LIBSUBDIRS= tkinter site-packages \ - curses \ - zoneinfo - --TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ -- tkinter/test/test_ttk test \ -+TESTSUBDIRS= test \ - test/audiodata \ - test/capath test/data \ - test/cjkencodings test/decimaltestdata \ -@@ -1501,6 +1502,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ - test/test_tools test/test_warnings test/test_warnings/data \ - unittest/test unittest/test/testmock - -+ifeq (@TK@,yes) -+LIBSUBDIRS += tkinter -+TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ -+ tkinter/test/test_ttk -+endif -+ - ifeq (@LIB2TO3@,yes) - LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 - TESTSUBDIRS += lib2to3/tests \ -diff --git a/configure.ac b/configure.ac -index 79a8255f44..b5922451cc 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3379,6 +3379,15 @@ if test "$SQLITE3" = "no" ; then - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" - fi - -+AC_SUBST(TK) -+AC_ARG_ENABLE(tk, -+ AS_HELP_STRING([--disable-tk], [disable tk]), -+ [ TK="${enableval}" ], [ TK=yes ]) -+ -+if test "$TK" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" -+fi -+ - AC_SUBST(PYDOC) - - AC_ARG_ENABLE(pydoc, --- -2.20.1 - -From 332373ca25f2dbe5473330666ec49143506a4dc0 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:31:51 -0800 -Subject: [PATCH] Add an option to disable the curses module - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 5 ++++- - configure.ac | 9 +++++++++ - 2 files changed, 13 insertions(+), 1 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 5d78419fd4..660c292765 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1425,7 +1425,6 @@ LIBSUBDIRS= site-packages \ - multiprocessing multiprocessing/dummy \ - unittest \ - venv venv/scripts venv/scripts/common venv/scripts/posix \ -- curses \ - zoneinfo - - TESTSUBDIRS= test \ -@@ -1506,6 +1505,10 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ - tkinter/test/test_ttk - endif - -+ifeq (@CURSES@,yes) -+LIBSUBDIRS += curses -+endif -+ - ifeq (@LIB2TO3@,yes) - LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 - TESTSUBDIRS += lib2to3/tests \ -diff --git a/configure.ac b/configure.ac -index b5922451cc..ea422a86a9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3388,6 +3388,15 @@ if test "$TK" = "no"; then - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" - fi - -+AC_SUBST(CURSES) -+AC_ARG_ENABLE(curses, -+ AS_HELP_STRING([--disable-curses], [disable curses]), -+ [ CURSES="${enableval}" ], [ CURSES=yes ]) -+ -+if test "$CURSES" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" -+fi -+ - AC_SUBST(PYDOC) - - AC_ARG_ENABLE(pydoc, --- -2.20.1 - -From d88f2d3430bbbe285ae3de5fbc1bde34da7f0478 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 22 Feb 2017 17:40:45 -0800 -Subject: [PATCH] Add an option to disable expat - -This patch replaces the existing --with-system-expat option with a ---with-expat={system,builtin,none} option, which allows to tell Python -whether we want to use the system expat (already installed), the expat -builtin the Python sources, or no expat at all (which disables the -installation of XML modules). - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Samuel Martin -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 6 +++++- - configure.ac | 18 +++++++++++++----- - setup.py | 2 +- - 3 files changed, 19 insertions(+), 7 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 660c292765..f49abf8395 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1419,7 +1419,7 @@ LIBSUBDIRS= site-packages \ - logging csv wsgiref urllib \ - ctypes ctypes/macholib \ - idlelib idlelib/Icons \ -- distutils distutils/command $(XMLLIBSUBDIRS) \ -+ distutils distutils/command \ - importlib \ - turtledemo \ - multiprocessing multiprocessing/dummy \ -@@ -1509,6 +1509,10 @@ ifeq (@CURSES@,yes) - LIBSUBDIRS += curses - endif - -+ifeq (@EXPAT@,yes) -+LIBSUBDIRS += $(XMLLIBSUBDIRS) -+endif -+ - ifeq (@LIB2TO3@,yes) - LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 - TESTSUBDIRS += lib2to3/tests \ -diff --git a/configure.ac b/configure.ac -index ea422a86a9..3c1e2c088d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3096,13 +3096,21 @@ PKG_PROG_PKG_CONFIG - AC_SUBST(DISABLED_EXTENSIONS) - - # Check for use of the system expat library --AC_MSG_CHECKING(for --with-system-expat) --AC_ARG_WITH(system_expat, -- AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library, see Doc/library/pyexpat.rst (default is no)]), -+AC_MSG_CHECKING(for --with-expat) -+AC_ARG_WITH(expat, -+ AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]), - [], -- [with_system_expat="no"]) -+ [with_expat="builtin"]) - --AC_MSG_RESULT($with_system_expat) -+AC_MSG_RESULT($with_expat) -+ -+if test "$with_expat" != "none"; then -+ EXPAT=yes -+else -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat" -+ EXPAT=no -+fi -+AC_SUBST(EXPAT) - - # Check for use of the system libffi library - AC_MSG_CHECKING(for --with-system-ffi) -diff --git a/setup.py b/setup.py -index 1669797cad..d2727c0da5 100644 ---- a/setup.py -+++ b/setup.py -@@ -1674,7 +1674,7 @@ class PyBuildExt(build_ext): - # - # More information on Expat can be found at www.libexpat.org. - # -- if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"): -+ if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"): - expat_inc = [] - define_macros = [] - extra_compile_args = [] --- -2.20.1 - -From 347f359b484c8e34b49f71132701252b966d93aa Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:49:55 +0100 -Subject: [PATCH] Add an option to disable CJK codecs - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 3c1e2c088d..30a92f9c2e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3387,6 +3387,12 @@ if test "$SQLITE3" = "no" ; then - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" - fi - -+AC_ARG_ENABLE(codecs-cjk, -+ AS_HELP_STRING([--disable-codecs-cjk], [disable CJK codecs]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" -+ fi]) -+ - AC_SUBST(TK) - AC_ARG_ENABLE(tk, - AS_HELP_STRING([--disable-tk], [disable tk]), --- -2.20.1 - -From ff9bebed083c5d20fe31f94b868f6f1a8c6cc744 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:50:11 +0100 -Subject: [PATCH] Add an option to disable NIS - -NIS is not necessarily available in uClibc, so we need an option to -not compile support for it. - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 30a92f9c2e..20f326db46 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3393,6 +3393,12 @@ AC_ARG_ENABLE(codecs-cjk, - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" - fi]) - -+AC_ARG_ENABLE(nis, -+ AS_HELP_STRING([--disable-nis], [disable NIS]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" -+ fi]) -+ - AC_SUBST(TK) - AC_ARG_ENABLE(tk, - AS_HELP_STRING([--disable-tk], [disable tk]), --- -2.20.1 - -From 47f9caca90e6c8c18736e5dfd0acf47aae27eefb Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:50:27 +0100 -Subject: [PATCH] Add an option to disable unicodedata - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 20f326db46..99bbc37b07 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3399,6 +3399,12 @@ AC_ARG_ENABLE(nis, - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" - fi]) - -+AC_ARG_ENABLE(unicodedata, -+ AS_HELP_STRING([--disable-unicodedata], [disable unicodedata]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" -+ fi]) -+ - AC_SUBST(TK) - AC_ARG_ENABLE(tk, - AS_HELP_STRING([--disable-tk], [disable tk]), --- -2.20.1 - -From c3ad1d6fc8f1fa56ee0522389227454710bf7877 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 22 Feb 2017 17:45:14 -0800 -Subject: [PATCH] Add an option to disable IDLE - -IDLE is an IDE embedded into python, written using Tk, so it doesn't make -much sense to have it into our build. - -Signed-off-by: Maxime Ripard -[ Andrey Smirnov: ported to Python 3.6 ] -Signed-off-by: Andrey Smirnov ---- - Makefile.pre.in | 7 ++++++- - configure.ac | 6 ++++++ - setup.py | 4 +++- - 3 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index f49abf8395..bc777e6504 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1371,7 +1371,9 @@ bininstall: altbininstall - -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc - (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc) - -rm -f $(DESTDIR)$(BINDIR)/idle3 -+ifeq (@IDLE@,yes) - (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) -+endif - -rm -f $(DESTDIR)$(BINDIR)/pydoc3 - ifeq (@PYDOC@,yes) - (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) -@@ -1418,7 +1420,6 @@ LIBSUBDIRS= site-packages \ - html json http dbm xmlrpc \ - logging csv wsgiref urllib \ - ctypes ctypes/macholib \ -- idlelib idlelib/Icons \ - distutils distutils/command \ - importlib \ - turtledemo \ -@@ -1513,6 +1514,10 @@ ifeq (@EXPAT@,yes) - LIBSUBDIRS += $(XMLLIBSUBDIRS) - endif - -+ifeq (@IDLE@,yes) -+LIBSUBDIRS += idlelib idlelib/Icons -+endif -+ - ifeq (@LIB2TO3@,yes) - LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 - TESTSUBDIRS += lib2to3/tests \ -diff --git a/configure.ac b/configure.ac -index 99bbc37b07..8c9706582e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3441,6 +3441,12 @@ AC_ARG_ENABLE(lib2to3, - AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), - [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) - -+AC_SUBST(IDLE) -+ -+AC_ARG_ENABLE(idle3, -+ AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]), -+ [ IDLE="${enableval}" ], [ IDLE=yes ]) -+ - # Check for enable-ipv6 - AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) - AC_MSG_CHECKING([if --enable-ipv6 is specified]) -diff --git a/setup.py b/setup.py -index d2727c0da5..9f09b3d985 100644 ---- a/setup.py -+++ b/setup.py -@@ -2573,11 +2573,13 @@ def main(): - import warnings - warnings.filterwarnings("ignore",category=DeprecationWarning) - -- scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py'] -+ scripts = [ 'Lib/smtpd.py'] - if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): - scripts += [ 'Tools/scripts/pydoc3' ] - if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"): - scripts += [ 'Tools/scripts/2to3' ] -+ if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"): -+ scripts += [ 'Tools/scripts/idle3' ] - - setup(# PyPI Metadata (PEP 301) - name = "Python", --- -2.20.1 - -From c82efeabd2f9b89ff2ecd5261eceeeb3af022ae8 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:51:31 +0100 -Subject: [PATCH] Add an option to disable decimal - -This patch replaces the existing --with-system-libmpdec option with a ---with-libmpdec={system,builtin,none} option, which allows to tell -Python whether we want to use the system libmpdec (already installed), -the libmpdec builtin the Python sources, or no libmpdec at all. - -Signed-off-by: Thomas Petazzoni -[aduskett@gmail.com: Update for python 3.7.0] -Signed-off-by: Adam Duskett ---- - configure.ac | 17 ++++++++++++----- - setup.py | 2 +- - 2 files changed, 13 insertions(+), 6 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 8c9706582e..e6255babb6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3147,13 +3147,20 @@ fi - AC_SUBST(LIBFFI_INCLUDEDIR) - - # Check for use of the system libmpdec library --AC_MSG_CHECKING(for --with-system-libmpdec) --AC_ARG_WITH(system_libmpdec, -- AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library, see Doc/library/decimal.rst (default is no)]), -+AC_MSG_CHECKING(for --with-libmpdec) -+AC_ARG_WITH(libmpdec, -+ AS_HELP_STRING([--with-libmpdec], [select which libmpdec version to use: system, builtin, none]), - [], -- [with_system_libmpdec="no"]) -+ [with_libmpdec="builtin"]) - --AC_MSG_RESULT($with_system_libmpdec) -+AC_MSG_RESULT($with_libmpdec) -+if test "$with_libmpdec" != "none"; then -+ MPDEC=yes -+else -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _decimal" -+ MPDEC=no -+fi -+AC_SUBST(MPDEC) - - # Check whether _decimal should use a coroutine-local or thread-local context - AC_MSG_CHECKING(for --with-decimal-contextvar) -diff --git a/setup.py b/setup.py -index 9f09b3d985..a7f2e23d87 100644 ---- a/setup.py -+++ b/setup.py -@@ -2202,7 +2202,7 @@ class PyBuildExt(build_ext): - # Stefan Krah's _decimal module - extra_compile_args = [] - undef_macros = [] -- if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): -+ if '--with-libmpdec=system' in sysconfig.get_config_var("CONFIG_ARGS"): - include_dirs = [] - libraries = [':libmpdec.so.2'] - sources = ['_decimal/_decimal.c'] --- -2.20.1 - -From c68234aba844cb1034fdcfb50aef03da454723f9 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Wed, 23 Dec 2015 11:51:58 +0100 -Subject: [PATCH] Add an option to disable the ossaudiodev module - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/configure.ac b/configure.ac -index e6255babb6..5809233aac 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3177,6 +3177,12 @@ fi - - AC_MSG_RESULT($with_decimal_contextvar) - -+AC_ARG_ENABLE(ossaudiodev, -+ AS_HELP_STRING([--disable-ossaudiodev], [disable OSSAUDIODEV]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ossaudiodev" -+ fi]) -+ - # Check for support for loadable sqlite extensions - AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions) - AC_ARG_ENABLE(loadable-sqlite-extensions, --- -2.20.1 - -From 8faf197969bf531279d5c59a5bb2bc3a21acc378 Mon Sep 17 00:00:00 2001 -From: Nicolas Cavallari -Date: Wed, 22 Feb 2017 17:55:59 -0800 -Subject: [PATCH] Add an option to disable openssl support. - -Signed-off-by: Nicolas Cavallari ---- - configure.ac | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 5809233aac..6b09bafda4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3418,6 +3418,12 @@ AC_ARG_ENABLE(unicodedata, - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" - fi]) - -+AC_ARG_ENABLE(openssl, -+ AS_HELP_STRING([--disable-openssl], [disable openssl support]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" -+ fi]) -+ - AC_SUBST(TK) - AC_ARG_ENABLE(tk, - AS_HELP_STRING([--disable-tk], [disable tk]), --- -2.20.1 - -From 6e3923f90497ba7230b62fdd3f2dca1cb79852bf Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Tue, 7 Mar 2017 23:29:05 +0100 -Subject: [PATCH] Add an option to disable the readline module - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 6b09bafda4..b64518eed5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3424,6 +3424,12 @@ AC_ARG_ENABLE(openssl, - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" - fi]) - -+AC_ARG_ENABLE(readline, -+ AS_HELP_STRING([--disable-readline], [disable readline]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" -+ fi]) -+ - AC_SUBST(TK) - AC_ARG_ENABLE(tk, - AS_HELP_STRING([--disable-tk], [disable tk]), --- -2.20.1 - -From e6f44f93db96ed7f3b2baa0e09ea32a32c78c638 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Tue, 7 Mar 2017 23:31:11 +0100 -Subject: [PATCH] Add options to disable zlib, bzip2 and xz modules - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/configure.ac b/configure.ac -index b64518eed5..d07e371c57 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3430,6 +3430,24 @@ AC_ARG_ENABLE(readline, - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" - fi]) - -+AC_ARG_ENABLE(bzip2, -+ AS_HELP_STRING([--disable-bzip2], [disable bzip2]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _bz2" -+ fi]) -+ -+AC_ARG_ENABLE(zlib, -+ AS_HELP_STRING([--disable-zlib], [disable zlib]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} zlib" -+ fi]) -+ -+AC_ARG_ENABLE(xz, -+ AS_HELP_STRING([--disable-xz], [disable xz]), -+ [ if test "$enableval" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _lzma" -+ fi]) -+ - AC_SUBST(TK) - AC_ARG_ENABLE(tk, - AS_HELP_STRING([--disable-tk], [disable tk]), --- -2.20.1 - -From e3221e3b714374e1e53dc11c9556733bd2807c2c Mon Sep 17 00:00:00 2001 -From: Matt Weber -Date: Fri, 6 Oct 2017 09:54:15 -0500 -Subject: [PATCH] python-config.sh: don't reassign ${prefix} - -When prefix is set to a path like /usr during crossbuild -the sed operations end up executing twice, once for the prefix -reassignment and another for includedir if it is set as a string -including the ${prefix} variable. This results in an issue -when the build directory is under /usr. - -This patch updates the remaining location which uses the prefix -variable to also sed and update to use the real path. - -Upstream bug report: -https://bugs.python.org/issue31713 - -Buildroot bug: -https://bugs.busybox.net/show_bug.cgi?id=10361 - -Fixes failures like the following: -dbus-python-1.2.4 | NOK | http://autobuild.buildroot.net/results/758858efa97b6273c1b470513f5492258a6d8853 - -Signed-off-by: Matthew Weber ---- - Misc/python-config.sh.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in -index a1bc3cd5f7..164d2d3603 100644 ---- a/Misc/python-config.sh.in -+++ b/Misc/python-config.sh.in -@@ -31,7 +31,7 @@ prefix_real=$(installed_prefix "$0") - # locations. Keep prefix & exec_prefix using their original values in case - # they are referenced in other configure variables, to prevent double - # substitution, issue #22140. --prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") -+prefix=$prefix_build - exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") - exec_prefix_real=${prefix_real} - includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") -@@ -49,7 +49,7 @@ LDLIBRARY="@LDLIBRARY@" - OPT="@OPT@" - PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" - LDVERSION="@LDVERSION@" --LIBDEST=${prefix_real}/lib/python${VERSION} -+LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#") - LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") - SO="@EXT_SUFFIX@" - PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" --- -2.20.1 - -From 74007603df0921450f14e8626df36140426cc300 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 18 Aug 2018 10:54:56 +0200 -Subject: [PATCH] Add an option to disable uuid module - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/configure.ac b/configure.ac -index d07e371c57..55ab6c3c26 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3466,6 +3466,15 @@ if test "$CURSES" = "no"; then - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" - fi - -+AC_SUBST(UUID) -+AC_ARG_ENABLE(uuid, -+ AS_HELP_STRING([--disable-uuid], [disable uuid]), -+ [ UUID="${enableval}" ], [ UUID=yes ]) -+ -+if test "$UUID" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _uuid" -+fi -+ - AC_SUBST(PYDOC) - - AC_ARG_ENABLE(pydoc, --- -2.20.1 - -From 3ddda00652f809a3bd8b4e3f7b0a3a4270b280a6 Mon Sep 17 00:00:00 2001 -From: Adam Duskett -Date: Thu, 16 Aug 2018 14:52:37 -0700 -Subject: [PATCH] fix building on older distributions - -Python > 3.6.3 calls os.replace in the update_file.py script, during the -regen-importlib phase of the build process. - -According to Doc/whatsnew/3.3.rst line 1631, os.replace acts in the same -way as os.rename, however, it is now cross-platform compatible for Windows. - -Because BuildRoot is guaranteed only to be built in POSIX environment, it is -safe to change os.replace back to os.rename. - -This change fixes building on older systems such as CentOS7, that only come -with python 2. - -Signed-off-by: Adam Duskett ---- - Tools/scripts/update_file.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Tools/scripts/update_file.py b/Tools/scripts/update_file.py -index 224585c69b..ef458c0c63 100644 ---- a/Tools/scripts/update_file.py -+++ b/Tools/scripts/update_file.py -@@ -16,7 +16,7 @@ def main(old_path, new_path): - with open(new_path, 'rb') as f: - new_contents = f.read() - if old_contents != new_contents: -- os.replace(new_path, old_path) -+ os.rename(new_path, old_path) - else: - os.unlink(new_path) - --- -2.20.1 - -From ffe8fb3065973204fce95130c32578163755b71e Mon Sep 17 00:00:00 2001 -From: Peter Korsgaard -Date: Fri, 2 Aug 2019 15:53:16 +0200 -Subject: [PATCH] configure.ac: fixup $CC --print-multiarch output for - musl/uclibc GCC 8+ toolchains - -GCC commit 6834b83784dcf0364eb820e8 (multiarch support for non-glibc linux -systems), which is part of GCC 8+, changed the multiarch logic to use -$arch-linux-musl / $arch-linux-uclibc rather than $arch-linux-gnu. - -This then causes the python3 configure script to error out: - -checking for the platform triplet based on compiler characteristics... powerpc-linux-gnu -configure: error: internal configure error for the platform triplet, please file a bug report - -http://autobuild.buildroot.net/results/cb4/cb49c539501342e45cbe5ade82e588fcdf51f05b - -As it requires that the --print-multiarch output (if not empty) matches the -deduced triplet (which always uses -linux-gnu). - -It isn't quite clear why --print-multiarch returns something for a -non-multiarch toolchain on some architectures (E.G. PowerPC), but as a -workaround, rewrite the --print-multiarch output to match older GCC versions -to keep the configure script happy. - -[Rudi: update for 3.9.10, which made the MULTIARCH logic !darwin] -Signed-off-by: Rudi Heitbaum -Signed-off-by: Peter Korsgaard ---- - configure.ac | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7812dc5102..0ce52b9a7d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -884,9 +884,11 @@ - - AC_MSG_CHECKING([for multiarch]) - AS_CASE([$ac_sys_system], -+ # GCC 8+ returns $arch-linux-{musl,uclibc} for musl/uClibc based -+ # toolchains confusing python. Fix that up - [Darwin*], [MULTIARCH=""], - [FreeBSD*], [MULTIARCH=""], -- [MULTIARCH=$($CC --print-multiarch 2>/dev/null)] -+ [MULTIARCH=$($CC --print-multiarch 2>/dev/null | sed -E 's/-linux-(musl|uclibc)*$/-linux-gnu/')] - ) - AC_SUBST([MULTIARCH]) - AC_MSG_RESULT([$MULTIARCH]) --- -2.20.1 - diff --git a/packages/lang/Python3/patches/Python3-0201-xcompile.patch b/packages/lang/Python3/patches/Python3-0201-xcompile.patch index 07f222ae99..5e51cdc752 100644 --- a/packages/lang/Python3/patches/Python3-0201-xcompile.patch +++ b/packages/lang/Python3/patches/Python3-0201-xcompile.patch @@ -1,14 +1,13 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -633,10 +633,12 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx +@@ -633,9 +633,11 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx + *) quiet="";; \ esac; \ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build @@ -16,7 +15,7 @@ @@ -1750,8 +1752,10 @@ libainstall: @DEF_MAKE_RULE@ python-conf # Install the dynamically loadable modules # This goes into $(exec_prefix) - sharedinstall: sharedmods + sharedinstall: all + CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ diff --git a/packages/lang/Python3/patches/Python3-0401-fix-Mark-new-interpreters-and-threads-as-non-static.patch b/packages/lang/Python3/patches/Python3-0401-fix-Mark-new-interpreters-and-threads-as-non-static.patch new file mode 100644 index 0000000000..c2fcaba4b2 --- /dev/null +++ b/packages/lang/Python3/patches/Python3-0401-fix-Mark-new-interpreters-and-threads-as-non-static.patch @@ -0,0 +1,62 @@ +From 27763ef6ac5ad9d70dba68bf9c2c910ef1ddcded Mon Sep 17 00:00:00 2001 +From: Brandt Bucher +Date: Wed, 9 Nov 2022 13:55:20 -0800 +Subject: [PATCH] GH-99205: Mark new interpreters and threads as non-static + (GH-99268) (cherry picked from commit + 283ab0e1c002f2d7459d581df6b4b8599e7d1a4d) + +Co-authored-by: Brandt Bucher +--- + .../2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst | 2 ++ + Python/pystate.c | 8 ++++++++ + 2 files changed, 10 insertions(+) + create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst + +diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst b/Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst +new file mode 100644 +index 000000000000..8ad0e147c203 +--- /dev/null ++++ b/Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst +@@ -0,0 +1,2 @@ ++Fix an issue that prevented :c:type:`PyThreadState` and ++:c:type:`PyInterpreterState` memory from being freed properly. +diff --git a/Python/pystate.c b/Python/pystate.c +index 425065322ebd..c0d161f894c9 100644 +--- a/Python/pystate.c ++++ b/Python/pystate.c +@@ -341,6 +341,7 @@ PyInterpreterState_New(void) + interp = &runtime->_main_interpreter; + assert(interp->id == 0); + assert(interp->next == NULL); ++ assert(interp->_static); + + interpreters->main = interp; + } +@@ -355,6 +356,9 @@ PyInterpreterState_New(void) + // Set to _PyInterpreterState_INIT. + memcpy(interp, &initial._main_interpreter, + sizeof(*interp)); ++ // We need to adjust any fields that are different from the initial ++ // interpreter (as defined in _PyInterpreterState_INIT): ++ interp->_static = false; + + if (id < 0) { + /* overflow or Py_Initialize() not called yet! */ +@@ -817,6 +821,7 @@ new_threadstate(PyInterpreterState *interp) + assert(id == 1); + used_newtstate = 0; + tstate = &interp->_initial_thread; ++ assert(tstate->_static); + } + else { + // Every valid interpreter must have at least one thread. +@@ -828,6 +833,9 @@ new_threadstate(PyInterpreterState *interp) + memcpy(tstate, + &initial._main_interpreter._initial_thread, + sizeof(*tstate)); ++ // We need to adjust any fields that are different from the initial ++ // thread (as defined in _PyThreadState_INIT): ++ tstate->_static = false; + } + interp->threads.head = tstate; +