Skip to content

Commit 2445fe9

Browse files
jefferytoneheb
authored andcommitted
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 <[email protected]>
1 parent 02eb5c1 commit 2445fe9

18 files changed

Lines changed: 86 additions & 182 deletions

lang/python/python3-version.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
# Note: keep in sync with setuptools & pip
99
PYTHON3_VERSION_MAJOR:=3
10-
PYTHON3_VERSION_MINOR:=10
11-
PYTHON3_VERSION_MICRO:=7
10+
PYTHON3_VERSION_MINOR:=11
11+
PYTHON3_VERSION_MICRO:=3
1212

1313
PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
1414

1515
PYTHON3_SETUPTOOLS_PKG_RELEASE:=1
1616
PYTHON3_PIP_PKG_RELEASE:=1
1717

18-
PYTHON3_SETUPTOOLS_VERSION:=63.2.0
19-
PYTHON3_PIP_VERSION:=22.2.2
18+
PYTHON3_SETUPTOOLS_VERSION:=65.5.0
19+
PYTHON3_PIP_VERSION:=22.3.1

lang/python/python3/Makefile

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ include $(TOPDIR)/rules.mk
1111
include ../python3-version.mk
1212

1313
PKG_NAME:=python3
14-
PKG_RELEASE:=10
14+
PKG_RELEASE:=1
1515
PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO)
1616

1717
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
1818
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
19-
PKG_HASH:=6eed8415b7516fb2f260906db5d48dd4c06acc0cb24a7d6cc15296a604dcdc48
19+
PKG_HASH:=8a5db99c961a7ecf27c75956189c9602c968751f11dbeae2b900dbff1c085b5e
2020

2121
PKG_MAINTAINER:=Jeffery To <[email protected]>
2222
PKG_LICENSE:=PSF-2.0
@@ -71,7 +71,7 @@ endef
7171
define Package/libpython3
7272
$(call Package/python3/Default)
7373
TITLE:=Python $(PYTHON3_VERSION) core library
74-
DEPENDS:=+libpthread +zlib
74+
DEPENDS:=+libpthread
7575
ABI_VERSION:=$(PYTHON3_VERSION)
7676
endef
7777

@@ -82,7 +82,7 @@ endef
8282
define Package/python3-base
8383
$(call Package/python3/Default)
8484
TITLE:=Python $(PYTHON3_VERSION) interpreter
85-
DEPENDS:=+libpthread +zlib +libpython3
85+
DEPENDS:=+libpython3
8686
endef
8787

8888
define Package/python3-base/description
@@ -93,7 +93,7 @@ endef
9393
define Package/python3-light
9494
$(call Package/python3/Default)
9595
TITLE:=Python $(PYTHON3_VERSION) light installation
96-
DEPENDS:=+python3-base +libffi +libbz2
96+
DEPENDS:=+python3-base +libbz2 +zlib
9797
endef
9898

9999
define Package/python3-light/config
@@ -147,6 +147,18 @@ EXTRA_LDFLAGS+= \
147147
-L$(PKG_BUILD_DIR) \
148148
-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
149149

150+
# Bypass configure tests for cross compilation
151+
CONFIGURE_VARS += \
152+
ac_cv_buggy_getaddrinfo=no \
153+
ac_cv_file__dev_ptc=no \
154+
ac_cv_file__dev_ptmx=yes
155+
156+
# Disable stdlib modules
157+
# Check for a better way in the future: https://github.com/python/cpython/issues/98558
158+
CONFIGURE_VARS += \
159+
py_cv_module__tkinter=n/a \
160+
py_cv_module_nis=n/a
161+
150162
# Workaround for hardfloat mips
151163
# https://bugs.python.org/issue46265
152164
ifneq ($(findstring mips,$(CONFIG_ARCH)),)
@@ -159,22 +171,16 @@ endif
159171
MAKE_VARS += \
160172
PYTHONSTRICTEXTENSIONBUILD=1
161173

162-
CONFIGURE_ARGS+= \
174+
CONFIGURE_ARGS += \
163175
--enable-optimizations \
164176
--enable-shared \
177+
--disable-test-modules \
178+
--with-build-python \
165179
--with-system-ffi \
166180
--without-cxx-main \
167181
--without-ensurepip \
168-
--disable-test-modules \
169182
$(if $(CONFIG_IPV6),--enable-ipv6) \
170-
$(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) \
171-
CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
172-
OPT="$(TARGET_CFLAGS)"
173-
174-
define Build/Prepare
175-
$(call Build/Prepare/Default)
176-
$(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
177-
endef
183+
$(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto)
178184

179185
ifdef CONFIG_PACKAGE_python3-setuptools
180186
PYTHON3_SETUPTOOLS_BUILD:=1
@@ -333,32 +339,30 @@ endif
333339
# HOST_MAKE_VARS += \
334340
# PYTHONSTRICTEXTENSIONBUILD=1
335341

342+
# Bypass configure test
343+
HOST_CONFIGURE_VARS += \
344+
ac_cv_working_openssl_hashlib=yes
345+
336346
ifeq ($(HOST_OS),Darwin)
337347
HOST_CONFIGURE_VARS += \
338348
ac_cv_header_libintl_h=no
339349
HOST_MAKE_VARS += \
340350
USE_PYTHON_CONFIG_PY=1
341351
endif
342352

343-
HOST_CONFIGURE_ARGS+= \
353+
HOST_CONFIGURE_ARGS += \
344354
--enable-optimizations \
355+
--disable-test-modules \
345356
--with-ensurepip=upgrade \
346-
--with-system-expat=$(STAGING_DIR_HOST) \
347357
--with-ssl-default-suites=openssl \
348-
--without-cxx-main \
349-
--disable-test-modules \
350-
CONFIG_SITE=
358+
--with-system-expat \
359+
--without-cxx-main
351360

352361
define Host/Configure
353362
$(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py
354363
$(call Host/Configure/Default)
355364
endef
356365

357-
define Host/Compile
358-
$(call Host/Compile/Default,python)
359-
$(call Host/Compile/Default,sharedmods)
360-
endef
361-
362366
define Host/Install
363367
$(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),,
364368
rm -rf \

lang/python/python3/files/config.site

Lines changed: 0 additions & 13 deletions
This file was deleted.

lang/python/python3/files/python3-package-ctypes.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
define Package/python3-ctypes
99
$(call Package/python3/Default)
1010
TITLE:=Python $(PYTHON3_VERSION) ctypes module
11-
DEPENDS:=+python3-light
11+
DEPENDS:=+python3-light +libffi
1212
endef
1313

1414
$(eval $(call Py3BasePackage,python3-ctypes, \

lang/python/python3/files/python3-package-readline.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
define Package/python3-readline
99
$(call Package/python3/Default)
1010
TITLE:=Python $(PYTHON3_VERSION) readline module
11-
DEPENDS:=+python3-light +libreadline +libncursesw
11+
DEPENDS:=+python3-light +libreadline
1212
endef
1313

1414
$(eval $(call Py3BasePackage,python3-readline, \

lang/python/python3/patches-pip/001-pep517-pyc-fix.patch

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
diff --git a/pip/_vendor/pep517/in_process/__init__.py b/pip/_vendor/pep517/in_process/__init__.py
2-
index c932313..a01143b 100644
2+
index 281a356cfe26..77acbfc2670b 100644
33
--- a/pip/_vendor/pep517/in_process/__init__.py
44
+++ b/pip/_vendor/pep517/in_process/__init__.py
5-
@@ -10,8 +10,13 @@ try:
6-
import importlib.resources as resources
7-
8-
def _in_proc_script_path():
9-
- return resources.path(__package__, '_in_process.py')
10-
+ if resources.is_resource(__package__, '_in_process.py'):
11-
+ return resources.path(__package__, '_in_process.py')
12-
+ return resources.path(__package__, '_in_process.pyc')
5+
@@ -14,13 +14,21 @@ try:
6+
except AttributeError:
7+
# Python 3.8 compatibility
8+
def _in_proc_script_path():
9+
- return resources.path(__package__, '_in_process.py')
10+
+ if resources.is_resource(__package__, '_in_process.py'):
11+
+ return resources.path(__package__, '_in_process.py')
12+
+ return resources.path(__package__, '_in_process.pyc')
13+
else:
14+
def _in_proc_script_path():
15+
+ if resources.files(__package__).joinpath('_in_process.py').is_file():
16+
+ return resources.as_file(
17+
+ resources.files(__package__).joinpath('_in_process.py'))
18+
return resources.as_file(
19+
- resources.files(__package__).joinpath('_in_process.py'))
20+
+ resources.files(__package__).joinpath('_in_process.pyc'))
1321
except ImportError:
22+
# Python 3.6 compatibility
1423
@contextmanager
1524
def _in_proc_script_path():
1625
- yield pjoin(dirname(abspath(__file__)), '_in_process.py')

lang/python/python3/patches/001-enable-zlib.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

lang/python/python3/patches/003-do-not-run-compileall.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
--- a/Makefile.pre.in
22
+++ b/Makefile.pre.in
3-
@@ -1600,6 +1600,7 @@ libinstall: build_all $(srcdir)/Modules/
3+
@@ -2084,6 +2084,7 @@ libinstall: all $(srcdir)/Modules/xxmodu
44
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
55
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
66
fi
77
+ifeq (1,)
88
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
99
$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
1010
-j0 -d $(LIBDEST) -f \
11-
@@ -1627,6 +1628,7 @@ libinstall: build_all $(srcdir)/Modules/
11+
@@ -2111,6 +2112,7 @@ libinstall: all $(srcdir)/Modules/xxmodu
1212
$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
1313
-j0 -d $(LIBDEST)/site-packages -f \
1414
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages

lang/python/python3/patches/004-do-not-write-bytes-codes.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/Python/initconfig.c
22
+++ b/Python/initconfig.c
3-
@@ -163,7 +163,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo
3+
@@ -198,7 +198,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo
44
int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */
55
int Py_FrozenFlag = 0; /* Needed by getpath.c */
66
int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */

lang/python/python3/patches/006-do-not-add-multiarch-local-paths.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/setup.py
22
+++ b/setup.py
3-
@@ -822,16 +822,9 @@ class PyBuildExt(build_ext):
3+
@@ -843,16 +843,9 @@ class PyBuildExt(build_ext):
44
add_dir_to_list(dir_list, directory)
55

66
def configure_compiler(self):

0 commit comments

Comments
 (0)