From 61f1a970e829b750036d4f0a5ef1d479f148abc2 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 8 May 2023 23:42:37 +0800 Subject: [PATCH 1/8] python3: Remove --without-pymalloc --without-pymalloc was added in 7bf1ae65a89e380ce20ef5ab13b1a7276d6f7047 because leaving it enabled added an "m" flag/suffix to file names. This flag/suffix was removed in Python 3.8[1], so disabling pymalloc is no longer necessary. [1]: https://docs.python.org/3.8/whatsnew/3.8.html#build-and-c-api-changes Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 1fd8f43d1f54bc..328a5c920b29e8 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz @@ -160,7 +160,6 @@ CONFIGURE_ARGS+= \ --with-system-ffi \ --without-cxx-main \ --without-ensurepip \ - --without-pymalloc \ --disable-test-modules \ $(if $(CONFIG_IPV6),--enable-ipv6) \ $(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) \ @@ -335,7 +334,6 @@ HOST_CONFIGURE_ARGS+= \ --with-system-expat=$(STAGING_DIR_HOST) \ --with-ssl-default-suites=openssl \ --without-cxx-main \ - --without-pymalloc \ --disable-test-modules \ CONFIG_SITE= From 4d7693e22f781a758f569e746f7c11b3b0de1b86 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 12 May 2023 19:40:11 +0800 Subject: [PATCH 2/8] python3: Fix __pycache__ files included in python3-light 003-do-not-run-distutils-tests.patch was removed in 4e05541782edeb06b51d691dadf52648df24c940. This patch stopped "make install" from, among other things, running compileall. When this patch was removed, "make install" ran compileall as normal and created bytecode files in __pycache__ directories. These files were then packaged in python3-light. This adds a patch to stop compileall from being run during "make install". Fixes: 4e05541782ed ("python3: bump to version 3.10.0") Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 2 +- .../patches/003-do-not-run-compileall.patch | 18 ++++++++++++++++++ .../patches/016-adjust-config-paths.patch | 2 +- .../025-choose-python-config-version.patch | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 lang/python/python3/patches/003-do-not-run-compileall.patch diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 328a5c920b29e8..28d80b00dedb89 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz diff --git a/lang/python/python3/patches/003-do-not-run-compileall.patch b/lang/python/python3/patches/003-do-not-run-compileall.patch new file mode 100644 index 00000000000000..212b7720a7f4aa --- /dev/null +++ b/lang/python/python3/patches/003-do-not-run-compileall.patch @@ -0,0 +1,18 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1600,6 +1600,7 @@ libinstall: build_all $(srcdir)/Modules/ + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi ++ifeq (1,) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ +@@ -1627,6 +1628,7 @@ libinstall: build_all $(srcdir)/Modules/ + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages ++endif + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ diff --git a/lang/python/python3/patches/016-adjust-config-paths.patch b/lang/python/python3/patches/016-adjust-config-paths.patch index 641661f5cb1bd5..6c7e677001b5fd 100644 --- a/lang/python/python3/patches/016-adjust-config-paths.patch +++ b/lang/python/python3/patches/016-adjust-config-paths.patch @@ -19,7 +19,7 @@ $(DESTDIR)$(LIBDEST); \ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ -@@ -1751,7 +1751,7 @@ sharedinstall: sharedmods +@@ -1753,7 +1753,7 @@ sharedinstall: sharedmods --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ --root=$(DESTDIR)/ diff --git a/lang/python/python3/patches/025-choose-python-config-version.patch b/lang/python/python3/patches/025-choose-python-config-version.patch index b5a278d8e86315..15cfebd241b914 100644 --- a/lang/python/python3/patches/025-choose-python-config-version.patch +++ b/lang/python/python3/patches/025-choose-python-config-version.patch @@ -1,6 +1,6 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1643,7 +1643,7 @@ python-config: $(srcdir)/Misc/python-con +@@ -1645,7 +1645,7 @@ python-config: $(srcdir)/Misc/python-con @ # On Darwin, always use the python version of the script, the shell @ # version doesn't use the compiler customizations that are provided @ # in python (_osx_support.py). From 840247e390cfe87b62aecc9a2eff2836d6b35c55 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 18 May 2023 17:42:12 +0800 Subject: [PATCH 3/8] python3: Fix readelf program name not replaced in _sysconfigdata.py The Makefile lines to add READELF to TARGET_CONFIGURE_OPTS was removed in 4e05541782edeb06b51d691dadf52648df24c940. Without setting READELF, configure finds the symlink to $(TARGET_CROSS)readelf (e.g. arm-openwrt-linux-readelf) instead of $(TARGET_CROSS)readelf (e.g. arm-openwrt-linux-muslgnueabi-readelf). This leads to the symlink name being saved to _sysconfigdata.py, and so the readelf name is not replaced correctly (in Py3Package/python3-base/install). This restores the removed Makefile lines. Fixes: 4e05541782ed ("python3: bump to version 3.10.0") Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 28d80b00dedb89..eb2c4c8b26d009 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz @@ -138,6 +138,11 @@ define Package/python3/description It's python3-light + all other packages. endef +# Set READELF here so that the exact same readelf program name can be +# replaced in _sysconfigdata.py (in Py3Package/python3-base/install) +TARGET_CONFIGURE_OPTS+= \ + READELF="$(TARGET_CROSS)readelf" + EXTRA_LDFLAGS+= \ -L$(PKG_BUILD_DIR) \ -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib From c244106c7aaec1c6a211c2589049c5a3b5ab5c2a Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 20 May 2023 19:07:22 +0800 Subject: [PATCH 4/8] python3: Fix race condition when doing parallel builds When doing parallel builds, host Python can install the python3 symlink before the Python standard library is installed completely. When this occurs, it is possible for other packages to detect the python3 symlink and try to use host Python before it is fully installed. This adds a patch to make commoninstall (where the standard library is installed) a prerequisite of bininstall (where the python3 symlink is installed), so that commoninstall is fully completed before bininstall begins. Patch has been submitted upstream: https://github.com/python/cpython/pull/104693 Fixes: https://github.com/openwrt/packages/issues/19241 Signed-off-by: Jeffery To --- .../027-install-python3-symlink-after-stdlib.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch diff --git a/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch b/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch new file mode 100644 index 00000000000000..efd193a7dcaf4d --- /dev/null +++ b/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch @@ -0,0 +1,11 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1361,7 +1361,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK + $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ + fi + +-bininstall: altbininstall ++bininstall: commoninstall altbininstall + if test ! -d $(DESTDIR)$(LIBPC); then \ + echo "Creating directory $(LIBPC)"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \ From 9abd97457888c9b26562aad422d4f1db3bd3eff5 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 23 May 2023 17:49:43 +0800 Subject: [PATCH 5/8] python3: Fix multiarch/local paths added when building host Python By default, the Python build process will add /usr/local/{lib,include}, and multiarch paths (e.g. /usr/{lib,include}/x86_64-linux-gnu) if building on Debian/Ubuntu, to its library and includes paths. 006-remove-multi-arch-and-local-paths.patch was added in 84202f17e1aac6faf66b8d186f7c5c62b6f72ffb to stop the Python build process from adding these paths. 006-remove-multi-arch-and-local-paths.patch was removed in 48277ec9158151763239461c6f60808e38a99c2f. 006-do-not-add-multiarch-paths-when-cross-compiling.patch was added in 0c8b0b0bf727a57b0138a1425d2f32786dddd146 to stop the Python build process from adding these paths for target Python. These paths are still added by the Python build process when building host Python. This replaces the cross-compiling-only patch with the original patch, renamed slightly and adapted for Python 3.10. Fixes: 48277ec91581 ("python3: bump to version 3.8") Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 2 +- ...006-do-not-add-multiarch-local-paths.patch | 19 +++++++++++++++++++ ...multiarch-paths-when-cross-compiling.patch | 12 ------------ 3 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch delete mode 100644 lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index eb2c4c8b26d009..e27457051d9549 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz diff --git a/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch b/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch new file mode 100644 index 00000000000000..333370eb8d27c0 --- /dev/null +++ b/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch @@ -0,0 +1,19 @@ +--- a/setup.py ++++ b/setup.py +@@ -822,16 +822,9 @@ class PyBuildExt(build_ext): + add_dir_to_list(dir_list, directory) + + def configure_compiler(self): +- # Ensure that /usr/local is always used, but the local build +- # directories (i.e. '.' and 'Include') must be first. See issue +- # 10520. +- if not CROSS_COMPILING: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + # only change this for cross builds for 3.3, issues on Mageia + if CROSS_COMPILING: + self.add_cross_compiling_paths() +- self.add_multiarch_paths() + self.add_ldflags_cppflags() + + def init_inc_lib_dirs(self): diff --git a/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch b/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch deleted file mode 100644 index a2bb0fba0686ef..00000000000000 --- a/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -831,7 +831,8 @@ class PyBuildExt(build_ext): - # only change this for cross builds for 3.3, issues on Mageia - if CROSS_COMPILING: - self.add_cross_compiling_paths() -- self.add_multiarch_paths() -+ else: -+ self.add_multiarch_paths() - self.add_ldflags_cppflags() - - def init_inc_lib_dirs(self): From 4f68711d222d754d4558fb1bca1e4361c624b5b3 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 23 May 2023 19:12:27 +0800 Subject: [PATCH 6/8] python3: Fix uuid module not compiled for host Python This adds $(STAGING_DIR_HOST)/include/e2fsprogs to HOST_CFLAGS and HOST_CPPFLAGS so that configure can find uuid/uuid.h. Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index e27457051d9549..24e9a4a3a922c1 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz @@ -314,6 +314,13 @@ define Py3Package/python3/filespec -|$(PYTHON3_PKG_DIR) endef +# libuuid is provided by e2fsprogs and uuid/uuid.h is moved into +# $(STAGING_DIR_HOST)/include/e2fsprogs +HOST_CFLAGS += \ + -I$(STAGING_DIR_HOST)/include/e2fsprogs +HOST_CPPFLAGS += \ + -I$(STAGING_DIR_HOST)/include/e2fsprogs + HOST_LDFLAGS += \ -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib From 81835e1a3beb2f0ae231ea88e7d2c44c1f2341ff Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 22 May 2023 23:26:19 +0800 Subject: [PATCH 7/8] python3: Fix hashlib module not compiled for host Python 026-openssl-feature-flags.patch and 028-host-python-support-ssl-with-libressl.patch were removed in 4ecd9d67e90651a8e93760bf0b5771f7057c74a8 to fix the ssl module after libressl was upgraded to 3.7.0[1]. However, the cause of the ssl module build failure was only 028-host-python-support-ssl-with-libressl.patch. Removing 026-openssl-feature-flags.patch caused a build failure for the hashlib module. This restores 026-openssl-feature-flags.patch with an updated version of the patch from OpenBSD[2]. [1]: https://github.com/openwrt/packages/issues/20107 [2]: https://github.com/openbsd/ports/blob/26a04435bf2a09dcbe22b718bfee08997617a906/lang/python/3.10/patches/patch-Modules__hashopenssl_c Fixes: 4ecd9d67e906 ("python3: fix ssl support by removing libressl patches") Signed-off-by: Jeffery To --- lang/python/python3/Makefile | 2 +- .../patches/026-openssl-feature-flags.patch | 65 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 lang/python/python3/patches/026-openssl-feature-flags.patch diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 24e9a4a3a922c1..b1e292cbb3fdcb 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz diff --git a/lang/python/python3/patches/026-openssl-feature-flags.patch b/lang/python/python3/patches/026-openssl-feature-flags.patch new file mode 100644 index 00000000000000..2546048b0d7e8c --- /dev/null +++ b/lang/python/python3/patches/026-openssl-feature-flags.patch @@ -0,0 +1,65 @@ +--- a/Modules/_hashopenssl.c ++++ b/Modules/_hashopenssl.c +@@ -45,10 +45,18 @@ + + #define MUNCH_SIZE INT_MAX + ++#ifdef NID_id_scrypt + #define PY_OPENSSL_HAS_SCRYPT 1 ++#endif ++#ifdef NID_sha3_256 + #define PY_OPENSSL_HAS_SHA3 1 ++#endif ++#ifdef NID_shake256 + #define PY_OPENSSL_HAS_SHAKE 1 ++#endif ++#ifdef NID_blake2s256 + #define PY_OPENSSL_HAS_BLAKE2 1 ++#endif + + #if OPENSSL_VERSION_NUMBER >= 0x30000000L + #define PY_EVP_MD EVP_MD +@@ -120,19 +128,27 @@ static const py_hashentry_t py_hashes[] + PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384), + PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512), + /* truncated sha2 */ ++#ifdef NID_sha512_256 + PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224, NID_sha512_224), + PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256, NID_sha512_256), ++#endif + /* sha3 */ ++#ifdef PY_OPENSSL_HAS_SHA3 + PY_HASH_ENTRY(Py_hash_sha3_224, NULL, SN_sha3_224, NID_sha3_224), + PY_HASH_ENTRY(Py_hash_sha3_256, NULL, SN_sha3_256, NID_sha3_256), + PY_HASH_ENTRY(Py_hash_sha3_384, NULL, SN_sha3_384, NID_sha3_384), + PY_HASH_ENTRY(Py_hash_sha3_512, NULL, SN_sha3_512, NID_sha3_512), ++#endif + /* sha3 shake */ ++#ifdef PY_OPENSSL_HAS_SHAKE + PY_HASH_ENTRY(Py_hash_shake_128, NULL, SN_shake128, NID_shake128), + PY_HASH_ENTRY(Py_hash_shake_256, NULL, SN_shake256, NID_shake256), ++#endif + /* blake2 digest */ ++#ifdef PY_OPENSSL_HAS_BLAKE2 + PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256, NID_blake2s256), + PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512, NID_blake2b512), ++#endif + PY_HASH_ENTRY(NULL, NULL, NULL, 0), + }; + +@@ -873,11 +889,15 @@ py_evp_fromname(PyObject *module, const + goto exit; + } + ++#ifndef EVP_MD_FLAG_XOF ++ type = get_hashlib_state(module)->EVPtype; ++#else + if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) { + type = get_hashlib_state(module)->EVPXOFtype; + } else { + type = get_hashlib_state(module)->EVPtype; + } ++#endif + + self = newEVPobject(type); + if (self == NULL) { From df2d06a35d1497195bc51ee3c3672df89c82bee1 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 5 May 2023 17:23:49 +0800 Subject: [PATCH 8/8] python3: Update to 3.11.3, refresh/redo patches * Removed patches: * 001-enable-zlib.patch: zlib module should be enabled automatically * 007-distutils-do-not-adjust-path.patch: Not necessary since we process shebang lines for all scripts (in python3-package.mk) * 030-bpo-43112-detect-musl-as-a-separate-SOABI-GH-24502.patch: Already merged * Move configure vars from config.site back into Makefile Centralizing all build information into one file makes it easier to maintain * No longer set ac_cv_header_uuid_h=yes as configure should detect libuuid * Order configure args by enable-/disable-/with-/without-, then alphabetically * Set ac_cv_working_openssl_hashlib=yes for host configure to bypass the OpenSSL API tests with LibreSSL * Use the default Host/Compile recipe instead of picking out specific targets to make Signed-off-by: Jeffery To --- lang/python/python3-version.mk | 8 +- lang/python/python3/Makefile | 54 ++++++------- lang/python/python3/files/config.site | 13 ---- .../python3/files/python3-package-ctypes.mk | 2 +- .../python3/files/python3-package-readline.mk | 2 +- .../patches-pip/001-pep517-pyc-fix.patch | 27 ++++--- .../python3/patches/001-enable-zlib.patch | 11 --- .../patches/003-do-not-run-compileall.patch | 4 +- .../004-do-not-write-bytes-codes.patch | 2 +- ...006-do-not-add-multiarch-local-paths.patch | 2 +- .../007-distutils-do-not-adjust-path.patch | 10 --- .../008-distutils-use-python-sysroot.patch | 2 +- .../014-remove-platform-so-suffix.patch | 4 +- .../patches/016-adjust-config-paths.patch | 44 +++++------ .../025-choose-python-config-version.patch | 2 +- ...install-python3-symlink-after-stdlib.patch | 2 +- ...ct-musl-as-a-separate-SOABI-GH-24502.patch | 75 ------------------- ...itch-PLATFORM_TRIPLET-suffix-to-musl.patch | 4 +- 18 files changed, 86 insertions(+), 182 deletions(-) delete mode 100644 lang/python/python3/files/config.site delete mode 100644 lang/python/python3/patches/001-enable-zlib.patch delete mode 100644 lang/python/python3/patches/007-distutils-do-not-adjust-path.patch delete mode 100644 lang/python/python3/patches/030-bpo-43112-detect-musl-as-a-separate-SOABI-GH-24502.patch diff --git a/lang/python/python3-version.mk b/lang/python/python3-version.mk index d8e72df198e5bd..08bbe3d9a953b6 100644 --- a/lang/python/python3-version.mk +++ b/lang/python/python3-version.mk @@ -7,13 +7,13 @@ # Note: keep in sync with setuptools & pip PYTHON3_VERSION_MAJOR:=3 -PYTHON3_VERSION_MINOR:=10 -PYTHON3_VERSION_MICRO:=7 +PYTHON3_VERSION_MINOR:=11 +PYTHON3_VERSION_MICRO:=3 PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR) PYTHON3_SETUPTOOLS_PKG_RELEASE:=1 PYTHON3_PIP_PKG_RELEASE:=1 -PYTHON3_SETUPTOOLS_VERSION:=63.2.0 -PYTHON3_PIP_VERSION:=22.2.2 +PYTHON3_SETUPTOOLS_VERSION:=65.5.0 +PYTHON3_PIP_VERSION:=22.3.1 diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index b1e292cbb3fdcb..0a3e4cbc5c3577 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,12 +11,12 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=10 +PKG_RELEASE:=1 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION) -PKG_HASH:=6eed8415b7516fb2f260906db5d48dd4c06acc0cb24a7d6cc15296a604dcdc48 +PKG_HASH:=8a5db99c961a7ecf27c75956189c9602c968751f11dbeae2b900dbff1c085b5e PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=PSF-2.0 @@ -71,7 +71,7 @@ endef define Package/libpython3 $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) core library - DEPENDS:=+libpthread +zlib + DEPENDS:=+libpthread ABI_VERSION:=$(PYTHON3_VERSION) endef @@ -82,7 +82,7 @@ endef define Package/python3-base $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) interpreter - DEPENDS:=+libpthread +zlib +libpython3 + DEPENDS:=+libpython3 endef define Package/python3-base/description @@ -93,7 +93,7 @@ endef define Package/python3-light $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) light installation - DEPENDS:=+python3-base +libffi +libbz2 + DEPENDS:=+python3-base +libbz2 +zlib endef define Package/python3-light/config @@ -147,6 +147,18 @@ EXTRA_LDFLAGS+= \ -L$(PKG_BUILD_DIR) \ -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib +# Bypass configure tests for cross compilation +CONFIGURE_VARS += \ + ac_cv_buggy_getaddrinfo=no \ + ac_cv_file__dev_ptc=no \ + ac_cv_file__dev_ptmx=yes + +# Disable stdlib modules +# Check for a better way in the future: https://github.com/python/cpython/issues/98558 +CONFIGURE_VARS += \ + py_cv_module__tkinter=n/a \ + py_cv_module_nis=n/a + # Workaround for hardfloat mips # https://bugs.python.org/issue46265 ifneq ($(findstring mips,$(CONFIG_ARCH)),) @@ -159,22 +171,16 @@ endif MAKE_VARS += \ PYTHONSTRICTEXTENSIONBUILD=1 -CONFIGURE_ARGS+= \ +CONFIGURE_ARGS += \ --enable-optimizations \ --enable-shared \ + --disable-test-modules \ + --with-build-python \ --with-system-ffi \ --without-cxx-main \ --without-ensurepip \ - --disable-test-modules \ $(if $(CONFIG_IPV6),--enable-ipv6) \ - $(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) \ - CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \ - OPT="$(TARGET_CFLAGS)" - -define Build/Prepare - $(call Build/Prepare/Default) - $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site -endef + $(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) ifdef CONFIG_PACKAGE_python3-setuptools PYTHON3_SETUPTOOLS_BUILD:=1 @@ -333,6 +339,10 @@ endif # HOST_MAKE_VARS += \ # PYTHONSTRICTEXTENSIONBUILD=1 +# Bypass configure test +HOST_CONFIGURE_VARS += \ + ac_cv_working_openssl_hashlib=yes + ifeq ($(HOST_OS),Darwin) HOST_CONFIGURE_VARS += \ ac_cv_header_libintl_h=no @@ -340,25 +350,19 @@ HOST_MAKE_VARS += \ USE_PYTHON_CONFIG_PY=1 endif -HOST_CONFIGURE_ARGS+= \ +HOST_CONFIGURE_ARGS += \ --enable-optimizations \ + --disable-test-modules \ --with-ensurepip=upgrade \ - --with-system-expat=$(STAGING_DIR_HOST) \ --with-ssl-default-suites=openssl \ - --without-cxx-main \ - --disable-test-modules \ - CONFIG_SITE= + --with-system-expat \ + --without-cxx-main define Host/Configure $(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py $(call Host/Configure/Default) endef -define Host/Compile - $(call Host/Compile/Default,python) - $(call Host/Compile/Default,sharedmods) -endef - define Host/Install $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),, rm -rf \ diff --git a/lang/python/python3/files/config.site b/lang/python/python3/files/config.site deleted file mode 100644 index 65c2d958514b7f..00000000000000 --- a/lang/python/python3/files/config.site +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2007-2014 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -ac_cv_file__dev_ptmx=yes -ac_cv_file__dev_ptc=no -ac_cv_buggy_getaddrinfo=no -ac_cv_header_uuid_h=yes - diff --git a/lang/python/python3/files/python3-package-ctypes.mk b/lang/python/python3/files/python3-package-ctypes.mk index 90e8cefedcfd0b..e1bac47cdf4110 100644 --- a/lang/python/python3/files/python3-package-ctypes.mk +++ b/lang/python/python3/files/python3-package-ctypes.mk @@ -8,7 +8,7 @@ define Package/python3-ctypes $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) ctypes module - DEPENDS:=+python3-light + DEPENDS:=+python3-light +libffi endef $(eval $(call Py3BasePackage,python3-ctypes, \ diff --git a/lang/python/python3/files/python3-package-readline.mk b/lang/python/python3/files/python3-package-readline.mk index 4ce408db23507a..fbff134a34db53 100644 --- a/lang/python/python3/files/python3-package-readline.mk +++ b/lang/python/python3/files/python3-package-readline.mk @@ -8,7 +8,7 @@ define Package/python3-readline $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) readline module - DEPENDS:=+python3-light +libreadline +libncursesw + DEPENDS:=+python3-light +libreadline endef $(eval $(call Py3BasePackage,python3-readline, \ diff --git a/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch b/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch index e600b0a30e4b3b..df5f90cce178d0 100644 --- a/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch +++ b/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch @@ -1,16 +1,25 @@ diff --git a/pip/_vendor/pep517/in_process/__init__.py b/pip/_vendor/pep517/in_process/__init__.py -index c932313..a01143b 100644 +index 281a356cfe26..77acbfc2670b 100644 --- a/pip/_vendor/pep517/in_process/__init__.py +++ b/pip/_vendor/pep517/in_process/__init__.py -@@ -10,8 +10,13 @@ try: - import importlib.resources as resources - - def _in_proc_script_path(): -- return resources.path(__package__, '_in_process.py') -+ if resources.is_resource(__package__, '_in_process.py'): -+ return resources.path(__package__, '_in_process.py') -+ return resources.path(__package__, '_in_process.pyc') +@@ -14,13 +14,21 @@ try: + except AttributeError: + # Python 3.8 compatibility + def _in_proc_script_path(): +- return resources.path(__package__, '_in_process.py') ++ if resources.is_resource(__package__, '_in_process.py'): ++ return resources.path(__package__, '_in_process.py') ++ return resources.path(__package__, '_in_process.pyc') + else: + def _in_proc_script_path(): ++ if resources.files(__package__).joinpath('_in_process.py').is_file(): ++ return resources.as_file( ++ resources.files(__package__).joinpath('_in_process.py')) + return resources.as_file( +- resources.files(__package__).joinpath('_in_process.py')) ++ resources.files(__package__).joinpath('_in_process.pyc')) except ImportError: + # Python 3.6 compatibility @contextmanager def _in_proc_script_path(): - yield pjoin(dirname(abspath(__file__)), '_in_process.py') diff --git a/lang/python/python3/patches/001-enable-zlib.patch b/lang/python/python3/patches/001-enable-zlib.patch deleted file mode 100644 index 75766ee1961d46..00000000000000 --- a/lang/python/python3/patches/001-enable-zlib.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Modules/Setup -+++ b/Modules/Setup -@@ -343,7 +343,7 @@ _symtable symtablemodule.c - # Andrew Kuchling's zlib module. - # This require zlib 1.1.3 (or later). - # See http://www.gzip.org/zlib/ --#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz -+zlib zlibmodule.c -lz - - # Interface to the Expat XML parser - # More information on Expat can be found at www.libexpat.org. diff --git a/lang/python/python3/patches/003-do-not-run-compileall.patch b/lang/python/python3/patches/003-do-not-run-compileall.patch index 212b7720a7f4aa..9f0067b2590032 100644 --- a/lang/python/python3/patches/003-do-not-run-compileall.patch +++ b/lang/python/python3/patches/003-do-not-run-compileall.patch @@ -1,6 +1,6 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1600,6 +1600,7 @@ libinstall: build_all $(srcdir)/Modules/ +@@ -2084,6 +2084,7 @@ libinstall: all $(srcdir)/Modules/xxmodu $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ $(DESTDIR)$(LIBDEST)/distutils/tests ; \ fi @@ -8,7 +8,7 @@ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -j0 -d $(LIBDEST) -f \ -@@ -1627,6 +1628,7 @@ libinstall: build_all $(srcdir)/Modules/ +@@ -2111,6 +2112,7 @@ libinstall: all $(srcdir)/Modules/xxmodu $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ -j0 -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages diff --git a/lang/python/python3/patches/004-do-not-write-bytes-codes.patch b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch index 40b4e5b0c4e83a..6f01f9d8e3c0f6 100644 --- a/lang/python/python3/patches/004-do-not-write-bytes-codes.patch +++ b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch @@ -1,6 +1,6 @@ --- a/Python/initconfig.c +++ b/Python/initconfig.c -@@ -163,7 +163,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo +@@ -198,7 +198,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */ int Py_FrozenFlag = 0; /* Needed by getpath.c */ int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */ diff --git a/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch b/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch index 333370eb8d27c0..7b35eb7b4b1ab1 100644 --- a/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch +++ b/lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch @@ -1,6 +1,6 @@ --- a/setup.py +++ b/setup.py -@@ -822,16 +822,9 @@ class PyBuildExt(build_ext): +@@ -843,16 +843,9 @@ class PyBuildExt(build_ext): add_dir_to_list(dir_list, directory) def configure_compiler(self): diff --git a/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch b/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch deleted file mode 100644 index d4680cad48db3c..00000000000000 --- a/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/Lib/distutils/command/build_scripts.py -+++ b/Lib/distutils/command/build_scripts.py -@@ -91,6 +91,7 @@ class build_scripts(Command): - adjust = True - post_interp = match.group(1) or b'' - -+ adjust = 0 - if adjust: - log.info("copying and adjusting %s -> %s", script, - self.build_dir) diff --git a/lang/python/python3/patches/008-distutils-use-python-sysroot.patch b/lang/python/python3/patches/008-distutils-use-python-sysroot.patch index 26f22d7df1cf9a..c3e85629096e38 100644 --- a/lang/python/python3/patches/008-distutils-use-python-sysroot.patch +++ b/lang/python/python3/patches/008-distutils-use-python-sysroot.patch @@ -36,7 +36,7 @@ Signed-off-by: Thomas Petazzoni self.library_dirs.append('.') --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -123,10 +123,17 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib', +@@ -168,10 +168,17 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib', _PY_VERSION = sys.version.split()[0] _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}' _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}' diff --git a/lang/python/python3/patches/014-remove-platform-so-suffix.patch b/lang/python/python3/patches/014-remove-platform-so-suffix.patch index fc3aadbfca2cfe..8c23b83f3bcc33 100644 --- a/lang/python/python3/patches/014-remove-platform-so-suffix.patch +++ b/lang/python/python3/patches/014-remove-platform-so-suffix.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -15616,7 +15616,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; +@@ -20712,7 +20712,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; $as_echo "$ABIFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 $as_echo_n "checking SOABI... " >&6; } @@ -11,7 +11,7 @@ --- a/configure.ac +++ b/configure.ac -@@ -4824,7 +4824,7 @@ AC_SUBST(SOABI) +@@ -5684,7 +5684,7 @@ AC_SUBST(SOABI) AC_MSG_CHECKING(ABIFLAGS) AC_MSG_RESULT($ABIFLAGS) AC_MSG_CHECKING(SOABI) diff --git a/lang/python/python3/patches/016-adjust-config-paths.patch b/lang/python/python3/patches/016-adjust-config-paths.patch index 6c7e677001b5fd..a8ef48c7eaebdd 100644 --- a/lang/python/python3/patches/016-adjust-config-paths.patch +++ b/lang/python/python3/patches/016-adjust-config-paths.patch @@ -1,6 +1,6 @@ --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -407,6 +407,7 @@ def get_makefile_filename(): +@@ -461,6 +461,7 @@ def get_makefile_filename(): def _get_sysconfigdata_name(): @@ -10,7 +10,7 @@ '_PYTHON_SYSCONFIGDATA_NAME', --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1593,7 +1593,7 @@ libinstall: build_all $(srcdir)/Modules/ +@@ -2077,7 +2077,7 @@ libinstall: all $(srcdir)/Modules/xxmodu esac; \ done; \ done @@ -19,7 +19,7 @@ $(DESTDIR)$(LIBDEST); \ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ -@@ -1753,7 +1753,7 @@ sharedinstall: sharedmods +@@ -2239,7 +2239,7 @@ sharedinstall: all --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ --root=$(DESTDIR)/ @@ -30,16 +30,16 @@ # Here are a couple of targets for MacOSX again, to install a full --- a/configure +++ b/configure -@@ -3019,7 +3019,7 @@ $as_echo_n "checking for python interpre - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 - $as_echo "$interp" >&6; } -- 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) '$interp -+ 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 '$interp +@@ -3262,7 +3262,7 @@ fi fi - elif test "$cross_compiling" = maybe; then - as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5 -@@ -15686,7 +15686,7 @@ 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=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata '$with_build_python + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_build_python" >&5 + $as_echo "$with_build_python" >&6; } + +@@ -20782,7 +20782,7 @@ fi @@ -50,16 +50,16 @@ LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" --- a/configure.ac +++ b/configure.ac -@@ -82,7 +82,7 @@ if test "$cross_compiling" = yes; then - AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) - fi - AC_MSG_RESULT($interp) -- 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) '$interp -+ 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 '$interp - fi - elif test "$cross_compiling" = maybe; then - AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) -@@ -4882,7 +4882,7 @@ fi], +@@ -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=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata '$with_build_python + AC_MSG_RESULT([$with_build_python]) + ], [ + AS_VAR_IF([cross_compiling], [yes], +@@ -5742,7 +5742,7 @@ fi], dnl define LIBPL after ABIFLAGS and LDVERSION is defined. AC_SUBST(PY_ENABLE_SHARED) diff --git a/lang/python/python3/patches/025-choose-python-config-version.patch b/lang/python/python3/patches/025-choose-python-config-version.patch index 15cfebd241b914..80d9985fb7cf0b 100644 --- a/lang/python/python3/patches/025-choose-python-config-version.patch +++ b/lang/python/python3/patches/025-choose-python-config-version.patch @@ -1,6 +1,6 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1645,7 +1645,7 @@ python-config: $(srcdir)/Misc/python-con +@@ -2129,7 +2129,7 @@ python-config: $(srcdir)/Misc/python-con @ # On Darwin, always use the python version of the script, the shell @ # version doesn't use the compiler customizations that are provided @ # in python (_osx_support.py). diff --git a/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch b/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch index efd193a7dcaf4d..26241d03eafd24 100644 --- a/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch +++ b/lang/python/python3/patches/027-install-python3-symlink-after-stdlib.patch @@ -1,6 +1,6 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1361,7 +1361,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK +@@ -1839,7 +1839,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ fi diff --git a/lang/python/python3/patches/030-bpo-43112-detect-musl-as-a-separate-SOABI-GH-24502.patch b/lang/python/python3/patches/030-bpo-43112-detect-musl-as-a-separate-SOABI-GH-24502.patch deleted file mode 100644 index f22075e26d8e63..00000000000000 --- a/lang/python/python3/patches/030-bpo-43112-detect-musl-as-a-separate-SOABI-GH-24502.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 3f79de7b8411c76a1fcd1ca850ea62500be7a881 Mon Sep 17 00:00:00 2001 -From: Natanael Copa -Date: Sat, 29 Jan 2022 00:02:54 +0100 -Subject: [PATCH 1/2] bpo-43112: detect musl as a separate SOABI (GH-24502) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -musl libc and gnu libc are not ABI compatible so we need set different -SOABI for musl and not simply assume that all linux is linux-gnu. - -Replace linux-gnu with the detected os for the build from config.guess -for linux-musl*. - -(cherry picked from commit 1f036ede59e2c4befc07714cf76603c591d5c972) -Signed-off-by: Šimon Bořek ---- - Lib/test/test_sysconfig.py | 8 ++++---- - .../next/Build/2021-02-10-17-54-04.bpo-43112.H5Lat6.rst | 1 + - configure | 5 +++++ - configure.ac | 5 +++++ - 4 files changed, 15 insertions(+), 4 deletions(-) - create mode 100644 Misc/NEWS.d/next/Build/2021-02-10-17-54-04.bpo-43112.H5Lat6.rst - ---- a/Lib/test/test_sysconfig.py -+++ b/Lib/test/test_sysconfig.py -@@ -425,11 +425,11 @@ class TestSysConfig(unittest.TestCase): - self.assertTrue('linux' in suffix, suffix) - if re.match('(i[3-6]86|x86_64)$', machine): - if ctypes.sizeof(ctypes.c_char_p()) == 4: -- self.assertTrue(suffix.endswith('i386-linux-gnu.so') or -- suffix.endswith('x86_64-linux-gnux32.so'), -- suffix) -+ expected_suffixes = 'i386-linux-gnu.so', 'x86_64-linux-gnux32.so', 'i386-linux-musl.so' - else: # 8 byte pointer size -- self.assertTrue(suffix.endswith('x86_64-linux-gnu.so'), suffix) -+ expected_suffixes = 'x86_64-linux-gnu.so', 'x86_64-linux-musl.so' -+ self.assertTrue(suffix.endswith(expected_suffixes), -+ f'unexpected suffix {suffix!r}') - - @unittest.skipUnless(sys.platform == 'darwin', 'OS X-specific test') - def test_osx_ext_suffix(self): ---- /dev/null -+++ b/Misc/NEWS.d/next/Build/2021-02-10-17-54-04.bpo-43112.H5Lat6.rst -@@ -0,0 +1 @@ -+Detect musl libc as a separate SOABI (tagged as ``linux-musl``). -\ No newline at end of file ---- a/configure -+++ b/configure -@@ -5376,6 +5376,11 @@ EOF - - if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then - PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` -+ case "$build_os" in -+ linux-musl*) -+ PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` -+ ;; -+ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 - $as_echo "$PLATFORM_TRIPLET" >&6; } - else ---- a/configure.ac -+++ b/configure.ac -@@ -866,6 +866,11 @@ EOF - - if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then - PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` -+ case "$build_os" in -+ linux-musl*) -+ PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` -+ ;; -+ esac - AC_MSG_RESULT([$PLATFORM_TRIPLET]) - else - AC_MSG_RESULT([none]) diff --git a/lang/python/python3/patches/131-configure_ac-switch-PLATFORM_TRIPLET-suffix-to-musl.patch b/lang/python/python3/patches/131-configure_ac-switch-PLATFORM_TRIPLET-suffix-to-musl.patch index dfe8e06fe79c83..675682ab471275 100644 --- a/lang/python/python3/patches/131-configure_ac-switch-PLATFORM_TRIPLET-suffix-to-musl.patch +++ b/lang/python/python3/patches/131-configure_ac-switch-PLATFORM_TRIPLET-suffix-to-musl.patch @@ -27,7 +27,7 @@ Signed-off-by: Šimon Bořek --- a/configure +++ b/configure -@@ -5376,7 +5376,7 @@ EOF +@@ -6186,7 +6186,7 @@ EOF if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` @@ -38,7 +38,7 @@ Signed-off-by: Šimon Bořek ;; --- a/configure.ac +++ b/configure.ac -@@ -866,7 +866,7 @@ EOF +@@ -1081,7 +1081,7 @@ EOF if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`