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 <jeffery.to@gmail.com>
(cherry picked from commit 2445fe9fb2)
This commit is contained in:
Jeffery To
2023-05-05 17:23:49 +08:00
parent cc000a1a2c
commit 24aa47eb2b
18 changed files with 87 additions and 183 deletions

View File

@@ -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 <jeffery.to@gmail.com>
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 \
--with-ensurepip=upgrade \
--with-system-expat=$(STAGING_DIR_HOST) \
--with-ssl-default-suites=openssl \
--without-cxx-main \
--disable-test-modules \
CONFIG_SITE=
--with-ensurepip=upgrade \
--with-ssl-default-suites=openssl \
--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 \