Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lang/python/python3-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
68 changes: 41 additions & 27 deletions lang/python/python3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ include $(TOPDIR)/rules.mk
include ../python3-version.mk

PKG_NAME:=python3
PKG_RELEASE:=4
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 <[email protected]>
PKG_LICENSE:=PSF-2.0
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -138,10 +138,27 @@ 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

# 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)),)
Expand All @@ -154,23 +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 \
--without-pymalloc \
--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
Expand Down Expand Up @@ -310,6 +320,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

Expand All @@ -322,33 +339,30 @@ 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
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 \
--without-pymalloc \
--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 \
Expand Down
13 changes: 0 additions & 13 deletions lang/python/python3/files/config.site

This file was deleted.

2 changes: 1 addition & 1 deletion lang/python/python3/files/python3-package-ctypes.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
2 changes: 1 addition & 1 deletion lang/python/python3/files/python3-package-readline.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
27 changes: 18 additions & 9 deletions lang/python/python3/patches-pip/001-pep517-pyc-fix.patch
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
11 changes: 0 additions & 11 deletions lang/python/python3/patches/001-enable-zlib.patch

This file was deleted.

18 changes: 18 additions & 0 deletions lang/python/python3/patches/003-do-not-run-compileall.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -2084,6 +2084,7 @@ libinstall: all $(srcdir)/Modules/xxmodu
$(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 \
@@ -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
+endif
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/setup.py
+++ b/setup.py
@@ -843,16 +843,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):

This file was deleted.

10 changes: 0 additions & 10 deletions lang/python/python3/patches/007-distutils-do-not-adjust-path.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Signed-off-by: Thomas Petazzoni <[email protected]>
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]}'
Expand Down
Original file line number Diff line number Diff line change
@@ -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; }
Expand All @@ -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)
Expand Down
Loading