python3: bump to version 3.13.9

Explicitly disable readline and tkinter modules for host-build.
Host-build will not build if these fail.
  - readline isn't a hard requirement for host-python; some minor lack of
    functionality would be felt, but nothing terrible
  - tkinter is also disabled on the target; but for the host-python we
    don't need it either

Dropped patch: 010-no-ncursesw.patch
  - Since we're disabling readline in the host build

Drop setuptools from python3 - the only reason we kept it there, was
because it was required by pip; pip is still there and seems to install and
work fine without setuptools. There's also a separate setuptools package in
openwrt anyway:
  https://github.com/openwrt/packages/tree/master/lang/python/python-setuptools
Also, Python no longer installs it:
  https://github.com/python/cpython/issues/95299

Drop python3-cgi - 08d5923896
Drop distutils - 0faa0ba240
Drop lib2to3 - ae00b810d1

Drop patch: 0001-Adjust-library-header-paths-for-cross-compilation.patch
  - A lot of stuff has changed regarding cross-compilation; at this point
    it's unclear what we need moving forward.

Drop patch: 006-do-not-add-multiarch-local-paths.patch
  - setup.py went away, so no idea if this is needed anymore

Re-applied: 003-do-not-run-compileall.patch

Drop: 008-distutils-use-python-sysroot.patch
  - Buildroot seems to have also dropped this; this patch is from them

Added: 09-don-t-run-profile-task-during-cross-build.patch
  - For cross_compilation, running the profile-task will not work, it also
    mentions this in a comment, but nobody dared to patch it yet (at least
    in this release (3.13.9)

Re-applied: 026-openssl-feature-flags.patch
  - This could have been dropped completely, but upstream decided to keep
    scrypt on by default; for host-build this fails, because OpenWrt keeps
    libressl

Drop patch: 100-gh-95855-Refactor-platform-triplet-detection-code-GH-107221.patch
  - This was a backport; it probably should have been removed sooner

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>

wip
This commit is contained in:
Alexandru Ardelean
2024-11-24 10:59:27 +02:00
committed by Hannu Nyman
parent e3a1f5b0b9
commit 97a92f2e7a
17 changed files with 61 additions and 818 deletions

View File

@@ -16,9 +16,9 @@ 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:=8d3ed8ec5c88c1c95f5e558612a725450d2452813ddad5e58fdb1a53b1209b78
PKG_HASH:=ed5ef34cda36cfa2f3a340f07cac7e7814f91c7f3c411f6d3562323a866c5c66
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=Python-2.0.1 0BSD
PKG_LICENSE_FILES:=LICENSE Doc/copyright.rst Doc/license.rst Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi_osx/LICENSE Modules/expat/COPYING
PKG_CPE_ID:=cpe:/a:python:python
@@ -41,7 +41,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=bluez python3/host python-build/host python-installer/host python-wheel/host
HOST_BUILD_DEPENDS:=bzip2/host libffi/host readline/host
HOST_BUILD_DEPENDS:=bzip2/host libffi/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
@@ -244,7 +244,8 @@ PYTHON3_BASE_LIB_FILES:= \
/usr/lib/python$(PYTHON3_VERSION)/os.py \
/usr/lib/python$(PYTHON3_VERSION)/posixpath.py \
/usr/lib/python$(PYTHON3_VERSION)/site.py \
/usr/lib/python$(PYTHON3_VERSION)/sysconfig.py \
/usr/lib/python$(PYTHON3_VERSION)/sysconfig/__init__.py \
/usr/lib/python$(PYTHON3_VERSION)/sysconfig/__main__.py \
/usr/lib/python$(PYTHON3_VERSION)/stat.py
PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
@@ -258,7 +259,6 @@ endef
define Py3Package/python3-light/filespec
+|/usr/lib/python$(PYTHON3_VERSION)
-|/usr/lib/python$(PYTHON3_VERSION)/distutils/cygwinccompiler.py
-|/usr/lib/python$(PYTHON3_VERSION)/idlelib
-|/usr/lib/python$(PYTHON3_VERSION)/tkinter
-|/usr/lib/python$(PYTHON3_VERSION)/turtledemo
@@ -295,6 +295,7 @@ endif
# Bypass configure test
HOST_CONFIGURE_VARS += \
py_cv_module__tkinter=n/a \
ac_cv_working_openssl_hashlib=yes
ifeq ($(HOST_OS),Darwin)
@@ -305,6 +306,7 @@ HOST_MAKE_VARS += \
endif
HOST_CONFIGURE_ARGS += \
--with-readline=no \
--enable-optimizations \
--disable-test-modules \
--with-ensurepip=upgrade \
@@ -320,19 +322,10 @@ HOST_CFLAGS += \
define Host/Configure
$(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py
$(call Host/Configure/Default)
ls $(HOST_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl
ls $(HOST_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl
endef
define Host/Install
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),,
rm -rf \
$(HOST_PYTHON3_PKG_DIR)/pkg_resources \
$(HOST_PYTHON3_PKG_DIR)/setuptools \
$(HOST_PYTHON3_PKG_DIR)/setuptools-* \
$(HOST_PYTHON3_PKG_DIR)/.setuptools-patched* \
$(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_*
)
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),,
rm -rf \
$(HOST_PYTHON3_PKG_DIR)/pip \
@@ -341,10 +334,6 @@ define Host/Install
$(HOST_PYTHON3_PKG_DIR)/.pip_installed_*
)
$(call Host/Install/Default)
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),,
$(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-setuptools,)
touch $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)
)
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),,
$(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-pip,)
touch $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)