diff options
Diffstat (limited to 'lang/python/python3')
| -rw-r--r-- | lang/python/python3/Makefile | 63 | ||||
| -rw-r--r-- | lang/python/python3/files/python3-package-pip.mk | 35 | ||||
| -rw-r--r-- | lang/python/python3/files/python3-package-pkg-resources.mk | 30 | ||||
| -rw-r--r-- | lang/python/python3/files/python3-package-setuptools.mk | 32 | ||||
| -rw-r--r-- | lang/python/python3/files/python3-package-venv.mk | 19 | ||||
| -rw-r--r-- | lang/python/python3/patches-host-pip/.gitkeep (renamed from lang/python/python3/patches-setuptools/.placeholder) | 0 | ||||
| -rw-r--r-- | lang/python/python3/patches-host-setuptools/.gitkeep | 0 | ||||
| -rw-r--r-- | lang/python/python3/patches-pip/001-pep517-pyc-fix.patch | 29 |
8 files changed, 24 insertions, 184 deletions
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 020d88a6e..d2ef977a2 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz @@ -41,10 +41,6 @@ PKG_BUILD_FLAGS:=no-lto PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION) -PKG_CONFIG_DEPENDS:= \ - CONFIG_PACKAGE_python3-pkg-resources \ - CONFIG_PACKAGE_python3-setuptools CONFIG_PACKAGE_python3-pip - PKG_BUILD_DEPENDS:=bluez python3/host python-build/host python-installer/host python-wheel/host HOST_BUILD_DEPENDS:=bzip2/host libffi/host @@ -187,57 +183,6 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_IPV6),--enable-ipv6) \ $(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) -ifdef CONFIG_PACKAGE_python3-setuptools -PYTHON3_SETUPTOOLS_BUILD:=1 -endif - -ifdef CONFIG_PACKAGE_python3-pkg-resources -PYTHON3_SETUPTOOLS_BUILD:=1 -endif - -ifeq ($(PYTHON3_SETUPTOOLS_BUILD),1) -define Build/Compile/python3-setuptools - $(HOST_PYTHON3_PIP_VARS) \ - $(HOST_PYTHON3_PIP) \ - install \ - --ignore-installed \ - --progress-bar off \ - --root=$(PKG_BUILD_DIR)/install-setuptools \ - --prefix=/usr \ - $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl - $(call PatchDir,$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-setuptools,) -endef -else -define Build/Compile/python3-setuptools - ls $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl -endef -endif # CONFIG_PACKAGE_python3-setuptools - -ifdef CONFIG_PACKAGE_python3-pip -define Build/Compile/python3-pip - $(HOST_PYTHON3_PIP_VARS) \ - $(HOST_PYTHON3_PIP) \ - install \ - --ignore-installed \ - --progress-bar off \ - --root=$(PKG_BUILD_DIR)/install-pip \ - --prefix=/usr \ - $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl - $(call PatchDir,$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages,./patches-pip,) -endef -else -define Build/Compile/python3-pip - ls $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl -endef -endif # CONFIG_PACKAGE_python3-pip - -define Build/Compile - $(call Build/Compile/Default) - # Use host pip to install python-setuptools - $(call Build/Compile/python3-setuptools) - $(call Build/Compile/python3-pip) -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(INSTALL_DIR) $(2)/bin @@ -366,6 +311,8 @@ HOST_CONFIGURE_ARGS += \ 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 @@ -386,11 +333,11 @@ define Host/Install ) $(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-setuptools,) + $(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-pip,) + $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-pip,) touch $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE) ) endef diff --git a/lang/python/python3/files/python3-package-pip.mk b/lang/python/python3/files/python3-package-pip.mk deleted file mode 100644 index 61ea48022..000000000 --- a/lang/python/python3/files/python3-package-pip.mk +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (C) 2017 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Package/python3-pip -$(call Package/python3/Default) - TITLE:=Python $(PYTHON3_VERSION) pip module - VERSION:=$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE) - LICENSE:=MIT - LICENSE_FILES:=LICENSE.txt -# CPE_ID:=cpe:/a:python:pip # not currently handled this way by uscan - DEPENDS:=+python3 +python3-setuptools +python-pip-conf -endef - -define Py3Package/python3-pip/install - $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages - $(CP) $(PKG_BUILD_DIR)/install-pip/usr/bin/pip$(PYTHON3_VERSION) $(1)/usr/bin - $(LN) pip$(PYTHON3_VERSION) $(1)/usr/bin/pip3 - $(LN) pip$(PYTHON3_VERSION) $(1)/usr/bin/pip - $(CP) \ - $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip \ - $(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip-$(PYTHON3_PIP_VERSION).dist-info \ - $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete -endef - -$(eval $(call Py3BasePackage,python3-pip, \ - /usr/lib/python$(PYTHON3_VERSION)/ensurepip \ - , \ - DO_NOT_ADD_TO_PACKAGE_DEPENDS \ -)) diff --git a/lang/python/python3/files/python3-package-pkg-resources.mk b/lang/python/python3/files/python3-package-pkg-resources.mk deleted file mode 100644 index 592fe2c8c..000000000 --- a/lang/python/python3/files/python3-package-pkg-resources.mk +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (C) 2019 Alexandru Ardelean <ardeleanalex@gmail.com> -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Package/python3-pkg-resources -$(call Package/python3/Default) - TITLE:=Python $(PYTHON3_VERSION) pkg_resources module (part of setuptools) - VERSION:=$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE) - LICENSE:=MIT - LICENSE_FILES:=LICENSE -# CPE_ID:=cpe:/a:python:setuptools # not currently handled this way by uscan - DEPENDS:=+python3 -endef - -define Py3Package/python3-pkg-resources/install - $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages - $(CP) \ - $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/pkg_resources \ - $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete -endef - -$(eval $(call Py3BasePackage,python3-pkg-resources, \ - , \ - DO_NOT_ADD_TO_PACKAGE_DEPENDS \ -)) diff --git a/lang/python/python3/files/python3-package-setuptools.mk b/lang/python/python3/files/python3-package-setuptools.mk deleted file mode 100644 index 3b7c1ca57..000000000 --- a/lang/python/python3/files/python3-package-setuptools.mk +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (C) 2017 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Package/python3-setuptools -$(call Package/python3/Default) - TITLE:=Python $(PYTHON3_VERSION) setuptools module - VERSION:=$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE) - LICENSE:=MIT - LICENSE_FILES:=LICENSE -# CPE_ID:=cpe:/a:python:setuptools # not currently handled this way by uscan - DEPENDS:=+python3 +python3-pkg-resources -endef - -define Py3Package/python3-setuptools/install - $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages - $(CP) \ - $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools \ - $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \ - $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/_distutils_hack \ - $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete -endef - -$(eval $(call Py3BasePackage,python3-setuptools, \ - , \ - DO_NOT_ADD_TO_PACKAGE_DEPENDS \ -)) diff --git a/lang/python/python3/files/python3-package-venv.mk b/lang/python/python3/files/python3-package-venv.mk new file mode 100644 index 000000000..b2ddcab79 --- /dev/null +++ b/lang/python/python3/files/python3-package-venv.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-venv +$(call Package/python3/Default) + TITLE:=Python $(PYTHON3_VERSION) venv module + DEPENDS:=+python3 +endef + +$(eval $(call Py3BasePackage,python3-venv, \ + /usr/lib/python$(PYTHON3_VERSION)/ensurepip \ + /usr/lib/python$(PYTHON3_VERSION)/venv \ + , \ + DO_NOT_ADD_TO_PACKAGE_DEPENDS \ +)) diff --git a/lang/python/python3/patches-setuptools/.placeholder b/lang/python/python3/patches-host-pip/.gitkeep index e69de29bb..e69de29bb 100644 --- a/lang/python/python3/patches-setuptools/.placeholder +++ b/lang/python/python3/patches-host-pip/.gitkeep diff --git a/lang/python/python3/patches-host-setuptools/.gitkeep b/lang/python/python3/patches-host-setuptools/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/lang/python/python3/patches-host-setuptools/.gitkeep diff --git a/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch b/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch deleted file mode 100644 index df5f90cce..000000000 --- a/lang/python/python3/patches-pip/001-pep517-pyc-fix.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/pip/_vendor/pep517/in_process/__init__.py b/pip/_vendor/pep517/in_process/__init__.py -index 281a356cfe26..77acbfc2670b 100644 ---- a/pip/_vendor/pep517/in_process/__init__.py -+++ b/pip/_vendor/pep517/in_process/__init__.py -@@ -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') -+ _in_proc_script = pjoin(dirname(abspath(__file__)), '_in_process.py') -+ if not os.path.isfile(_in_proc_script): -+ _in_proc_script = pjoin(dirname(abspath(__file__)), '_in_process.pyc') -+ yield _in_proc_script |
