From 095214d7d24b29cf29bc19c6621ec8ee2a813ea1 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 4 Nov 2022 10:37:19 +0000 Subject: [PATCH] Python3: rework buildroot 3.10.8 patches to 3.11.0 --- ...taddrinfo-configure-test-when-cross-.patch | 14 +++--- ...re-to-disable-the-build-of-certain-e.patch | 14 +++--- ...ook-in-usr-lib-termcap-for-libraries.patch | 2 +- .../0011-Add-an-option-to-disable-pydoc.patch | 4 +- ...012-Add-an-option-to-disable-lib2to3.patch | 6 +-- ...option-to-disable-the-sqlite3-module.patch | 12 +----- ...d-an-option-to-disable-the-tk-module.patch | 4 +- .../0016-Add-an-option-to-disable-expat.patch | 14 ------ .../0020-Add-an-option-to-disable-IDLE.patch | 2 +- ...021-Add-an-option-to-disable-decimal.patch | 20 ++------- ...on-to-disable-the-ossaudiodev-module.patch | 6 +-- ...-Fix-cross-compiling-the-uuid-module.patch | 43 ------------------- ...-fix-building-on-older-distributions.patch | 38 ---------------- 13 files changed, 31 insertions(+), 148 deletions(-) delete mode 100644 packages/lang/Python3/patches/0027-Fix-cross-compiling-the-uuid-module.patch delete mode 100644 packages/lang/Python3/patches/0029-fix-building-on-older-distributions.patch diff --git a/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch b/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch index 411b8dae4e..77b5a977f7 100644 --- a/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch +++ b/packages/lang/Python3/patches/0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch @@ -13,15 +13,15 @@ diff --git a/configure.ac b/configure.ac index 1ee5a09588..c2445edc88 100644 --- a/configure.ac +++ b/configure.ac -@@ -4230,7 +4230,7 @@ fi +@@ -5086,7 +5086,7 @@ fi + dnl if ac_cv_func_getaddrinfo + ]) - AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) - --if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes -+if test $have_getaddrinfo = no || test "$cross_compiling" != "yes" -a "$ac_cv_buggy_getaddrinfo" = yes +-if test "$ac_cv_func_getaddrinfo" = no -o "$ac_cv_buggy_getaddrinfo" = yes ++if test "$ac_cv_func_getaddrinfo" = no || test "$cross_compiling" != "yes" -a "$ac_cv_buggy_getaddrinfo" = yes then - if test $ipv6 = yes - then + AS_VAR_IF([ipv6], [yes], [ + AC_MSG_ERROR([m4_normalize([ -- 2.25.1 diff --git a/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch b/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch index 7ac0f39d06..10762cb1a9 100644 --- a/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch +++ b/packages/lang/Python3/patches/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch @@ -47,7 +47,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 0c809f3d8a..7c3dde8dd4 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -218,6 +218,8 @@ FILEMODE= 644 +@@ -239,6 +239,8 @@ FILEMODE= 644 # configure script arguments CONFIG_ARGS= @CONFIG_ARGS@ @@ -56,18 +56,18 @@ index 0c809f3d8a..7c3dde8dd4 100644 # Subdirectories with code SRCDIRS= @SRCDIRS@ -@@ -628,6 +630,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -739,6 +741,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + *) quiet="";; \ esac; \ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ - $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ -@@ -1748,7 +1751,8 @@ libainstall: @DEF_MAKE_RULE@ python-config + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' + +@@ -2228,7 +2231,8 @@ libainstall: @DEF_MAKE_RULE@ python-config # Install the dynamically loadable modules # This goes into $(exec_prefix) - sharedinstall: sharedmods + sharedinstall: all - $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ diff --git a/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch b/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch index 3e224995a5..c5b6460e7c 100644 --- a/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch +++ b/packages/lang/Python3/patches/0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch @@ -23,9 +23,9 @@ index 66d372a..e632b6f 100644 readline_libs.append('termcap') self.add(Extension('readline', ['readline.c'], - library_dirs=['/usr/lib/termcap'], - extra_link_args=readline_extra_link_args, libraries=readline_libs)) else: + self.missing.append('readline') -- 2.25.1 diff --git a/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch b/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch index a843c8c126..299110464c 100644 --- a/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch +++ b/packages/lang/Python3/patches/0011-Add-an-option-to-disable-pydoc.patch @@ -33,12 +33,12 @@ index c0d5511..32b3df7 100644 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ @@ -1442,7 +1444,6 @@ LIBSUBDIRS= asyncio \ - lib2to3 lib2to3/fixes lib2to3/pgen2 \ + json \ logging \ multiprocessing multiprocessing/dummy \ - pydoc_data \ + re \ site-packages \ - sqlite3 \ tkinter \ @@ -1530,6 +1531,10 @@ TESTSUBDIRS= ctypes/test \ tkinter/test/test_ttk \ diff --git a/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch b/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch index c8f2e528bf..8155250e5a 100644 --- a/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch +++ b/packages/lang/Python3/patches/0012-Add-an-option-to-disable-lib2to3.patch @@ -34,12 +34,12 @@ index 28cf88e..63fa9fb 100644 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \ @@ -1441,7 +1443,6 @@ LIBSUBDIRS= asyncio \ idlelib idlelib/Icons \ - importlib importlib/metadata \ + importlib importlib/resources importlib/metadata \ json \ - lib2to3 lib2to3/fixes lib2to3/pgen2 \ logging \ multiprocessing multiprocessing/dummy \ - site-packages \ + re \ @@ -1458,10 +1459,6 @@ LIBSUBDIRS= asyncio \ TESTSUBDIRS= ctypes/test \ distutils/tests \ @@ -48,9 +48,9 @@ index 28cf88e..63fa9fb 100644 - lib2to3/tests/data \ - lib2to3/tests/data/fixers \ - lib2to3/tests/data/fixers/myfixes \ - sqlite3/test \ test test/audiodata \ test/capath test/cjkencodings \ + test/data test/decimaltestdata \ @@ -1535,6 +1532,14 @@ ifeq (@PYDOC@,yes) LIBSUBDIRS += pydoc_data endif diff --git a/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch b/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch index 81fa52bb73..a03334e667 100644 --- a/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch +++ b/packages/lang/Python3/patches/0013-Add-option-to-disable-the-sqlite3-module.patch @@ -18,7 +18,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in index 5847029..5628860 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1446,7 +1446,6 @@ LIBSUBDIRS= asyncio \ +@@ -1920,7 +1920,6 @@ LIBSUBDIRS= asyncio \ logging \ multiprocessing multiprocessing/dummy \ site-packages \ @@ -26,15 +26,7 @@ index 5847029..5628860 100644 tkinter \ turtledemo \ unittest \ -@@ -1459,7 +1458,6 @@ LIBSUBDIRS= asyncio \ - TESTSUBDIRS= ctypes/test \ - distutils/tests \ - idlelib/idle_test \ -- sqlite3/test \ - test test/audiodata \ - test/capath test/cjkencodings \ - test/data test/decimaltestdata \ -@@ -1540,6 +1538,11 @@ TESTSUBDIRS += lib2to3/tests \ +@@ -2021,6 +2020,11 @@ TESTSUBDIRS += lib2to3/tests \ lib2to3/tests/data/fixers/myfixes endif diff --git a/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch b/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch index db79f5691f..0d8dac6cf5 100644 --- a/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch +++ b/packages/lang/Python3/patches/0014-Add-an-option-to-disable-the-tk-module.patch @@ -19,13 +19,13 @@ index 5628860..c968113 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1446,7 +1446,6 @@ LIBSUBDIRS= asyncio \ - logging \ multiprocessing multiprocessing/dummy \ + re \ site-packages \ - tkinter \ + tomllib \ turtledemo \ unittest \ - urllib \ @@ -1522,8 +1521,6 @@ TESTSUBDIRS= ctypes/test \ test/tracedmodules \ test/xmltestdata test/xmltestdata/c14n-20 \ diff --git a/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch b/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch index 83c89e1f68..854292ef58 100644 --- a/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch +++ b/packages/lang/Python3/patches/0016-Add-an-option-to-disable-expat.patch @@ -75,19 +75,5 @@ index 4f1cda5..e99a174 100644 # Check for use of the system libffi library AC_MSG_CHECKING(for --with-system-ffi) -diff --git a/setup.py b/setup.py -index 663fd44..e30ed52 100644 ---- a/setup.py -+++ b/setup.py -@@ -1764,7 +1764,7 @@ class PyBuildExt(build_ext): - # - # More information on Expat can be found at www.libexpat.org. - # -- if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"): -+ if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"): - expat_inc = [] - define_macros = [] - extra_compile_args = [] -- 2.30.2 - diff --git a/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch b/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch index f09037f7db..08d733fb06 100644 --- a/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch +++ b/packages/lang/Python3/patches/0020-Add-an-option-to-disable-IDLE.patch @@ -36,7 +36,7 @@ index 08c5e8a..461c5e3 100644 html \ http \ - idlelib idlelib/Icons \ - importlib importlib/metadata \ + importlib importlib/resources importlib/metadata \ json \ logging \ @@ -1552,6 +1553,10 @@ ifeq (@EXPAT@,yes) diff --git a/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch b/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch index fd1887d603..dfe4ff9a6d 100644 --- a/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch +++ b/packages/lang/Python3/patches/0021-Add-an-option-to-disable-decimal.patch @@ -22,7 +22,7 @@ diff --git a/configure.ac b/configure.ac index 7bd4623ccd..e513ef6a20 100644 --- a/configure.ac +++ b/configure.ac -@@ -3145,13 +3145,20 @@ fi +@@ -3145,12 +3145,19 @@ fi AC_SUBST(LIBFFI_INCLUDEDIR) # Check for use of the system libmpdec library @@ -35,7 +35,6 @@ index 7bd4623ccd..e513ef6a20 100644 [], - [with_system_libmpdec="no"]) + [with_libmpdec="builtin"]) - -AC_MSG_RESULT($with_system_libmpdec) +AC_MSG_RESULT($with_libmpdec) +if test "$with_libmpdec" != "none"; then @@ -46,21 +45,8 @@ index 7bd4623ccd..e513ef6a20 100644 +fi +AC_SUBST(MPDEC) - # Check whether _decimal should use a coroutine-local or thread-local context - AC_MSG_CHECKING(for --with-decimal-contextvar) -diff --git a/setup.py b/setup.py -index c4ee989ba3..3d0c74bb7f 100644 ---- a/setup.py -+++ b/setup.py -@@ -2321,7 +2321,7 @@ class PyBuildExt(build_ext): - # Stefan Krah's _decimal module - extra_compile_args = [] - undef_macros = [] -- if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): -+ if '--with-libmpdec=system' in sysconfig.get_config_var("CONFIG_ARGS"): - include_dirs = [] - libraries = ['mpdec'] - sources = ['_decimal/_decimal.c'] + AS_VAR_IF([with_system_libmpdec], [yes], [ + LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""} -- 2.25.1 diff --git a/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch b/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch index 0459b5a14d..d367cb4499 100644 --- a/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch +++ b/packages/lang/Python3/patches/0022-Add-an-option-to-disable-the-ossaudiodev-module.patch @@ -22,9 +22,9 @@ index e513ef6a20..c07505e89e 100644 + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ossaudiodev" + fi]) + - # Check for support for loadable sqlite extensions - AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions) - AC_ARG_ENABLE(loadable-sqlite-extensions, + # Check for libmpdec machine flavor + AC_MSG_CHECKING(for decimal libmpdec machine) + AS_CASE([$ac_sys_system], -- 2.25.1 diff --git a/packages/lang/Python3/patches/0027-Fix-cross-compiling-the-uuid-module.patch b/packages/lang/Python3/patches/0027-Fix-cross-compiling-the-uuid-module.patch deleted file mode 100644 index d19aedb6c1..0000000000 --- a/packages/lang/Python3/patches/0027-Fix-cross-compiling-the-uuid-module.patch +++ /dev/null @@ -1,43 +0,0 @@ -From d7b90b157eddefbd0ed59e35c90b083c0c03b644 Mon Sep 17 00:00:00 2001 -From: Adam Duskett -Date: Fri, 20 Jul 2018 10:17:39 -0400 -Subject: [PATCH] Fix cross compiling the uuid module - -Python 3.7 has a new _uuid module, however, the include directory -search path for uuid.h is hardcoded to /usr/include/uuid, which should -not be used when cross-compiling. - -To fix this, use the same solution as the one used by the NIS -detection: append "uuid" to each of the include directories in -"inc_dirs", instead of hardcoding /usr/include/uuid. - -Signed-off-by: Adam Duskett -[Thomas: drop STAGING_DIR based solution, use a solution similar to -the one used for the NIS detection.] -Signed-off-by: Thomas Petazzoni ---- - setup.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 3d0c74bb7f..c7be85f352 100644 ---- a/setup.py -+++ b/setup.py -@@ -1866,10 +1866,10 @@ class PyBuildExt(build_ext): - - def detect_uuid(self): - # Build the _uuid module if possible -- uuid_h = sysconfig.get_config_var("HAVE_UUID_H") -- uuid_uuid_h = sysconfig.get_config_var("HAVE_UUID_UUID_H") -- if uuid_h or uuid_uuid_h: -- if sysconfig.get_config_var("HAVE_LIBUUID"): -+ uuid_h = find_file("uuid.h", self.inc_dirs, -+ [os.path.join(inc_dir, 'uuid') for inc_dir in self.inc_dirs]) -+ if uuid_h is not None: -+ if self.compiler.find_library_file(self.lib_dirs, 'uuid'): - uuid_libs = ["uuid"] - else: - uuid_libs = [] --- -2.25.1 - diff --git a/packages/lang/Python3/patches/0029-fix-building-on-older-distributions.patch b/packages/lang/Python3/patches/0029-fix-building-on-older-distributions.patch deleted file mode 100644 index fb59e593f4..0000000000 --- a/packages/lang/Python3/patches/0029-fix-building-on-older-distributions.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 94c62f96ca61f1a28124c837d7ec5ed0b9ae8786 Mon Sep 17 00:00:00 2001 -From: Adam Duskett -Date: Thu, 16 Aug 2018 14:52:37 -0700 -Subject: [PATCH] fix building on older distributions - -Python > 3.6.3 calls os.replace in the update_file.py script, during the -regen-importlib phase of the build process. - -According to Doc/whatsnew/3.3.rst line 1631, os.replace acts in the same -way as os.rename, however, it is now cross-platform compatible for Windows. - -Because BuildRoot is guaranteed only to be built in POSIX environment, it is -safe to change os.replace back to os.rename. - -This change fixes building on older systems such as CentOS7, that only come -with python 2. - -Signed-off-by: Adam Duskett ---- - Tools/scripts/update_file.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Tools/scripts/update_file.py b/Tools/scripts/update_file.py -index 224585c69b..ef458c0c63 100644 ---- a/Tools/scripts/update_file.py -+++ b/Tools/scripts/update_file.py -@@ -16,7 +16,7 @@ def main(old_path, new_path): - with open(new_path, 'rb') as f: - new_contents = f.read() - if old_contents != new_contents: -- os.replace(new_path, old_path) -+ os.rename(new_path, old_path) - else: - os.unlink(new_path) - --- -2.25.1 -