Skip to content

Commit a89b990

Browse files
commodo1582130940
authored andcommitted
python3: bump to version 3.10.0
Manually re-applied: 008-distutils-use-python-sysroot.patch 016-adjust-config-paths.patch Drop patch: 003-do-not-run-distutils-tests.patch There is now a configure option '--disable-test-modules' And seems we left the '_ctypes_test' around for quite some time. Dropped now. Refs: https://bugs.python.org/issue27640 https://bugs.python.org/issue43282 Drop patch: 013-getbuildinfo-date-time-source-date-epoch.patch Python build honors SOURCE_DATE_EPOCH pretty well now. Drop setuptools patches. Setuptools should be reproducible with Python 3.6+ according to a mention here: pypa/setuptools#1690 (comment) It's time to let upstream fix Setuptools reproduce-ability. Drop patch: 010-do-not-add-rt-lib-dirs-when-cross-compiling.patch I can't seem to fully remember why it's there. And it seem to build fine without it. Drop patch: 015-abort-on-failed-modules.patch Python build supports a similar PYTHONSTRICTEXTENSIONBUILD=1 env-var option. Add patch: 026-openssl-feature-flags.patch We need to keep this in our tree for a while. See: https://bugs.python.org/issue45627 Backport patch: 027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch Link: python/cpython#29353 Fixes the build for uuid C module. Add patch: 028-host-python-support-ssl-with-libressl.patch We need the _ssl module working on the host-side with LibreSSL for pip to work to download from https://pypi.org Refs: openwrt/openwrt#4749 Add patch: 029-disable-deprecation-warning.patch Fixes apparmor build. The warning causes a configure error. Refreshed the rest of patches. Some old build-flags were removed. They don't seem to be necessary anymore. Split python3-uuid from python3-light. To better manage the libuuid library (if needed). Also, fixing the uuid C module build. Seems this was failing, and was falling back to using hashlib. Signed-off-by: Alexandru Ardelean <[email protected]>
1 parent c930c6d commit a89b990

22 files changed

+362
-176
lines changed

lang/python/python3-version.mk

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

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

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

lang/python/python3/Makefile

Lines changed: 17 additions & 11 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:=2
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:=12daff6809528d9f6154216950423c9e30f0e47336cb57c6aa0b4387dd5eb4b2
19+
PKG_HASH:=5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002
2020

2121
PKG_MAINTAINER:=Jeffery To <[email protected]>
2222
PKG_LICENSE:=Python/2.0
@@ -90,7 +90,7 @@ endef
9090
define Package/python3-light
9191
$(call Package/python3/Default)
9292
TITLE:=Python $(PYTHON3_VERSION) light installation
93-
DEPENDS:=+python3-base +libffi +libbz2 +libuuid
93+
DEPENDS:=+python3-base +libffi +libbz2
9494
endef
9595

9696
define Package/python3-light/config
@@ -135,25 +135,21 @@ define Package/python3/description
135135
It's python3-light + all other packages.
136136
endef
137137

138-
TARGET_CONFIGURE_OPTS+= \
139-
READELF="$(TARGET_CROSS)readelf"
140-
141-
MAKE_FLAGS+=\
142-
LD="$(TARGET_CC)"
143-
144-
EXTRA_CFLAGS+= \
145-
-DNDEBUG -fno-inline
146138
EXTRA_LDFLAGS+= \
147139
-L$(PKG_BUILD_DIR) \
148140
-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
149141

142+
MAKE_VARS += \
143+
PYTHONSTRICTEXTENSIONBUILD=1
144+
150145
CONFIGURE_ARGS+= \
151146
--enable-optimizations \
152147
--enable-shared \
153148
--with-system-ffi \
154149
--without-cxx-main \
155150
--without-ensurepip \
156151
--without-pymalloc \
152+
--disable-test-modules \
157153
$(if $(CONFIG_IPV6),--enable-ipv6) \
158154
$(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) \
159155
CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
@@ -311,19 +307,29 @@ HOST_LDFLAGS += \
311307
-Wl,--no-as-needed -lrt
312308
endif
313309

310+
# Would be nice to be able to do this, but hosts are very fiddly
311+
# HOST_MAKE_VARS += \
312+
# PYTHONSTRICTEXTENSIONBUILD=1
313+
314314
ifeq ($(HOST_OS),Darwin)
315315
HOST_CONFIGURE_VARS += \
316316
ac_cv_header_libintl_h=no
317317
HOST_MAKE_VARS += \
318318
USE_PYTHON_CONFIG_PY=1
319319
endif
320320

321+
# FIXME: remove when removing patch '028-host-python-support-ssl-with-libressl.patch'
322+
HOST_CFLAGS += \
323+
-DOPENWRT_HOST_BUILD
324+
321325
HOST_CONFIGURE_ARGS+= \
322326
--enable-optimizations \
323327
--with-ensurepip=upgrade \
324328
--with-system-expat=$(STAGING_DIR_HOSTPKG) \
329+
--with-ssl-default-suites=openssl \
325330
--without-cxx-main \
326331
--without-pymalloc \
332+
--disable-test-modules \
327333
CONFIG_SITE=
328334

329335
define Host/Configure

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ endef
1414
$(eval $(call Py3BasePackage,python3-ctypes, \
1515
/usr/lib/python$(PYTHON3_VERSION)/ctypes \
1616
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes.$(PYTHON3_SO_SUFFIX) \
17-
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes_test.$(PYTHON3_SO_SUFFIX) \
1817
))
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Copyright (C) 2021 Alexandru Ardelean <[email protected]>
3+
#
4+
# This is free software, licensed under the GNU General Public License v2.
5+
# See /LICENSE for more information.
6+
#
7+
8+
define Package/python3-uuid
9+
$(call Package/python3/Default)
10+
TITLE:=Python $(PYTHON3_VERSION) UUID module
11+
DEPENDS:=+python3-light +libuuid
12+
endef
13+
14+
$(eval $(call Py3BasePackage,python3-uuid, \
15+
/usr/lib/python$(PYTHON3_VERSION)/uuid.py \
16+
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_uuid.$(PYTHON3_SO_SUFFIX) \
17+
))

lang/python/python3/patches-setuptools/001-reproducible.patch

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

lang/python/python3/patches-setuptools/002-sorted-requires.patch

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

lang/python/python3/patches-setuptools/003-PKG-INFO-output-reproducible.patch

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/Modules/Setup
22
+++ b/Modules/Setup
3-
@@ -338,7 +338,7 @@ _symtable symtablemodule.c
3+
@@ -343,7 +343,7 @@ _symtable symtablemodule.c
44
# Andrew Kuchling's zlib module.
55
# This require zlib 1.1.3 (or later).
66
# See http://www.gzip.org/zlib/

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

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

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-
@@ -166,7 +166,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo
3+
@@ -155,7 +155,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-paths-when-cross-compiling.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-
@@ -742,7 +742,8 @@ class PyBuildExt(build_ext):
3+
@@ -816,7 +816,8 @@ class PyBuildExt(build_ext):
44
# only change this for cross builds for 3.3, issues on Mageia
55
if CROSS_COMPILING:
66
self.add_cross_compiling_paths()

lang/python/python3/patches/008-distutils-use-python-sysroot.patch

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ third-party Python modules.
1717
Signed-off-by: Thomas Petazzoni <[email protected]>
1818
---
1919
Lib/distutils/command/build_ext.py | 5 ++++-
20-
Lib/distutils/sysconfig.py | 15 +++++++++++----
20+
Lib/sysconfig.py | 15 +++++++++++----
2121
2 files changed, 15 insertions(+), 5 deletions(-)
2222

2323
--- a/Lib/distutils/command/build_ext.py
@@ -34,27 +34,27 @@ Signed-off-by: Thomas Petazzoni <[email protected]>
3434
else:
3535
# building python standard extensions
3636
self.library_dirs.append('.')
37-
--- a/Lib/distutils/sysconfig.py
38-
+++ b/Lib/distutils/sysconfig.py
39-
@@ -17,10 +17,17 @@ import sys
40-
from .errors import DistutilsPlatformError
41-
42-
# These are needed in a couple of spots, so just compute them once.
43-
-PREFIX = os.path.normpath(sys.prefix)
44-
-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
45-
-BASE_PREFIX = os.path.normpath(sys.base_prefix)
46-
-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
37+
--- a/Lib/sysconfig.py
38+
+++ b/Lib/sysconfig.py
39+
@@ -123,10 +123,17 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib',
40+
_PY_VERSION = sys.version.split()[0]
41+
_PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}'
42+
_PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}'
43+
-_PREFIX = os.path.normpath(sys.prefix)
44+
-_BASE_PREFIX = os.path.normpath(sys.base_prefix)
45+
-_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
46+
-_BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
4747
+if "_python_sysroot" in os.environ:
4848
+ _sysroot=os.environ.get('_python_sysroot')
49-
+ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
50-
+ EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
51-
+ BASE_PREFIX = PREFIX
52-
+ BASE_EXEC_PREFIX = EXEC_PREFIX
49+
+ _PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
50+
+ _EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
51+
+ _BASE_PREFIX = _PREFIX
52+
+ _BASE_EXEC_PREFIX = _EXEC_PREFIX
5353
+else:
54-
+ PREFIX = os.path.normpath(sys.prefix)
55-
+ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
56-
+ BASE_PREFIX = os.path.normpath(sys.base_prefix)
57-
+ BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
54+
+ _PREFIX = os.path.normpath(sys.prefix)
55+
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
56+
+ _BASE_PREFIX = os.path.normpath(sys.base_prefix)
57+
+ _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
58+
_CONFIG_VARS = None
59+
_USER_BASE = None
5860

59-
# Path to the base directory of the project. On Windows the binary may
60-
# live in project/PCbuild/win32 or project/PCbuild/amd64.

lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch

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

lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch

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

lang/python/python3/patches/014-remove-platform-so-suffix.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/configure
22
+++ b/configure
3-
@@ -15431,7 +15431,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
3+
@@ -15407,7 +15407,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
44
$as_echo "$ABIFLAGS" >&6; }
55
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
66
$as_echo_n "checking SOABI... " >&6; }
@@ -11,7 +11,7 @@
1111

1212
--- a/configure.ac
1313
+++ b/configure.ac
14-
@@ -4811,7 +4811,7 @@ AC_SUBST(SOABI)
14+
@@ -4798,7 +4798,7 @@ AC_SUBST(SOABI)
1515
AC_MSG_CHECKING(ABIFLAGS)
1616
AC_MSG_RESULT($ABIFLAGS)
1717
AC_MSG_CHECKING(SOABI)

lang/python/python3/patches/015-abort-on-failed-modules.patch

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

0 commit comments

Comments
 (0)