]> Git Repo - buildroot-mgba.git/commitdiff
package/python3: renumber patches
authorThomas Petazzoni <[email protected]>
Wed, 8 May 2024 16:44:48 +0000 (18:44 +0200)
committerThomas Petazzoni <[email protected]>
Wed, 8 May 2024 16:44:48 +0000 (18:44 +0200)
Following the removal of a number of patches in commit
b37e4a5f56182c5b8e4ffce433eb652174a19da6 ("package/python3: drop
unnecessary patches"), this commit renumbers the renaming patches, and
refreshes them as well so they apply cleanly with "git am".

Signed-off-by: Thomas Petazzoni <[email protected]>
52 files changed:
.checkpackageignore
package/python3/0001-Make-the-build-of-pyc-files-conditional.patch
package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch
package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch
package/python3/0004-Don-t-look-in-usr-lib-termcap-for-libraries.patch [new file with mode: 0644]
package/python3/0005-Don-t-add-multiarch-paths.patch [new file with mode: 0644]
package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch [deleted file]
package/python3/0006-Abort-on-failed-module-build.patch [new file with mode: 0644]
package/python3/0006-Don-t-add-multiarch-paths.patch [deleted file]
package/python3/0007-Abort-on-failed-module-build.patch [deleted file]
package/python3/0007-Serial-ioctl-workaround.patch [new file with mode: 0644]
package/python3/0008-Add-an-option-to-disable-pydoc.patch [new file with mode: 0644]
package/python3/0008-Serial-ioctl-workaround.patch [deleted file]
package/python3/0009-Add-an-option-to-disable-lib2to3.patch [new file with mode: 0644]
package/python3/0010-Add-option-to-disable-the-sqlite3-module.patch [new file with mode: 0644]
package/python3/0011-Add-an-option-to-disable-pydoc.patch [deleted file]
package/python3/0011-Add-an-option-to-disable-the-tk-module.patch [new file with mode: 0644]
package/python3/0012-Add-an-option-to-disable-lib2to3.patch [deleted file]
package/python3/0012-Add-an-option-to-disable-the-curses-module.patch [new file with mode: 0644]
package/python3/0013-Add-an-option-to-disable-expat.patch [new file with mode: 0644]
package/python3/0013-Add-option-to-disable-the-sqlite3-module.patch [deleted file]
package/python3/0014-Add-an-option-to-disable-CJK-codecs.patch [new file with mode: 0644]
package/python3/0014-Add-an-option-to-disable-the-tk-module.patch [deleted file]
package/python3/0015-Add-an-option-to-disable-NIS.patch [new file with mode: 0644]
package/python3/0015-Add-an-option-to-disable-the-curses-module.patch [deleted file]
package/python3/0016-Add-an-option-to-disable-expat.patch [deleted file]
package/python3/0016-Add-an-option-to-disable-unicodedata.patch [new file with mode: 0644]
package/python3/0017-Add-an-option-to-disable-CJK-codecs.patch [deleted file]
package/python3/0017-Add-an-option-to-disable-IDLE.patch [new file with mode: 0644]
package/python3/0018-Add-an-option-to-disable-NIS.patch [deleted file]
package/python3/0018-Add-an-option-to-disable-decimal.patch [new file with mode: 0644]
package/python3/0019-Add-an-option-to-disable-the-ossaudiodev-module.patch [new file with mode: 0644]
package/python3/0019-Add-an-option-to-disable-unicodedata.patch [deleted file]
package/python3/0020-Add-an-option-to-disable-IDLE.patch [deleted file]
package/python3/0020-Add-an-option-to-disable-openssl-support.patch [new file with mode: 0644]
package/python3/0021-Add-an-option-to-disable-decimal.patch [deleted file]
package/python3/0021-Add-an-option-to-disable-the-readline-module.patch [new file with mode: 0644]
package/python3/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch [deleted file]
package/python3/0022-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch [new file with mode: 0644]
package/python3/0023-Add-an-option-to-disable-openssl-support.patch [deleted file]
package/python3/0023-Add-an-option-to-disable-uuid-module.patch [new file with mode: 0644]
package/python3/0024-Add-an-option-to-disable-the-readline-module.patch [deleted file]
package/python3/0024-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch [new file with mode: 0644]
package/python3/0025-Add-an-option-to-disable-the-berkeleydb-module.patch [new file with mode: 0644]
package/python3/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch [deleted file]
package/python3/0026-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch [new file with mode: 0644]
package/python3/0027-Add-an-option-to-disable-uuid-module.patch [deleted file]
package/python3/0027-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch [new file with mode: 0644]
package/python3/0029-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch [deleted file]
package/python3/0030-Add-an-option-to-disable-the-berkeleydb-module.patch [deleted file]
package/python3/0031-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch [deleted file]
package/python3/0032-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch [deleted file]

index 071a72b837998ac5c2c6f259ee6f186dc0e03652..a54962b7989659075b12a1c33f1ebd7ccbd167bc 100644 (file)
@@ -1323,29 +1323,29 @@ package/python-ws4py/0001-Adjust-ws4py-for-Python-3.7-syntax.patch lib_patch.Ups
 package/python3/0001-Make-the-build-of-pyc-files-conditional.patch lib_patch.Upstream
 package/python3/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch lib_patch.Upstream
 package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch lib_patch.Upstream
-package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch lib_patch.Upstream
-package/python3/0006-Don-t-add-multiarch-paths.patch lib_patch.Upstream
-package/python3/0007-Abort-on-failed-module-build.patch lib_patch.Upstream
-package/python3/0008-Serial-ioctl-workaround.patch lib_patch.Upstream
-package/python3/0011-Add-an-option-to-disable-pydoc.patch lib_patch.Upstream
-package/python3/0012-Add-an-option-to-disable-lib2to3.patch lib_patch.Upstream
-package/python3/0013-Add-option-to-disable-the-sqlite3-module.patch lib_patch.Upstream
-package/python3/0014-Add-an-option-to-disable-the-tk-module.patch lib_patch.Upstream
-package/python3/0015-Add-an-option-to-disable-the-curses-module.patch lib_patch.Upstream
-package/python3/0016-Add-an-option-to-disable-expat.patch lib_patch.Upstream
-package/python3/0017-Add-an-option-to-disable-CJK-codecs.patch lib_patch.Upstream
-package/python3/0018-Add-an-option-to-disable-NIS.patch lib_patch.Upstream
-package/python3/0019-Add-an-option-to-disable-unicodedata.patch lib_patch.Upstream
-package/python3/0020-Add-an-option-to-disable-IDLE.patch lib_patch.Upstream
-package/python3/0021-Add-an-option-to-disable-decimal.patch lib_patch.Upstream
-package/python3/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch lib_patch.Upstream
-package/python3/0023-Add-an-option-to-disable-openssl-support.patch lib_patch.Upstream
-package/python3/0024-Add-an-option-to-disable-the-readline-module.patch lib_patch.Upstream
-package/python3/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch lib_patch.Upstream
-package/python3/0027-Add-an-option-to-disable-uuid-module.patch lib_patch.Upstream
-package/python3/0029-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch lib_patch.Upstream
-package/python3/0030-Add-an-option-to-disable-the-berkeleydb-module.patch lib_patch.Upstream
-package/python3/0031-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch lib_patch.Upstream
+package/python3/0004-Don-t-look-in-usr-lib-termcap-for-libraries.patch lib_patch.Upstream
+package/python3/0005-Don-t-add-multiarch-paths.patch lib_patch.Upstream
+package/python3/0006-Abort-on-failed-module-build.patch lib_patch.Upstream
+package/python3/0007-Serial-ioctl-workaround.patch lib_patch.Upstream
+package/python3/0008-Add-an-option-to-disable-pydoc.patch lib_patch.Upstream
+package/python3/0009-Add-an-option-to-disable-lib2to3.patch lib_patch.Upstream
+package/python3/0010-Add-option-to-disable-the-sqlite3-module.patch lib_patch.Upstream
+package/python3/0011-Add-an-option-to-disable-the-tk-module.patch lib_patch.Upstream
+package/python3/0012-Add-an-option-to-disable-the-curses-module.patch lib_patch.Upstream
+package/python3/0013-Add-an-option-to-disable-expat.patch lib_patch.Upstream
+package/python3/0014-Add-an-option-to-disable-CJK-codecs.patch lib_patch.Upstream
+package/python3/0015-Add-an-option-to-disable-NIS.patch lib_patch.Upstream
+package/python3/0016-Add-an-option-to-disable-unicodedata.patch lib_patch.Upstream
+package/python3/0017-Add-an-option-to-disable-IDLE.patch lib_patch.Upstream
+package/python3/0018-Add-an-option-to-disable-decimal.patch lib_patch.Upstream
+package/python3/0019-Add-an-option-to-disable-the-ossaudiodev-module.patch lib_patch.Upstream
+package/python3/0020-Add-an-option-to-disable-openssl-support.patch lib_patch.Upstream
+package/python3/0021-Add-an-option-to-disable-the-readline-module.patch lib_patch.Upstream
+package/python3/0022-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch lib_patch.Upstream
+package/python3/0023-Add-an-option-to-disable-uuid-module.patch lib_patch.Upstream
+package/python3/0024-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch lib_patch.Upstream
+package/python3/0025-Add-an-option-to-disable-the-berkeleydb-module.patch lib_patch.Upstream
+package/python3/0026-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch lib_patch.Upstream
 package/qemu/0002-softmmu-qemu-seccomp.c-add-missing-header-for-CLONE_.patch lib_patch.Upstream
 package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch lib_patch.Upstream
 package/qextserialport/0002-Tell-qmake-to-add-a-pkgconfig-file-to-ease-usage-wit.patch lib_patch.Upstream
index 92aa7274ba23323a53f3e84f57fe38c5f751ee45..827b99d8e9fe820101205c0cc290eec2e9405a39 100644 (file)
@@ -1,4 +1,4 @@
-From 51ed7f93cc0333efa8fccd9b88db713c48993df9 Mon Sep 17 00:00:00 2001
+From 9dd808909ea18f8e99272cbdf1e39151bff62037 Mon Sep 17 00:00:00 2001
 From: Thomas Petazzoni <[email protected]>
 Date: Wed, 22 Feb 2017 16:21:31 -0800
 Subject: [PATCH] Make the build of pyc files conditional
@@ -15,10 +15,10 @@ Signed-off-by: Andrey Smirnov <[email protected]>
  2 files changed, 8 insertions(+)
 
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 8fbcd7ac17..2957c8e5a1 100644
+index 4d1921bf435..f90ec2eeb1d 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -2078,6 +2078,7 @@ libinstall:      all $(srcdir)/Modules/xxmodule.c
+@@ -2139,6 +2139,7 @@ libinstall:      all $(srcdir)/Modules/xxmodule.c
                $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
                        $(DESTDIR)$(LIBDEST)/distutils/tests ; \
        fi
@@ -26,7 +26,7 @@ index 8fbcd7ac17..2957c8e5a1 100644
        -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
                $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
                -j0 -d $(LIBDEST) -f \
-@@ -2105,6 +2106,7 @@ libinstall:      all $(srcdir)/Modules/xxmodule.c
+@@ -2166,6 +2167,7 @@ libinstall:      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
@@ -35,10 +35,10 @@ index 8fbcd7ac17..2957c8e5a1 100644
                $(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 ab5e1de6fa..0cf89ed641 100644
+index bbe7f891e7d..7b136bd2f0b 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1441,6 +1441,12 @@ fi
+@@ -1459,6 +1459,12 @@ fi
  
  AC_MSG_CHECKING(LDLIBRARY)
  
@@ -52,5 +52,5 @@ index ab5e1de6fa..0cf89ed641 100644
  # 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.34.1
+2.44.0
 
index 5389cb5d15145ab94f76b142eca815e91597bf63..e996823c472e5444d672b560b11bbd640a3277bf 100644 (file)
@@ -1,4 +1,4 @@
-From b180ab302e2a82be239af334382436628b81381e Mon Sep 17 00:00:00 2001
+From 33cd52fb1295a6eb4dd42fbc73e565c5ce01bbd0 Mon Sep 17 00:00:00 2001
 From: Vanya Sergeev <[email protected]>
 Date: Wed, 23 Dec 2015 11:30:33 +0100
 Subject: [PATCH] Disable buggy_getaddrinfo configure test when cross-compiling
@@ -10,10 +10,10 @@ Signed-off-by: Vanya Sergeev <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index 0cf89ed641..830885fcb3 100644
+index 7b136bd2f0b..1e84aa0bb7f 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -5086,7 +5086,7 @@ fi]))
+@@ -5137,7 +5137,7 @@ fi]))
  dnl if ac_cv_func_getaddrinfo
  ])
  
@@ -23,5 +23,5 @@ index 0cf89ed641..830885fcb3 100644
    AS_VAR_IF([ipv6], [yes], [
      AC_MSG_ERROR([m4_normalize([
 -- 
-2.34.1
+2.44.0
 
index 5b3911374e8183096f325858f90f67d5b367c204..f0c13387e8539c03208a6257b178c1fc71c046f3 100644 (file)
@@ -1,4 +1,4 @@
-From 8e02cebdac536dfb6748da2c50656a26f70d9da7 Mon Sep 17 00:00:00 2001
+From 533aa8d7eb7ad27428410371504c6b94183852c1 Mon Sep 17 00:00:00 2001
 From: Thomas Petazzoni <[email protected]>
 Date: Wed, 22 Feb 2017 16:33:22 -0800
 Subject: [PATCH] Add infrastructure to disable the build of certain extensions
@@ -44,7 +44,7 @@ Signed-off-by: Andrey Smirnov <[email protected]>
  3 files changed, 11 insertions(+), 2 deletions(-)
 
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 2957c8e5a1..c1cfb96767 100644
+index f90ec2eeb1d..5a40b7c5484 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
 @@ -239,6 +239,8 @@ FILEMODE=  644
@@ -56,7 +56,7 @@ index 2957c8e5a1..c1cfb96767 100644
  
  # Subdirectories with code
  SRCDIRS=      @SRCDIRS@
-@@ -739,6 +741,7 @@ sharedmods: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPA
+@@ -743,6 +745,7 @@ sharedmods: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPA
            *) quiet="";; \
        esac; \
        echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
@@ -64,7 +64,7 @@ index 2957c8e5a1..c1cfb96767 100644
                $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
        $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
                $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-@@ -2228,7 +2231,8 @@ libainstall: all python-config
+@@ -2289,7 +2292,8 @@ libainstall: all python-config
  # Install the dynamically loadable modules
  # This goes into $(exec_prefix)
  sharedinstall: all
@@ -75,10 +75,10 @@ index 2957c8e5a1..c1cfb96767 100644
                --install-scripts=$(BINDIR) \
                --install-platlib=$(DESTSHARED) \
 diff --git a/configure.ac b/configure.ac
-index 830885fcb3..5a6a1fe608 100644
+index 1e84aa0bb7f..b4d7d2cca6a 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -3562,6 +3562,8 @@ LIBS="$withval $LIBS"
+@@ -3612,6 +3612,8 @@ LIBS="$withval $LIBS"
  ],
  [AC_MSG_RESULT(no)])
  
@@ -88,7 +88,7 @@ index 830885fcb3..5a6a1fe608 100644
  AC_MSG_CHECKING(for --with-system-expat)
  AC_ARG_WITH(system_expat,
 diff --git a/setup.py b/setup.py
-index 15d0d4576a..e496ee34c2 100644
+index ad8fb81b218..2e15fedeab2 100644
 --- a/setup.py
 +++ b/setup.py
 @@ -56,7 +56,10 @@
@@ -104,5 +104,5 @@ index 15d0d4576a..e496ee34c2 100644
  # --list-module-names option used by Tools/scripts/generate_module_names.py
  LIST_MODULE_NAMES = False
 -- 
-2.34.1
+2.44.0
 
diff --git a/package/python3/0004-Don-t-look-in-usr-lib-termcap-for-libraries.patch b/package/python3/0004-Don-t-look-in-usr-lib-termcap-for-libraries.patch
new file mode 100644 (file)
index 0000000..0e3a844
--- /dev/null
@@ -0,0 +1,31 @@
+From bd152d01185a371a04680bc772c6454678de34f5 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+---
+ setup.py | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 2e15fedeab2..b283ea3aeed 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1111,12 +1111,9 @@ def detect_readline_curses(self):
+                 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.44.0
+
diff --git a/package/python3/0005-Don-t-add-multiarch-paths.patch b/package/python3/0005-Don-t-add-multiarch-paths.patch
new file mode 100644 (file)
index 0000000..4557fbb
--- /dev/null
@@ -0,0 +1,37 @@
+From 3e953e494570ddb78823d12f66dae1759f4780a3 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index b283ea3aeed..585dd43828d 100644
+--- a/setup.py
++++ b/setup.py
+@@ -853,10 +853,10 @@ def configure_compiler(self):
+         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.44.0
+
diff --git a/package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch b/package/python3/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch
deleted file mode 100644 (file)
index 78b3ae5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 5d13e384b30a2c0b1c7b65718590b7fb0c3ba55e Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
----
- setup.py | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index e496ee34c2..1904898165 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1107,12 +1107,9 @@ def detect_readline_curses(self):
-                 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.34.1
-
diff --git a/package/python3/0006-Abort-on-failed-module-build.patch b/package/python3/0006-Abort-on-failed-module-build.patch
new file mode 100644 (file)
index 0000000..d3ec7c3
--- /dev/null
@@ -0,0 +1,30 @@
+From 60b62c7e2c1fca4dcaf288f747376bfde111283b Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+---
+ setup.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/setup.py b/setup.py
+index 585dd43828d..53b066cb18b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -580,6 +580,7 @@ def print_three_column(lst):
+             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.44.0
+
diff --git a/package/python3/0006-Don-t-add-multiarch-paths.patch b/package/python3/0006-Don-t-add-multiarch-paths.patch
deleted file mode 100644 (file)
index 749e295..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From ad463b5d58ae79f69b011fb048861bd874d34369 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>.
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- setup.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 1904898165..32294546b6 100644
---- a/setup.py
-+++ b/setup.py
-@@ -852,10 +852,10 @@ def configure_compiler(self):
-         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.34.1
-
diff --git a/package/python3/0007-Abort-on-failed-module-build.patch b/package/python3/0007-Abort-on-failed-module-build.patch
deleted file mode 100644 (file)
index a473896..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 60b1664a7acebadb1a3d6df871145147f33b5afe Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
----
- setup.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/setup.py b/setup.py
-index 32294546b6..0e04944ce0 100644
---- a/setup.py
-+++ b/setup.py
-@@ -579,6 +579,7 @@ def print_three_column(lst):
-             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.34.1
-
diff --git a/package/python3/0007-Serial-ioctl-workaround.patch b/package/python3/0007-Serial-ioctl-workaround.patch
new file mode 100644 (file)
index 0000000..34072f8
--- /dev/null
@@ -0,0 +1,33 @@
+From 0061a02bbe82c9b3b631d3b820bab0ba18482ebc Mon Sep 17 00:00:00 2001
+From: Baruch Siach <[email protected]>
+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 <[email protected]>
+---
+ Modules/termios.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Modules/termios.c b/Modules/termios.c
+index 23771b2ce99..c1579af435d 100644
+--- a/Modules/termios.c
++++ b/Modules/termios.c
+@@ -15,7 +15,9 @@
+ #endif
+ #include <termios.h>
++#include <linux/serial.h>
+ #include <sys/ioctl.h>
++#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.44.0
+
diff --git a/package/python3/0008-Add-an-option-to-disable-pydoc.patch b/package/python3/0008-Add-an-option-to-disable-pydoc.patch
new file mode 100644 (file)
index 0000000..3c678be
--- /dev/null
@@ -0,0 +1,100 @@
+From 77fcd90a1236d59d40aa32d3bc4bef4303eb4066 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+Signed-off-by: Samuel Martin <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ 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 5a40b7c5484..e87bc1fcd32 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1877,7 +1877,9 @@ bininstall: commoninstall 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 \
+@@ -1928,7 +1930,6 @@ LIBSUBDIRS=      asyncio \
+               lib2to3 lib2to3/fixes lib2to3/pgen2 \
+               logging \
+               multiprocessing multiprocessing/dummy \
+-              pydoc_data \
+               re \
+               site-packages \
+               sqlite3 \
+@@ -2069,6 +2070,10 @@ TESTSUBDIRS=    ctypes/test \
+               unittest/test \
+               unittest/test/testmock
++ifeq (@PYDOC@,yes)
++LIBSUBDIRS += pydoc_data
++endif
++
+ TEST_MODULES=@TEST_MODULES@
+ libinstall:   all $(srcdir)/Modules/xxmodule.c
+       @for i in $(SCRIPTDIR) $(LIBDEST); \
+diff --git a/configure.ac b/configure.ac
+index b4d7d2cca6a..d56d8f9d1c5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4222,6 +4222,12 @@ AS_VAR_IF([posix_threads], [stub], [
+   AC_DEFINE([HAVE_PTHREAD_STUBS], [1], [Define if platform requires stubbed pthreads support])
+ ])
++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])
+ AC_MSG_CHECKING([if --enable-ipv6 is specified])
+diff --git a/setup.py b/setup.py
+index 53b066cb18b..d8647724650 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1597,6 +1597,12 @@ class DummyProcess:
+     # 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],
+@@ -1621,8 +1627,7 @@ class DummyProcess:
+           # 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.44.0
+
diff --git a/package/python3/0008-Serial-ioctl-workaround.patch b/package/python3/0008-Serial-ioctl-workaround.patch
deleted file mode 100644 (file)
index 7722a04..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From 90f3075b629d90d942da1d22ef7563f7149f4f6c Mon Sep 17 00:00:00 2001
-From: Baruch Siach <[email protected]>
-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 <[email protected]>
----
- Modules/termios.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/Modules/termios.c b/Modules/termios.c
-index 354e5ca18d..c08957c500 100644
---- a/Modules/termios.c
-+++ b/Modules/termios.c
-@@ -15,7 +15,9 @@
- #endif
- #include <termios.h>
-+#include <linux/serial.h>
- #include <sys/ioctl.h>
-+#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.34.1
-
diff --git a/package/python3/0009-Add-an-option-to-disable-lib2to3.patch b/package/python3/0009-Add-an-option-to-disable-lib2to3.patch
new file mode 100644 (file)
index 0000000..13cb273
--- /dev/null
@@ -0,0 +1,122 @@
+From 18e19402fab3939223a58481734e685d25c3102b Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+Signed-off-by: Samuel Martin <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+[ Bernd Kuhls: ported to Python 3.11.4]
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ Makefile.pre.in | 17 ++++++++++++-----
+ configure.ac    |  6 ++++++
+ setup.py        |  6 +++---
+ 3 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index e87bc1fcd32..1a0ab0de426 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1881,7 +1881,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)) \
+@@ -1927,7 +1929,6 @@ LIBSUBDIRS=      asyncio \
+               idlelib idlelib/Icons \
+               importlib importlib/resources importlib/metadata \
+               json \
+-              lib2to3 lib2to3/fixes lib2to3/pgen2 \
+               logging \
+               multiprocessing multiprocessing/dummy \
+               re \
+@@ -1947,10 +1948,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/certdata \
+@@ -2074,6 +2071,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:   all $(srcdir)/Modules/xxmodule.c
+       @for i in $(SCRIPTDIR) $(LIBDEST); \
+@@ -2176,10 +2181,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 d56d8f9d1c5..bf91fb2f824 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7147,6 +7147,12 @@ PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$ac_cv_fu
+ # substitute multiline block, must come after last PY_STDLIB_MOD()
+ AC_SUBST([MODULE_BLOCK])
++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)
+ AC_CONFIG_FILES([Modules/Setup.bootstrap Modules/Setup.stdlib])
+diff --git a/setup.py b/setup.py
+index d8647724650..e02591dae10 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1598,11 +1598,11 @@ class DummyProcess:
+     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.44.0
+
diff --git a/package/python3/0010-Add-option-to-disable-the-sqlite3-module.patch b/package/python3/0010-Add-option-to-disable-the-sqlite3-module.patch
new file mode 100644 (file)
index 0000000..5ed2822
--- /dev/null
@@ -0,0 +1,62 @@
+From aba9392bf6bf68cfd63b1cecfdd3e96d5de2a0b7 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 22 Feb 2017 17:20:45 -0800
+Subject: [PATCH] Add option to disable the sqlite3 module
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Samuel Martin <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ Makefile.pre.in | 5 ++++-
+ configure.ac    | 9 +++++++++
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 1a0ab0de426..1c7b38ce4f6 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1933,7 +1933,6 @@ LIBSUBDIRS=      asyncio \
+               multiprocessing multiprocessing/dummy \
+               re \
+               site-packages \
+-              sqlite3 \
+               tkinter \
+               tomllib \
+               turtledemo \
+@@ -2079,6 +2078,10 @@ TESTSUBDIRS += lib2to3/tests                    \
+       lib2to3/tests/data/fixers/myfixes
+ endif
++ifeq (@SQLITE3@,yes)
++LIBSUBDIRS += sqlite3
++endif
++
+ TEST_MODULES=@TEST_MODULES@
+ libinstall:   all $(srcdir)/Modules/xxmodule.c
+       @for i in $(SCRIPTDIR) $(LIBDEST); \
+diff --git a/configure.ac b/configure.ac
+index bf91fb2f824..0013afc9aad 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4222,6 +4222,15 @@ AS_VAR_IF([posix_threads], [stub], [
+   AC_DEFINE([HAVE_PTHREAD_STUBS], [1], [Define if platform requires stubbed pthreads support])
+ ])
++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.44.0
+
diff --git a/package/python3/0011-Add-an-option-to-disable-pydoc.patch b/package/python3/0011-Add-an-option-to-disable-pydoc.patch
deleted file mode 100644 (file)
index f7bfd43..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-From 38b7f7949258aeadf8bc45525be91340bb732a2a Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
-Signed-off-by: Samuel Martin <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
----
- 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 c1cfb96767..403380e181 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1864,7 +1864,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 \
-@@ -1915,7 +1917,6 @@ LIBSUBDIRS=      asyncio \
-               lib2to3 lib2to3/fixes lib2to3/pgen2 \
-               logging \
-               multiprocessing multiprocessing/dummy \
--              pydoc_data \
-               re \
-               site-packages \
-               sqlite3 \
-@@ -2008,6 +2009,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:   all $(srcdir)/Modules/xxmodule.c
-       @for i in $(SCRIPTDIR) $(LIBDEST); \
-diff --git a/configure.ac b/configure.ac
-index 5a6a1fe608..f68ea72321 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4171,6 +4171,12 @@ AS_VAR_IF([posix_threads], [stub], [
-   AC_DEFINE([HAVE_PTHREAD_STUBS], [1], [Define if platform requires stubbed pthreads support])
- ])
-+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])
- AC_MSG_CHECKING([if --enable-ipv6 is specified])
-diff --git a/setup.py b/setup.py
-index 0e04944ce0..3e55f5b2e0 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1593,6 +1593,12 @@ class DummyProcess:
-     # 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],
-@@ -1617,8 +1623,7 @@ class DummyProcess:
-           # 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.34.1
-
diff --git a/package/python3/0011-Add-an-option-to-disable-the-tk-module.patch b/package/python3/0011-Add-an-option-to-disable-the-tk-module.patch
new file mode 100644 (file)
index 0000000..2d5c002
--- /dev/null
@@ -0,0 +1,77 @@
+From 61535b58452a18d6654a02fd25bfbc562bbbdbea Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 22 Feb 2017 17:23:42 -0800
+Subject: [PATCH] Add an option to disable the tk module
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Samuel Martin <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+[ Bernd Kuhls: ported to Python 3.11.4]
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ Makefile.pre.in | 11 +++++++----
+ configure.ac    |  9 +++++++++
+ 2 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 1c7b38ce4f6..6ab184fe5f8 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1933,7 +1933,6 @@ LIBSUBDIRS=      asyncio \
+               multiprocessing multiprocessing/dummy \
+               re \
+               site-packages \
+-              tkinter \
+               tomllib \
+               turtledemo \
+               unittest \
+@@ -2060,9 +2059,6 @@ TESTSUBDIRS=     ctypes/test \
+               test/xmltestdata \
+               test/xmltestdata/c14n-20 \
+               test/ziptestdata \
+-              tkinter/test \
+-              tkinter/test/test_tkinter \
+-              tkinter/test/test_ttk \
+               unittest/test \
+               unittest/test/testmock
+@@ -2082,6 +2078,13 @@ ifeq (@SQLITE3@,yes)
+ LIBSUBDIRS += sqlite3
+ endif
++ifeq (@TK@,yes)
++LIBSUBDIRS += tkinter
++TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
++      tkinter/test/test_ttk
++endif
++
++
+ TEST_MODULES=@TEST_MODULES@
+ libinstall:   all $(srcdir)/Modules/xxmodule.c
+       @for i in $(SCRIPTDIR) $(LIBDEST); \
+diff --git a/configure.ac b/configure.ac
+index 0013afc9aad..342b295bcdd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4231,6 +4231,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.44.0
+
diff --git a/package/python3/0012-Add-an-option-to-disable-lib2to3.patch b/package/python3/0012-Add-an-option-to-disable-lib2to3.patch
deleted file mode 100644 (file)
index 228b86a..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-From 0e4f0a525ea0a68f6d4c5349c301da2e9b0c8ac9 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
-Signed-off-by: Samuel Martin <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
-[ Bernd Kuhls: ported to Python 3.11.4]
-Signed-off-by: Bernd Kuhls <[email protected]>
----
- Makefile.pre.in | 17 ++++++++++++-----
- configure.ac    |  6 ++++++
- setup.py        |  6 +++---
- 3 files changed, 21 insertions(+), 8 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 403380e181..f5d0573067 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1868,7 +1868,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)) \
-@@ -1914,7 +1916,6 @@ LIBSUBDIRS=      asyncio \
-               idlelib idlelib/Icons \
-               importlib importlib/resources importlib/metadata \
-               json \
--              lib2to3 lib2to3/fixes lib2to3/pgen2 \
-               logging \
-               multiprocessing multiprocessing/dummy \
-               re \
-@@ -1934,10 +1935,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 \
-@@ -2013,6 +2010,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:   all $(srcdir)/Modules/xxmodule.c
-       @for i in $(SCRIPTDIR) $(LIBDEST); \
-@@ -2115,10 +2120,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 f68ea72321..d8e10cf2b2 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -7078,6 +7078,12 @@ PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$ac_cv_fu
- # substitute multiline block, must come after last PY_STDLIB_MOD()
- AC_SUBST([MODULE_BLOCK])
-+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)
- AC_CONFIG_FILES([Modules/Setup.bootstrap Modules/Setup.stdlib])
-diff --git a/setup.py b/setup.py
-index 3e55f5b2e0..c490b0b08f 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1594,11 +1594,11 @@ class DummyProcess:
-     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.34.1
-
diff --git a/package/python3/0012-Add-an-option-to-disable-the-curses-module.patch b/package/python3/0012-Add-an-option-to-disable-the-curses-module.patch
new file mode 100644 (file)
index 0000000..0b15dfb
--- /dev/null
@@ -0,0 +1,61 @@
+From d843bceff915b2a50b36a9db8552e0db5bd90f6d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 22 Feb 2017 17:31:51 -0800
+Subject: [PATCH] Add an option to disable the curses module
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Samuel Martin <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ 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 6ab184fe5f8..09408c3471f 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1918,7 +1918,6 @@ LIBSUBDIRS=      asyncio \
+               concurrent concurrent/futures \
+               csv \
+               ctypes ctypes/macholib \
+-              curses \
+               dbm \
+               distutils distutils/command \
+               email email/mime \
+@@ -2084,6 +2083,9 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
+       tkinter/test/test_ttk
+ endif
++ifeq (@CURSES@,yes)
++LIBSUBDIRS += curses
++endif
+ TEST_MODULES=@TEST_MODULES@
+ libinstall:   all $(srcdir)/Modules/xxmodule.c
+diff --git a/configure.ac b/configure.ac
+index 342b295bcdd..5d52c813ba6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4240,6 +4240,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.44.0
+
diff --git a/package/python3/0013-Add-an-option-to-disable-expat.patch b/package/python3/0013-Add-an-option-to-disable-expat.patch
new file mode 100644 (file)
index 0000000..03d8271
--- /dev/null
@@ -0,0 +1,82 @@
+From 3ed9d35554631a1e0c438636b60b6b9b699cba4b Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+Signed-off-by: Samuel Martin <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ Makefile.pre.in |  5 ++++-
+ configure.ac    | 20 ++++++++++++++------
+ 2 files changed, 18 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 09408c3471f..8e5f6762d20 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1938,7 +1938,6 @@ LIBSUBDIRS=      asyncio \
+               urllib \
+               venv venv/scripts venv/scripts/common venv/scripts/posix \
+               wsgiref \
+-              $(XMLLIBSUBDIRS) \
+               xmlrpc \
+               zoneinfo \
+               __phello__
+@@ -2087,6 +2086,10 @@ ifeq (@CURSES@,yes)
+ LIBSUBDIRS += curses
+ endif
++ifeq (@EXPAT@,yes)
++LIBSUBDIRS += $(XMLLIBSUBDIRS)
++endif
++
+ TEST_MODULES=@TEST_MODULES@
+ libinstall:   all $(srcdir)/Modules/xxmodule.c
+       @for i in $(SCRIPTDIR) $(LIBDEST); \
+diff --git a/configure.ac b/configure.ac
+index 5d52c813ba6..6e577f19b8c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3615,15 +3615,23 @@ LIBS="$withval $LIBS"
+ 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)
+-AS_VAR_IF([with_system_expat], [yes], [
++if test "$with_expat" != "none"; then
++   EXPAT=yes
++else
++   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
++   EXPAT=no
++fi
++AC_SUBST(EXPAT)
++
++AS_VAR_IF([with_expat], [system], [
+   LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
+   LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
+   LIBEXPAT_INTERNAL=
+-- 
+2.44.0
+
diff --git a/package/python3/0013-Add-option-to-disable-the-sqlite3-module.patch b/package/python3/0013-Add-option-to-disable-the-sqlite3-module.patch
deleted file mode 100644 (file)
index 795ea3b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-From ef8c030e01b1be8be582e90c31298a5863094858 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Wed, 22 Feb 2017 17:20:45 -0800
-Subject: [PATCH] Add option to disable the sqlite3 module
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
-Signed-off-by: Samuel Martin <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
----
- Makefile.pre.in | 5 ++++-
- configure.ac    | 9 +++++++++
- 2 files changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index f5d0573067..9f4cdf14cf 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1920,7 +1920,6 @@ LIBSUBDIRS=      asyncio \
-               multiprocessing multiprocessing/dummy \
-               re \
-               site-packages \
--              sqlite3 \
-               tkinter \
-               tomllib \
-               turtledemo \
-@@ -2018,6 +2017,10 @@ TESTSUBDIRS += lib2to3/tests                    \
-       lib2to3/tests/data/fixers/myfixes
- endif
-+ifeq (@SQLITE3@,yes)
-+LIBSUBDIRS += sqlite3
-+endif
-+
- TEST_MODULES=@TEST_MODULES@
- libinstall:   all $(srcdir)/Modules/xxmodule.c
-       @for i in $(SCRIPTDIR) $(LIBDEST); \
-diff --git a/configure.ac b/configure.ac
-index d8e10cf2b2..4cc0951ab9 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4171,6 +4171,15 @@ AS_VAR_IF([posix_threads], [stub], [
-   AC_DEFINE([HAVE_PTHREAD_STUBS], [1], [Define if platform requires stubbed pthreads support])
- ])
-+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.34.1
-
diff --git a/package/python3/0014-Add-an-option-to-disable-CJK-codecs.patch b/package/python3/0014-Add-an-option-to-disable-CJK-codecs.patch
new file mode 100644 (file)
index 0000000..7e13a07
--- /dev/null
@@ -0,0 +1,30 @@
+From 494fae96f273517c43c65a5d9ea6b7d968352443 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 23 Dec 2015 11:49:55 +0100
+Subject: [PATCH] Add an option to disable CJK codecs
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 6e577f19b8c..13ffcf2637e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4239,6 +4239,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.44.0
+
diff --git a/package/python3/0014-Add-an-option-to-disable-the-tk-module.patch b/package/python3/0014-Add-an-option-to-disable-the-tk-module.patch
deleted file mode 100644 (file)
index b89e1d2..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-From bbbfe699d648a5cb191203b16e1786e8cf4ea908 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Wed, 22 Feb 2017 17:23:42 -0800
-Subject: [PATCH] Add an option to disable the tk module
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
-Signed-off-by: Samuel Martin <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
-[ Bernd Kuhls: ported to Python 3.11.4]
-Signed-off-by: Bernd Kuhls <[email protected]>
----
- 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 9f4cdf14cf..4f83911200 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1920,7 +1920,6 @@ LIBSUBDIRS=      asyncio \
-               multiprocessing multiprocessing/dummy \
-               re \
-               site-packages \
--              tkinter \
-               tomllib \
-               turtledemo \
-               unittest \
-@@ -2038,9 +2038,6 @@
-               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)
-@@ -2021,6 +2018,13 @@ ifeq (@SQLITE3@,yes)
- LIBSUBDIRS += sqlite3
- endif
-+ifeq (@TK@,yes)
-+LIBSUBDIRS += tkinter
-+TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
-+      tkinter/test/test_ttk
-+endif
-+
-+
- TEST_MODULES=@TEST_MODULES@
- libinstall:   all $(srcdir)/Modules/xxmodule.c
-       @for i in $(SCRIPTDIR) $(LIBDEST); \
-diff --git a/configure.ac b/configure.ac
-index 4cc0951ab9..f4ce506801 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4180,6 +4180,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.34.1
-
diff --git a/package/python3/0015-Add-an-option-to-disable-NIS.patch b/package/python3/0015-Add-an-option-to-disable-NIS.patch
new file mode 100644 (file)
index 0000000..ee382ac
--- /dev/null
@@ -0,0 +1,33 @@
+From 3f4f9bee66236e2052f9ff027e867a61ec56a585 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 13ffcf2637e..2faadb34f65 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4245,6 +4245,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.44.0
+
diff --git a/package/python3/0015-Add-an-option-to-disable-the-curses-module.patch b/package/python3/0015-Add-an-option-to-disable-the-curses-module.patch
deleted file mode 100644 (file)
index da6f891..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-From 03e28cdd46dac1b7e4e9c8bbd2ea44b09e514205 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Wed, 22 Feb 2017 17:31:51 -0800
-Subject: [PATCH] Add an option to disable the curses module
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
-Signed-off-by: Samuel Martin <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
----
- 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 4f83911200..8e879b35c6 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1905,7 +1905,6 @@ LIBSUBDIRS=      asyncio \
-               concurrent concurrent/futures \
-               csv \
-               ctypes ctypes/macholib \
--              curses \
-               dbm \
-               distutils distutils/command \
-               email email/mime \
-@@ -2024,6 +2023,9 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
-       tkinter/test/test_ttk
- endif
-+ifeq (@CURSES@,yes)
-+LIBSUBDIRS += curses
-+endif
- TEST_MODULES=@TEST_MODULES@
- libinstall:   all $(srcdir)/Modules/xxmodule.c
-diff --git a/configure.ac b/configure.ac
-index f4ce506801..0ae9863cd6 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4189,6 +4189,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.34.1
-
diff --git a/package/python3/0016-Add-an-option-to-disable-expat.patch b/package/python3/0016-Add-an-option-to-disable-expat.patch
deleted file mode 100644 (file)
index c307407..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-From c9a2ea3edacf57746517600ccc11c254a9fd6c48 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
-Signed-off-by: Samuel Martin <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
----
- Makefile.pre.in |  5 ++++-
- configure.ac    | 20 ++++++++++++++------
- 2 files changed, 18 insertions(+), 7 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 8e879b35c6..80d617cf7f 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1925,7 +1925,6 @@ LIBSUBDIRS=      asyncio \
-               urllib \
-               venv venv/scripts venv/scripts/common venv/scripts/posix \
-               wsgiref \
--              $(XMLLIBSUBDIRS) \
-               xmlrpc \
-               zoneinfo \
-               __phello__
-@@ -2027,6 +2026,10 @@ ifeq (@CURSES@,yes)
- LIBSUBDIRS += curses
- endif
-+ifeq (@EXPAT@,yes)
-+LIBSUBDIRS += $(XMLLIBSUBDIRS)
-+endif
-+
- TEST_MODULES=@TEST_MODULES@
- libinstall:   all $(srcdir)/Modules/xxmodule.c
-       @for i in $(SCRIPTDIR) $(LIBDEST); \
-diff --git a/configure.ac b/configure.ac
-index 0ae9863cd6..201cad0bfc 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3565,15 +3565,23 @@ LIBS="$withval $LIBS"
- 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)
--AS_VAR_IF([with_system_expat], [yes], [
-+if test "$with_expat" != "none"; then
-+   EXPAT=yes
-+else
-+   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
-+   EXPAT=no
-+fi
-+AC_SUBST(EXPAT)
-+
-+AS_VAR_IF([with_expat], [system], [
-   LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
-   LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
-   LIBEXPAT_INTERNAL=
--- 
-2.34.1
-
diff --git a/package/python3/0016-Add-an-option-to-disable-unicodedata.patch b/package/python3/0016-Add-an-option-to-disable-unicodedata.patch
new file mode 100644 (file)
index 0000000..f5e57c1
--- /dev/null
@@ -0,0 +1,30 @@
+From 15490e1576d5836a7afc5a3eca75e087bb3f032e Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 23 Dec 2015 11:50:27 +0100
+Subject: [PATCH] Add an option to disable unicodedata
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 2faadb34f65..cb7e980e5b5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4251,6 +4251,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.44.0
+
diff --git a/package/python3/0017-Add-an-option-to-disable-CJK-codecs.patch b/package/python3/0017-Add-an-option-to-disable-CJK-codecs.patch
deleted file mode 100644 (file)
index 63a07fb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From d8ef6a7a9f2b954cf1c1e37fc3c35055b42af0f5 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Wed, 23 Dec 2015 11:49:55 +0100
-Subject: [PATCH] Add an option to disable CJK codecs
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 201cad0bfc..ecdd7dbc07 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4188,6 +4188,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.34.1
-
diff --git a/package/python3/0017-Add-an-option-to-disable-IDLE.patch b/package/python3/0017-Add-an-option-to-disable-IDLE.patch
new file mode 100644 (file)
index 0000000..f0af3f5
--- /dev/null
@@ -0,0 +1,92 @@
+From f74c580b9e5bd8c710627b48cea4e152426e71e6 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <[email protected]>
+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 <[email protected]>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <[email protected]>
+[ Adam Duskett: ported to Python 3.10.0 ]
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ 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 8e5f6762d20..4e407cbcfa9 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1875,7 +1875,9 @@ bininstall: commoninstall 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)
+@@ -1925,7 +1927,6 @@ LIBSUBDIRS=      asyncio \
+               ensurepip ensurepip/_bundled \
+               html \
+               http \
+-              idlelib idlelib/Icons \
+               importlib importlib/resources importlib/metadata \
+               json \
+               logging \
+@@ -2090,6 +2091,10 @@ ifeq (@EXPAT@,yes)
+ LIBSUBDIRS += $(XMLLIBSUBDIRS)
+ endif
++ifeq (@IDLE@,yes)
++LIBSUBDIRS += idlelib idlelib/Icons
++endif
++
+ TEST_MODULES=@TEST_MODULES@
+ libinstall:   all $(srcdir)/Modules/xxmodule.c
+       @for i in $(SCRIPTDIR) $(LIBDEST); \
+diff --git a/configure.ac b/configure.ac
+index cb7e980e5b5..fe497ec9dfb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7206,6 +7206,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/Setup.bootstrap Modules/Setup.stdlib])
+diff --git a/setup.py b/setup.py
+index e02591dae10..ada914c5501 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1598,11 +1598,14 @@ class DummyProcess:
+     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.44.0
+
diff --git a/package/python3/0018-Add-an-option-to-disable-NIS.patch b/package/python3/0018-Add-an-option-to-disable-NIS.patch
deleted file mode 100644 (file)
index 977955d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From 09fc9f72ebe60bb65e80732a6bd4f12a84159f6d Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index ecdd7dbc07..1bdde7f69d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4194,6 +4194,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.34.1
-
diff --git a/package/python3/0018-Add-an-option-to-disable-decimal.patch b/package/python3/0018-Add-an-option-to-disable-decimal.patch
new file mode 100644 (file)
index 0000000..dc966b9
--- /dev/null
@@ -0,0 +1,54 @@
+From 12b5db4e25182962eb0b8bc21479a743c35a158c Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+[[email protected]: Update for python 3.7.0]
+Signed-off-by: Adam Duskett <[email protected]>
+[[email protected]: adapt to python 3.9]
+Signed-off-by: James Hilliard <[email protected]>
+---
+ configure.ac | 19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fe497ec9dfb..20b3c2459f4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3680,14 +3680,21 @@ 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"])
+-AC_MSG_RESULT($with_system_libmpdec)
++            [with_libmpdec="builtin"])
++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], [
++AS_VAR_IF([with_libmpdec], [system], [
+   LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
+   LIBMPDEC_LDFLAGS=${LIBMPDEC_LDFLAGS-"-lmpdec"}
+   LIBMPDEC_INTERNAL=
+-- 
+2.44.0
+
diff --git a/package/python3/0019-Add-an-option-to-disable-the-ossaudiodev-module.patch b/package/python3/0019-Add-an-option-to-disable-the-ossaudiodev-module.patch
new file mode 100644 (file)
index 0000000..d05e0a8
--- /dev/null
@@ -0,0 +1,30 @@
+From 17d7b6d56cf554dcc6fcb263e1fd2b9e3dbf4320 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 23 Dec 2015 11:51:58 +0100
+Subject: [PATCH] Add an option to disable the ossaudiodev module
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 20b3c2459f4..87853f47329 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3728,6 +3728,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.44.0
+
diff --git a/package/python3/0019-Add-an-option-to-disable-unicodedata.patch b/package/python3/0019-Add-an-option-to-disable-unicodedata.patch
deleted file mode 100644 (file)
index 74702b6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 4fe7f375a3d171d294caebdd7b7ce49bbc9ad9f3 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Wed, 23 Dec 2015 11:50:27 +0100
-Subject: [PATCH] Add an option to disable unicodedata
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 1bdde7f69d..ba4b0e0c1c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4200,6 +4200,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.34.1
-
diff --git a/package/python3/0020-Add-an-option-to-disable-IDLE.patch b/package/python3/0020-Add-an-option-to-disable-IDLE.patch
deleted file mode 100644 (file)
index 09b5f13..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-From 2c9dbd6d49744aa8da8ebf8d0187d6b06f93c2b5 Mon Sep 17 00:00:00 2001
-From: Maxime Ripard <[email protected]>
-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 <[email protected]>
-[ Andrey Smirnov: ported to Python 3.6 ]
-Signed-off-by: Andrey Smirnov <[email protected]>
-[ Adam Duskett: ported to Python 3.10.0 ]
-Signed-off-by: Adam Duskett <[email protected]>
----
- 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 80d617cf7f..8d1ba1356c 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1862,7 +1862,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)
-@@ -1912,7 +1914,6 @@ LIBSUBDIRS=      asyncio \
-               ensurepip ensurepip/_bundled \
-               html \
-               http \
--              idlelib idlelib/Icons \
-               importlib importlib/resources importlib/metadata \
-               json \
-               logging \
-@@ -2030,6 +2031,10 @@ ifeq (@EXPAT@,yes)
- LIBSUBDIRS += $(XMLLIBSUBDIRS)
- endif
-+ifeq (@IDLE@,yes)
-+LIBSUBDIRS += idlelib idlelib/Icons
-+endif
-+
- TEST_MODULES=@TEST_MODULES@
- libinstall:   all $(srcdir)/Modules/xxmodule.c
-       @for i in $(SCRIPTDIR) $(LIBDEST); \
-diff --git a/configure.ac b/configure.ac
-index ba4b0e0c1c..5e6d72f7db 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -7137,6 +7137,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/Setup.bootstrap Modules/Setup.stdlib])
-diff --git a/setup.py b/setup.py
-index c490b0b08f..4d49a792f7 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1594,11 +1594,14 @@ class DummyProcess:
-     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.34.1
-
diff --git a/package/python3/0020-Add-an-option-to-disable-openssl-support.patch b/package/python3/0020-Add-an-option-to-disable-openssl-support.patch
new file mode 100644 (file)
index 0000000..6e95ae4
--- /dev/null
@@ -0,0 +1,30 @@
+From 959521c99fed46efab9bf0a1ae4b77b2365cf0d1 Mon Sep 17 00:00:00 2001
+From: Nicolas Cavallari <[email protected]>
+Date: Wed, 22 Feb 2017 17:55:59 -0800
+Subject: [PATCH] Add an option to disable openssl support.
+
+Signed-off-by: Nicolas Cavallari <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 87853f47329..3f8f0419767 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4270,6 +4270,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.44.0
+
diff --git a/package/python3/0021-Add-an-option-to-disable-decimal.patch b/package/python3/0021-Add-an-option-to-disable-decimal.patch
deleted file mode 100644 (file)
index d683565..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-From 7091fdf77f612425c178a75148560f9c3514e8b8 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
-[[email protected]: Update for python 3.7.0]
-Signed-off-by: Adam Duskett <[email protected]>
-[[email protected]: adapt to python 3.9]
-Signed-off-by: James Hilliard <[email protected]>
----
- configure.ac | 19 +++++++++++++------
- 1 file changed, 13 insertions(+), 6 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 5e6d72f7db..e6b1f1e9de 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3630,14 +3630,21 @@ 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"])
--AC_MSG_RESULT($with_system_libmpdec)
-+            [with_libmpdec="builtin"])
-+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], [
-+AS_VAR_IF([with_libmpdec], [system], [
-   LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
-   LIBMPDEC_LDFLAGS=${LIBMPDEC_LDFLAGS-"-lmpdec"}
-   LIBMPDEC_INTERNAL=
--- 
-2.34.1
-
diff --git a/package/python3/0021-Add-an-option-to-disable-the-readline-module.patch b/package/python3/0021-Add-an-option-to-disable-the-readline-module.patch
new file mode 100644 (file)
index 0000000..48b7f94
--- /dev/null
@@ -0,0 +1,30 @@
+From 3ea53d30005a06134a9ef05051493efb9c30712b Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Tue, 7 Mar 2017 23:29:05 +0100
+Subject: [PATCH] Add an option to disable the readline module
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 3f8f0419767..11a798b25bb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4276,6 +4276,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.44.0
+
diff --git a/package/python3/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch b/package/python3/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch
deleted file mode 100644 (file)
index 56713a7..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From d48d9da534cec7891ae444b4ab94a76ac67f5daa Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Wed, 23 Dec 2015 11:51:58 +0100
-Subject: [PATCH] Add an option to disable the ossaudiodev module
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index e6b1f1e9de..db33d567ad 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3678,6 +3678,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.34.1
-
diff --git a/package/python3/0022-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch b/package/python3/0022-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch
new file mode 100644 (file)
index 0000000..a1c5856
--- /dev/null
@@ -0,0 +1,42 @@
+From 32dfbdc953a8c992c2b7a5562b899cbc3a7a6e70 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+---
+ configure.ac | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 11a798b25bb..bd18ebe7582 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4282,6 +4282,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.44.0
+
diff --git a/package/python3/0023-Add-an-option-to-disable-openssl-support.patch b/package/python3/0023-Add-an-option-to-disable-openssl-support.patch
deleted file mode 100644 (file)
index d4c9fd4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 25c900e81a2fc0bbe35e7c94e2e5028cfbf6582a Mon Sep 17 00:00:00 2001
-From: Nicolas Cavallari <[email protected]>
-Date: Wed, 22 Feb 2017 17:55:59 -0800
-Subject: [PATCH] Add an option to disable openssl support.
-
-Signed-off-by: Nicolas Cavallari <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index db33d567ad..42fe6c8f5a 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4219,6 +4219,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.34.1
-
diff --git a/package/python3/0023-Add-an-option-to-disable-uuid-module.patch b/package/python3/0023-Add-an-option-to-disable-uuid-module.patch
new file mode 100644 (file)
index 0000000..ef791c5
--- /dev/null
@@ -0,0 +1,33 @@
+From 1bf575c16a957dfc5ee6913b462d24a4e882698e Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Sat, 18 Aug 2018 10:54:56 +0200
+Subject: [PATCH] Add an option to disable uuid module
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ configure.ac | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index bd18ebe7582..6205e6782cf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4318,6 +4318,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.44.0
+
diff --git a/package/python3/0024-Add-an-option-to-disable-the-readline-module.patch b/package/python3/0024-Add-an-option-to-disable-the-readline-module.patch
deleted file mode 100644 (file)
index 9250007..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 9082468ca620db77b670ccf568a96bbabb865f80 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Tue, 7 Mar 2017 23:29:05 +0100
-Subject: [PATCH] Add an option to disable the readline module
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 42fe6c8f5a..19875d7d30 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4225,6 +4225,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.34.1
-
diff --git a/package/python3/0024-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch b/package/python3/0024-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch
new file mode 100644 (file)
index 0000000..1b7b972
--- /dev/null
@@ -0,0 +1,51 @@
+From a1495856f48a8ce256d972f656184e38baced12e Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <[email protected]>
+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 <[email protected]>
+[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 6205e6782cf..da884ddf441 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1104,7 +1104,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.44.0
+
diff --git a/package/python3/0025-Add-an-option-to-disable-the-berkeleydb-module.patch b/package/python3/0025-Add-an-option-to-disable-the-berkeleydb-module.patch
new file mode 100644 (file)
index 0000000..80a0077
--- /dev/null
@@ -0,0 +1,30 @@
+From 7ee16a7096ccf9001f30b9076f562229efb9bcf3 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Sat, 11 Apr 2020 22:01:40 +0200
+Subject: [PATCH] Add an option to disable the berkeleydb module
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index da884ddf441..852cbaa6e4c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4331,6 +4331,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.44.0
+
diff --git a/package/python3/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch b/package/python3/0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch
deleted file mode 100644 (file)
index 70a0d6c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 988a335cb34b5fc25ea345ba04ff5ddffe2e946c Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-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 <[email protected]>
----
- configure.ac | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 19875d7d30..ca6c16491a 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4231,6 +4231,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.34.1
-
diff --git a/package/python3/0026-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch b/package/python3/0026-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch
new file mode 100644 (file)
index 0000000..b55e1a2
--- /dev/null
@@ -0,0 +1,42 @@
+From d6706e827f703c63ab519d104c53833fa5cebe03 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+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 <[email protected]>
+[Daniel: updated for 3.10.7]
+Signed-off-by: Daniel Lang <[email protected]>
+---
+ Lib/crypt.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Lib/crypt.py b/Lib/crypt.py
+index de4a14a3884..ba482487a7a 100644
+--- a/Lib/crypt.py
++++ b/Lib/crypt.py
+@@ -98,7 +98,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.44.0
+
diff --git a/package/python3/0027-Add-an-option-to-disable-uuid-module.patch b/package/python3/0027-Add-an-option-to-disable-uuid-module.patch
deleted file mode 100644 (file)
index a9501ec..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From 58027d25c3cabcf654cb0b31a61d7cbd53dc68c0 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Sat, 18 Aug 2018 10:54:56 +0200
-Subject: [PATCH] Add an option to disable uuid module
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- configure.ac | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index ca6c16491a..ed03b27fb1 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4267,6 +4267,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.34.1
-
diff --git a/package/python3/0027-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch b/package/python3/0027-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch
new file mode 100644 (file)
index 0000000..6c66a34
--- /dev/null
@@ -0,0 +1,140 @@
+From ffe5a060a1b24bedc2aac5d60d6b3b7e40f55adc Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <[email protected]>
+Date: Wed, 28 Feb 2024 13:55:04 -0600
+Subject: [PATCH] gh-115382: Fix cross compiles when host and target use same
+ SOABI
+
+Previously, when a build was configured to use a host interpreter via
+--with-build-python, the PYTHON_FOR_BUILD config value included a path
+in PYTHONPATH that pointed to the target's built external modules.
+
+For "normal" foreign architecture cross compiles, when loading compiled
+external libraries, the target libraries were processed first due to
+their precedence in sys.path. These libraries were then ruled out due to
+a mismatch in the SOABI so the import mechanism continued searching
+until it found the host's native modules.
+
+However, if the host interpreter and the target python were on the same
+version + SOABI combination, the host interpreter would attempt to load
+the target's external modules due to their precedence in sys.path.
+
+Despite the "match", the target build may have been linked against a
+different libc or may include unsupported instructions so loading or
+executing the target's external modules can lead to crashes.
+
+Now, the path to the target's external modules is no longer defined in
+PYTHONPATH to prevent accidentally loading these foreign modules.
+
+One caveat is that during certain build stages, the target's sysconfig
+module requires higher precedence than the host's version in order to
+accurately query the target build's configuration.
+
+This worked previously due to the target's sysconfig data module having
+precedence over the host's (see above). In order to keep this desired
+behavior, a new environment variable, _PYTHON_SYSCONFIGDATA_PATH, has
+been defined so sysconfig can search this directory for the target's
+sysconfig data.
+
+Signed-off-by: Vincent Fazio <[email protected]>
+Upstream-issue: https://github.com/python/cpython/issues/115382
+Upstream: https://github.com/python/cpython/pull/116294
+---
+ Lib/sysconfig.py             | 15 ++++++++++++++-
+ Lib/test/libregrtest/main.py |  1 +
+ Lib/test/pythoninfo.py       |  1 +
+ Tools/scripts/run_tests.py   |  1 +
+ configure                    |  2 +-
+ configure.ac                 |  2 +-
+ 6 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index ebe37118274..ba424236e11 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -528,7 +528,20 @@ def _init_posix(vars):
+     """Initialize the module as appropriate for POSIX systems."""
+     # _sysconfigdata is generated at build time, see _generate_posix_vars()
+     name = _get_sysconfigdata_name()
+-    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
++
++    # For cross builds, the path to the target's sysconfigdata must be specified
++    # so it can be imported. It cannot be in PYTHONPATH, as foreign modules in
++    # sys.path can cause crashes when loaded by the host interpreter.
++    # Rely on truthiness as a valueless env variable is still an empty string.
++    # See OS X note in _generate_posix_vars re _sysconfigdata.
++    if (path := os.environ.get('_PYTHON_SYSCONFIGDATA_PATH')):
++        from importlib.machinery import FileFinder, SourceFileLoader, SOURCE_SUFFIXES
++        from importlib.util import module_from_spec
++        spec = FileFinder(path, (SourceFileLoader, SOURCE_SUFFIXES)).find_spec(name)
++        _temp = module_from_spec(spec)
++        spec.loader.exec_module(_temp)
++    else:
++        _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+     build_time_vars = _temp.build_time_vars
+     vars.update(build_time_vars)
+diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
+index a9725fa9673..121e2e73938 100644
+--- a/Lib/test/libregrtest/main.py
++++ b/Lib/test/libregrtest/main.py
+@@ -519,6 +519,7 @@ def _add_cross_compile_opts(self, regrtest_opts):
+                 '_PYTHON_PROJECT_BASE',
+                 '_PYTHON_HOST_PLATFORM',
+                 '_PYTHON_SYSCONFIGDATA_NAME',
++                "_PYTHON_SYSCONFIGDATA_PATH",
+                 'PYTHONPATH'
+             }
+             old_environ = os.environ
+diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
+index 74ebb5e5b8a..fa7fbca34e1 100644
+--- a/Lib/test/pythoninfo.py
++++ b/Lib/test/pythoninfo.py
+@@ -326,6 +326,7 @@ def format_groups(groups):
+         "_PYTHON_HOST_PLATFORM",
+         "_PYTHON_PROJECT_BASE",
+         "_PYTHON_SYSCONFIGDATA_NAME",
++        "_PYTHON_SYSCONFIGDATA_PATH",
+         "__PYVENV_LAUNCHER__",
+         # Sanitizer options
+diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index 445a34ae3e8..4077a834245 100644
+--- a/Tools/scripts/run_tests.py
++++ b/Tools/scripts/run_tests.py
+@@ -42,6 +42,7 @@ def main(regrtest_args):
+             '_PYTHON_PROJECT_BASE',
+             '_PYTHON_HOST_PLATFORM',
+             '_PYTHON_SYSCONFIGDATA_NAME',
++            "_PYTHON_SYSCONFIGDATA_PATH",
+             'PYTHONPATH'
+         }
+         environ = {
+diff --git a/configure b/configure
+index cb3db60f9c2..5fc0cffa977 100755
+--- a/configure
++++ b/configure
+@@ -3262,7 +3262,7 @@ fi
+     fi
+         ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
+     PYTHON_FOR_FREEZE="$with_build_python"
+-    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
++    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) _PYTHON_SYSCONFIGDATA_PATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`) '$with_build_python
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_build_python" >&5
+ $as_echo "$with_build_python" >&6; }
+diff --git a/configure.ac b/configure.ac
+index 852cbaa6e4c..5ca316a948b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -162,7 +162,7 @@ AC_ARG_WITH(
+     dnl Build Python interpreter is used for regeneration and freezing.
+     ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
+     PYTHON_FOR_FREEZE="$with_build_python"
+-    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
++    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) _PYTHON_SYSCONFIGDATA_PATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`) '$with_build_python
+     AC_MSG_RESULT([$with_build_python])
+   ], [
+     AS_VAR_IF([cross_compiling], [yes],
+-- 
+2.44.0
+
diff --git a/package/python3/0029-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch b/package/python3/0029-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch
deleted file mode 100644 (file)
index 5253076..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From 07b950aadd570b9f96a1f128505a959b32f40962 Mon Sep 17 00:00:00 2001
-From: Peter Korsgaard <[email protected]>
-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 <[email protected]>
-[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 ed03b27fb1..841fd6732c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1086,7 +1086,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.34.1
-
diff --git a/package/python3/0030-Add-an-option-to-disable-the-berkeleydb-module.patch b/package/python3/0030-Add-an-option-to-disable-the-berkeleydb-module.patch
deleted file mode 100644 (file)
index 5fb436d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 67e9793d070ac5c8e83abbe95b9208533ffeadd0 Mon Sep 17 00:00:00 2001
-From: Bernd Kuhls <[email protected]>
-Date: Sat, 11 Apr 2020 22:01:40 +0200
-Subject: [PATCH] Add an option to disable the berkeleydb module
-
-Signed-off-by: Bernd Kuhls <[email protected]>
----
- configure.ac | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 841fd6732c..06c9a81f95 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4280,6 +4280,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.34.1
-
diff --git a/package/python3/0031-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch b/package/python3/0031-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch
deleted file mode 100644 (file)
index 712fd08..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 3edeed879871a10acbe802f4a68cff3d4869dbde Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-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 <[email protected]>
-[Daniel: updated for 3.10.7]
-Signed-off-by: Daniel Lang <[email protected]>
----
- Lib/crypt.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/Lib/crypt.py b/Lib/crypt.py
-index de4a14a388..ba482487a7 100644
---- a/Lib/crypt.py
-+++ b/Lib/crypt.py
-@@ -98,7 +98,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.34.1
-
diff --git a/package/python3/0032-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch b/package/python3/0032-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch
deleted file mode 100644 (file)
index 4d5afeb..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-From 8d8cc9087fd44c097775ca0a9ebb6c877605baec Mon Sep 17 00:00:00 2001
-From: Vincent Fazio <[email protected]>
-Date: Wed, 28 Feb 2024 13:55:04 -0600
-Subject: [PATCH] gh-115382: Fix cross compiles when host and target use same
- SOABI
-
-Previously, when a build was configured to use a host interpreter via
---with-build-python, the PYTHON_FOR_BUILD config value included a path
-in PYTHONPATH that pointed to the target's built external modules.
-
-For "normal" foreign architecture cross compiles, when loading compiled
-external libraries, the target libraries were processed first due to
-their precedence in sys.path. These libraries were then ruled out due to
-a mismatch in the SOABI so the import mechanism continued searching
-until it found the host's native modules.
-
-However, if the host interpreter and the target python were on the same
-version + SOABI combination, the host interpreter would attempt to load
-the target's external modules due to their precedence in sys.path.
-
-Despite the "match", the target build may have been linked against a
-different libc or may include unsupported instructions so loading or
-executing the target's external modules can lead to crashes.
-
-Now, the path to the target's external modules is no longer defined in
-PYTHONPATH to prevent accidentally loading these foreign modules.
-
-One caveat is that during certain build stages, the target's sysconfig
-module requires higher precedence than the host's version in order to
-accurately query the target build's configuration.
-
-This worked previously due to the target's sysconfig data module having
-precedence over the host's (see above). In order to keep this desired
-behavior, a new environment variable, _PYTHON_SYSCONFIGDATA_PATH, has
-been defined so sysconfig can search this directory for the target's
-sysconfig data.
-
-Signed-off-by: Vincent Fazio <[email protected]>
-Upstream-issue: https://github.com/python/cpython/issues/115382
-Upstream: https://github.com/python/cpython/pull/116294
----
- Lib/sysconfig.py             | 15 ++++++++++++++-
- Lib/test/libregrtest/main.py |  1 +
- Lib/test/pythoninfo.py       |  1 +
- Tools/scripts/run_tests.py   |  1 +
- configure                    |  2 +-
- configure.ac                 |  2 +-
- 6 files changed, 19 insertions(+), 3 deletions(-)
-
-diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
-index 6328ec41af..744f715fe2 100644
---- a/Lib/sysconfig.py
-+++ b/Lib/sysconfig.py
-@@ -535,7 +535,20 @@ def _init_posix(vars):
-     """Initialize the module as appropriate for POSIX systems."""
-     # _sysconfigdata is generated at build time, see _generate_posix_vars()
-     name = _get_sysconfigdata_name()
--    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
-+
-+    # For cross builds, the path to the target's sysconfigdata must be specified
-+    # so it can be imported. It cannot be in PYTHONPATH, as foreign modules in
-+    # sys.path can cause crashes when loaded by the host interpreter.
-+    # Rely on truthiness as a valueless env variable is still an empty string.
-+    # See OS X note in _generate_posix_vars re _sysconfigdata.
-+    if (path := os.environ.get('_PYTHON_SYSCONFIGDATA_PATH')):
-+        from importlib.machinery import FileFinder, SourceFileLoader, SOURCE_SUFFIXES
-+        from importlib.util import module_from_spec
-+        spec = FileFinder(path, (SourceFileLoader, SOURCE_SUFFIXES)).find_spec(name)
-+        _temp = module_from_spec(spec)
-+        spec.loader.exec_module(_temp)
-+    else:
-+        _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
-     build_time_vars = _temp.build_time_vars
-     vars.update(build_time_vars)
-diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
-index a9725fa967..121e2e7393 100644
---- a/Lib/test/libregrtest/main.py
-+++ b/Lib/test/libregrtest/main.py
-@@ -519,6 +519,7 @@ def _add_cross_compile_opts(self, regrtest_opts):
-                 '_PYTHON_PROJECT_BASE',
-                 '_PYTHON_HOST_PLATFORM',
-                 '_PYTHON_SYSCONFIGDATA_NAME',
-+                "_PYTHON_SYSCONFIGDATA_PATH",
-                 'PYTHONPATH'
-             }
-             old_environ = os.environ
-diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
-index 74ebb5e5b8..fa7fbca34e 100644
---- a/Lib/test/pythoninfo.py
-+++ b/Lib/test/pythoninfo.py
-@@ -326,6 +326,7 @@ def format_groups(groups):
-         "_PYTHON_HOST_PLATFORM",
-         "_PYTHON_PROJECT_BASE",
-         "_PYTHON_SYSCONFIGDATA_NAME",
-+        "_PYTHON_SYSCONFIGDATA_PATH",
-         "__PYVENV_LAUNCHER__",
-         # Sanitizer options
-diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
-index 445a34ae3e..4077a83424 100644
---- a/Tools/scripts/run_tests.py
-+++ b/Tools/scripts/run_tests.py
-@@ -42,6 +42,7 @@ def main(regrtest_args):
-             '_PYTHON_PROJECT_BASE',
-             '_PYTHON_HOST_PLATFORM',
-             '_PYTHON_SYSCONFIGDATA_NAME',
-+            "_PYTHON_SYSCONFIGDATA_PATH",
-             'PYTHONPATH'
-         }
-         environ = {
-diff --git a/configure b/configure
-index a1ad0ae251..0657162d1a 100755
---- a/configure
-+++ b/configure
-@@ -3262,7 +3262,7 @@ fi
-     fi
-         ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
-     PYTHON_FOR_FREEZE="$with_build_python"
--    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
-+    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) _PYTHON_SYSCONFIGDATA_PATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`) '$with_build_python
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_build_python" >&5
- $as_echo "$with_build_python" >&6; }
-diff --git a/configure.ac b/configure.ac
-index e5fb8bd99e..d444f5ec09 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -162,7 +162,7 @@ AC_ARG_WITH(
-     dnl Build Python interpreter is used for regeneration and freezing.
-     ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
-     PYTHON_FOR_FREEZE="$with_build_python"
--    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
-+    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) _PYTHON_SYSCONFIGDATA_PATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`) '$with_build_python
-     AC_MSG_RESULT([$with_build_python])
-   ], [
-     AS_VAR_IF([cross_compiling], [yes],
--- 
-2.34.1
-
This page took 0.143304 seconds and 4 git commands to generate.