Browse Source

Merge pull request #3897 from commodo/python-unify

python,python3,pip,setuptools: unify pip & setuptools under python,python3
lilik-openwrt-22.03
Hannu Nyman 8 years ago
committed by GitHub
parent
commit
8e83bb28f1
19 changed files with 199 additions and 482 deletions
  1. +0
    -76
      lang/python-pip/Makefile
  2. +0
    -78
      lang/python-setuptools/Makefile
  3. +0
    -20
      lang/python-setuptools/patches/0001-remove-windows-support.patch
  4. +0
    -13
      lang/python-setuptools/patches/0002-fix-pyvenv-environment-get.patch
  5. +48
    -2
      lang/python/Makefile
  6. +0
    -0
      lang/python/files/pip.conf
  7. +27
    -0
      lang/python/files/python-package-pip.mk
  8. +29
    -0
      lang/python/files/python-package-setuptools.mk
  9. +0
    -61
      lang/python3-pip/Makefile
  10. +0
    -70
      lang/python3-pip/patches/0001-remove-self-version-checking.patch
  11. +0
    -61
      lang/python3-setuptools/Makefile
  12. +0
    -20
      lang/python3-setuptools/patches/0001-remove-windows-support.patch
  13. +0
    -13
      lang/python3-setuptools/patches/0002-fix-pyvenv-environment-get.patch
  14. +38
    -13
      lang/python3/Makefile
  15. +0
    -9
      lang/python3/files/python3-host.mk
  16. +27
    -0
      lang/python3/files/python3-package-pip.mk
  17. +30
    -0
      lang/python3/files/python3-package-setuptools.mk
  18. +0
    -31
      lang/python3/patches/005-fix-libffi-x86-64-configure.patch
  19. +0
    -15
      lang/python3/patches/011-do-not-prefer-ncursesw.patch

+ 0
- 76
lang/python-pip/Makefile View File

@ -1,76 +0,0 @@
#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pip
PKG_VERSION:=8.1.2
PKG_RELEASE:=1
PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/
PKG_MD5SUM:=87083c0b9867963b29f7aba3613e8f4a
PKG_BUILD_DIR:=$(BUILD_DIR)/python-pip-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/python-pip-$(PKG_VERSION)
HOST_UNPACK=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
PKG_USE_MIPS16:=0
HOST_BUILD_DEPENDS:=python python/host python-setuptools/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
$(call include_mk, python-host.mk)
define Package/python-pip
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Tool for installing Python packages.
URL:=https://pip.pypa.io
DEPENDS:=+python +python-setuptools +ca-certificates
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
define Package/python-pip/description
A tool for installing and managing Python packages.
endef
define Build/Compile
$(call Build/Compile/PyMod,,\
install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
--single-version-externally-managed \
)
endef
define PyPackage/python-pip/filespec
+|$(PYTHON_PKG_DIR)
-|$(PYTHON_PKG_DIR)/pip/_vendor/distlib/*.exe
endef
define PyPackage/python-pip/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
$(INSTALL_CONF) ./files/pip.conf $(1)/etc/
endef
define Host/Compile
$(call Build/Compile/HostPyMod,,\
install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
--single-version-externally-managed \
)
endef
define Host/Install
endef
$(eval $(call HostBuild))
$(eval $(call PyPackage,python-pip))
$(eval $(call BuildPackage,python-pip))

+ 0
- 78
lang/python-setuptools/Makefile View File

@ -1,78 +0,0 @@
#
# Copyright (C) 2014-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python-setuptools
PKG_VERSION:=27.2.0
PKG_RELEASE:=1
PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/87/ba/54197971d107bc06f5f3fbdc0d728a7ae0b10cafca46acfddba65a0899d8/
PKG_MD5SUM:=b39715612fdc0372dbfd7b3fcf5d4fe5
HOST_BUILD_DEPENDS:=python python/host
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
HOST_UNPACK=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
$(call include_mk, python-host.mk)
define Package/python-setuptools
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Tool for installing Python packages.
URL:=https://bitbucket.org/pypa/setuptools
DEPENDS:=+python +ca-certificates
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
define Package/python-setuptools/description
Easily download, build, install, upgrade, and uninstall Python packages
endef
define Build/Compile
$(call Build/Compile/PyMod,,\
install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
--single-version-externally-managed \
)
endef
define Build/InstallDev
$(INSTALL_DIR) $(PYTHON_LIB_DIR)
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(PYTHON_LIB_DIR)
endef
define PyPackage/python-setuptools/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
define Host/Compile
$(call Build/Compile/HostPyMod,,\
install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
--single-version-externally-managed \
)
endef
define Host/Install
endef
$(eval $(call HostBuild))
$(eval $(call PyPackage,python-setuptools))
$(eval $(call BuildPackage,python-setuptools))

+ 0
- 20
lang/python-setuptools/patches/0001-remove-windows-support.patch View File

@ -1,20 +0,0 @@
diff --git a/setuptools/dist.py b/setuptools/dist.py
index b004f92..66b9d89 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -17,7 +17,6 @@ from setuptools.extern.six.moves import map
from pkg_resources.extern import packaging
from setuptools.depends import Require
-from setuptools import windows_support
from setuptools.monkey import get_unpatched
import pkg_resources
@@ -383,7 +382,6 @@ class Distribution(_Distribution):
egg_cache_dir = os.path.join(os.curdir, '.eggs')
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
- windows_support.hide_file(egg_cache_dir)
readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
with open(readme_txt_filename, 'w') as f:
f.write('This directory contains eggs that were downloaded '

+ 0
- 13
lang/python-setuptools/patches/0002-fix-pyvenv-environment-get.patch View File

@ -1,13 +0,0 @@
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index e8b90c7..8598c44 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1946,6 +1946,8 @@ class CommandSpec(list):
Construct a CommandSpec from a parameter to build_scripts, which may
be None.
"""
+ if os.environ.get('__PYVENV_LAUNCHER__'):
+ return cls.from_environment()
if isinstance(param, cls):
return param
if isinstance(param, list):

+ 48
- 2
lang/python/Makefile View File

@ -12,7 +12,7 @@ include ./files/python-version.mk
PKG_NAME:=python
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
@ -59,6 +59,16 @@ define Package/python/Default/description
the development of higher quality, more maintainable code.
endef
define Package/python-pip-conf
$(call Package/python/Default)
TITLE:=Configuration file for pip/pip3
URL:=https://pip.pypa.io
endef
define Package/python-pip-conf/description
Configuration file for pip/pip3
endef
define Package/python-base
$(call Package/python/Default)
TITLE:=Python $(PYTHON_VERSION) interpreter
@ -92,7 +102,9 @@ define PyBasePackage
endif
PYTHON_LIB_FILES_DEL+=$(2)
define PyPackage/$(1)/filespec
$(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
ifneq ($(2),)
$(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
endif
endef
endef
@ -136,6 +148,7 @@ CONFIGURE_ARGS+= \
--without-cxx-main \
--with-threads \
--with-system-ffi \
--with-ensurepip=no \
--without-pymalloc \
PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
$(ENABLE_IPV6) \
@ -147,6 +160,31 @@ define Build/Prepare
$(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
endef
ifdef CONFIG_PACKAGE_python-setuptools
define Build/Compile/python-setuptools
$(STAGING_DIR_HOSTPKG)/bin/pip install \
--ignore-installed \
--root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
$(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-*.whl
endef
endif # CONFIG_PACKAGE_python-setuptools
ifdef CONFIG_PACKAGE_python-pip
define Build/Compile/python-pip
$(STAGING_DIR_HOSTPKG)/bin/pip install \
--ignore-installed \
--root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
$(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-*.whl
endef
endif # CONFIG_PACKAGE_python-pip
define Build/Compile
$(call Build/Compile/Default)
# Use host pip to install python-setuptools
$(call Build/Compile/python-setuptools)
$(call Build/Compile/python-pip)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)/mk/
$(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/ $(1)/usr/lib/pkgconfig
@ -229,6 +267,11 @@ define PyPackage/python/filespec
-|$(PYTHON_PKG_DIR)
endef
define Package/python-pip-conf/install
$(INSTALL_DIR) $(1)/etc
$(CP) ./files/pip.conf $(1)/etc
endef
HOST_LDFLAGS += \
$$$$(pkg-config --static --libs libcrypto libssl)
@ -240,6 +283,7 @@ HOST_CONFIGURE_ARGS+= \
--exec-prefix=$(HOST_PYTHON_DIR) \
--with-system-expat=$(STAGING_DIR_HOSTPKG) \
--with-system-ffi=no \
--with-ensurepip=install \
CONFIG_SITE=
define Host/Install
@ -259,6 +303,8 @@ $(eval $(call PyPackage,python-base))
$(eval $(call PyPackage,python-light))
$(eval $(call PyPackage,python))
$(eval $(call BuildPackage,python-pip-conf))
$(eval $(call BuildPackage,python-base))
$(eval $(call BuildPackage,python-light))
$(eval $(call BuildPackage,python))

lang/python-pip/files/pip.conf → lang/python/files/pip.conf View File


+ 27
- 0
lang/python/files/python-package-pip.mk View File

@ -0,0 +1,27 @@
#
# Copyright (C) 2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Package/python-pip
$(call Package/python/Default)
TITLE:=Python $(PYTHON_VERSION) pip module
DEPENDS:=+python +python-setuptools +python-pip-conf
endef
define PyPackage/python-pip/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
# Adjust shebang to proper python location on target
sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON_VERSION)/" -i $(PKG_BUILD_DIR)/install-pip/bin/*
$(CP) $(PKG_BUILD_DIR)/install-pip/bin/* $(1)/usr/bin
$(CP) \
$(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON_VERSION)/site-packages/pip \
$(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/
endef
$(eval $(call PyBasePackage,python-pip, \
, \
DO_NOT_ADD_TO_PACKAGE_DEPENDS \
))

+ 29
- 0
lang/python/files/python-package-setuptools.mk View File

@ -0,0 +1,29 @@
#
# Copyright (C) 2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Package/python-setuptools
$(call Package/python/Default)
TITLE:=Python $(PYTHON_VERSION) setuptools module
DEPENDS:=+python
endef
define PyPackage/python-setuptools/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
# Adjust shebang to proper python location on target
sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON_VERSION)/" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
$(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/* $(1)/usr/bin
$(CP) \
$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/pkg_resources \
$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/setuptools \
$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/easy_install.py \
$(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
endef
$(eval $(call PyBasePackage,python-setuptools, \
, \
DO_NOT_ADD_TO_PACKAGE_DEPENDS \
))

+ 0
- 61
lang/python3-pip/Makefile View File

@ -1,61 +0,0 @@
#
# Copyright (C) 2014-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python3-pip
PKG_VERSION:=8.1.2
PKG_RELEASE:=1
PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/
PKG_MD5SUM:=87083c0b9867963b29f7aba3613e8f4a
PKG_LICENSE:=MIT
PKG_BUILD_DIR:=$(BUILD_DIR)/python3-pip-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python3-package.mk)
define Package/python3-pip
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Tool for installing Python $(PYTHON3_VERSION) packages.
URL:=https://pip.pypa.io
DEPENDS:=+python3 +python3-dev +python3-lib2to3 +python3-setuptools
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
define Package/python3-pip/description
A tool for installing and managing Python $(PYTHON3_VERSION) packages.
endef
define Build/Compile
$(call Build/Compile/Py3Mod,,\
install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
--single-version-externally-managed \
)
endef
define Py3Package/python3-pip/filespec
+|$(PYTHON3_PKG_DIR)
-|$(PYTHON3_PKG_DIR)/_vendor/distlib/*.exe
-|$(PYTHON3_PKG_DIR)/utils/outdated.py
endef
define Py3Package/python3-pip/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/pip$(PYTHON3_VERSION) $(1)/usr/bin
$(LN) pip$(PYTHON3_VERSION) $(1)/usr/bin/pip3
endef
$(eval $(call Py3Package,python3-pip))
$(eval $(call BuildPackage,python3-pip))

+ 0
- 70
lang/python3-pip/patches/0001-remove-self-version-checking.patch View File

@ -1,70 +0,0 @@
From 771a1407b15538697a7f38209e40dbbf58828d33 Mon Sep 17 00:00:00 2001
From: Florian Fieber <florian@florianfieber.de>
Date: Tue, 9 Jun 2015 15:59:04 +0200
Subject: [PATCH] Remove self version checking
Signed-off-by: Florian Fieber <florian@florianfieber.de>
---
pip/basecommand.py | 10 ----------
pip/cmdoptions.py | 10 ----------
2 files changed, 20 deletions(-)
diff --git a/pip/basecommand.py b/pip/basecommand.py
index 854d113..c2337a4 100644
--- a/pip/basecommand.py
+++ b/pip/basecommand.py
@@ -22,7 +22,6 @@ from pip.status_codes import (
from pip.utils import get_prog, normalize_path
from pip.utils.deprecation import RemovedInPip8Warning
from pip.utils.logging import IndentingFormatter
-from pip.utils.outdated import pip_version_check
__all__ = ['Command']
@@ -237,15 +236,6 @@ class Command(object):
logger.critical('Exception:', exc_info=True)
return UNKNOWN_ERROR
- finally:
- # Check if we're using the latest version of pip available
- if (not options.disable_pip_version_check and not
- getattr(options, "no_index", False)):
- with self._build_session(
- options,
- retries=0,
- timeout=min(5, options.timeout)) as session:
- pip_version_check(session)
return SUCCESS
diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py
index 9a0446a..4fa29d3 100644
--- a/pip/cmdoptions.py
+++ b/pip/cmdoptions.py
@@ -514,15 +514,6 @@ no_clean = partial(
default=False,
help="Don't clean up build directories.")
-disable_pip_version_check = partial(
- Option,
- "--disable-pip-version-check",
- dest="disable_pip_version_check",
- action="store_true",
- default=False,
- help="Don't periodically check PyPI to determine whether a new version "
- "of pip is available for download. Implied with --no-index.")
-
# Deprecated, Remove later
always_unzip = partial(
Option,
@@ -560,7 +551,6 @@ general_group = {
client_cert,
cache_dir,
no_cache,
- disable_pip_version_check,
]
}
--
2.6.2

+ 0
- 61
lang/python3-setuptools/Makefile View File

@ -1,61 +0,0 @@
#
# Copyright (C) 2014-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python3-setuptools
PKG_VERSION:=27.2.0
PKG_RELEASE:=1
PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/87/ba/54197971d107bc06f5f3fbdc0d728a7ae0b10cafca46acfddba65a0899d8/
PKG_MD5SUM:=b39715612fdc0372dbfd7b3fcf5d4fe5
PKG_LICENSE:=PSF
PKG_BUILD_DIR:=$(BUILD_DIR)/python3-setuptools-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python3-package.mk)
define Package/python3-setuptools
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Tool for installing Python $(PYTHON3_VERSION) packages.
URL:=https://bitbucket.org/pypa/setuptools
DEPENDS:=+python3 +python3-dev +python3-lib2to3
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
define Package/python3-setuptools/description
Easily download, build, install, upgrade, and uninstall Python $(PYTHON3_VERSION) packages
endef
define Build/Compile
$(call Build/Compile/Py3Mod,,\
install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
--single-version-externally-managed \
)
endef
define Build/InstallDev
$(INSTALL_DIR) $(PYTHON3_LIB_DIR)
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* \
$(PYTHON3_LIB_DIR)
endef
define Py3Package/python3-setuptools/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/
$(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install3
endef
$(eval $(call Py3Package,python3-setuptools))
$(eval $(call BuildPackage,python3-setuptools))

+ 0
- 20
lang/python3-setuptools/patches/0001-remove-windows-support.patch View File

@ -1,20 +0,0 @@
diff --git a/setuptools/dist.py b/setuptools/dist.py
index b004f92..66b9d89 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -17,7 +17,6 @@ from setuptools.extern.six.moves import map
from pkg_resources.extern import packaging
from setuptools.depends import Require
-from setuptools import windows_support
from setuptools.monkey import get_unpatched
import pkg_resources
@@ -383,7 +382,6 @@ class Distribution(_Distribution):
egg_cache_dir = os.path.join(os.curdir, '.eggs')
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
- windows_support.hide_file(egg_cache_dir)
readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
with open(readme_txt_filename, 'w') as f:
f.write('This directory contains eggs that were downloaded '

+ 0
- 13
lang/python3-setuptools/patches/0002-fix-pyvenv-environment-get.patch View File

@ -1,13 +0,0 @@
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index e8b90c7..8598c44 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1946,6 +1946,8 @@ class CommandSpec(list):
Construct a CommandSpec from a parameter to build_scripts, which may
be None.
"""
+ if os.environ.get('__PYVENV_LAUNCHER__'):
+ return cls.from_environment()
if isinstance(param, cls):
return param
if isinstance(param, list):

+ 38
- 13
lang/python3/Makefile View File

@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
PKG_RELEASE:=1
PKG_RELEASE:=4
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
@ -96,7 +96,9 @@ define Py3BasePackage
endif
PYTHON3_LIB_FILES_DEL+=$(2)
define Py3Package/$(1)/filespec
$(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
ifneq ($(2),)
$(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
endif
endef
endef
@ -117,10 +119,6 @@ MAKE_FLAGS+=\
LD="$(TARGET_CC)" \
PGEN=pgen3
ifeq ($(ARCH),i386)
MAKE_FLAGS+=PYTHON_DECIMAL_WITH_MACHINE=ansi32
endif
EXTRA_CFLAGS+= \
-DNDEBUG -fno-inline
EXTRA_LDFLAGS+= \
@ -144,8 +142,8 @@ CONFIGURE_ARGS+= \
--without-cxx-main \
--with-threads \
--with-system-ffi \
--without-pymalloc \
--with-ensurepip=no \
--without-pymalloc \
PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
$(ENABLE_IPV6) \
CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
@ -156,6 +154,31 @@ define Build/Prepare
$(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
endef
ifdef CONFIG_PACKAGE_python3-setuptools
define Build/Compile/python3-setuptools
$(STAGING_DIR_HOSTPKG)/bin/pip3 install \
--ignore-installed \
--root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
$(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-*.whl
endef
endif # CONFIG_PACKAGE_python3-setuptools
ifdef CONFIG_PACKAGE_python3-pip
define Build/Compile/python3-pip
$(STAGING_DIR_HOSTPKG)/bin/pip3 install \
--ignore-installed \
--root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
$(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-*.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) $(STAGING_DIR)/mk/
$(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
@ -231,6 +254,9 @@ define Py3Package/python3/filespec
-|$(PYTHON3_PKG_DIR)
endef
HOST_LDFLAGS += \
$$$$(pkg-config --static --libs libcrypto libssl)
HOST_CONFIGURE_ARGS+= \
--without-cxx-main \
--without-pymalloc \
@ -238,14 +264,13 @@ HOST_CONFIGURE_ARGS+= \
--prefix=$(HOST_PYTHON3_DIR) \
--exec-prefix=$(HOST_PYTHON3_DIR) \
--with-system-expat=$(STAGING_DIR_HOSTPKG) \
--with-system-ffi \
--with-ensurepip=no \
CONFIG_SITE= \
CFLAGS="$(HOST_CFLAGS)"
--with-system-ffi=no \
--with-ensurepip=install \
CONFIG_SITE=
define Host/Compile
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
endef
define Host/Install


+ 0
- 9
lang/python3/files/python3-host.mk View File

@ -78,13 +78,4 @@ define HostPy3/Compile/Default
)
endef
ifeq ($(BUILD_VARIANT),python3)
define Host/Compile
$(call HostPy3/Compile/Default)
endef
define Host/Install
endef
endif # python3
endif # __python3_host_mk_inc

+ 27
- 0
lang/python3/files/python3-package-pip.mk View File

@ -0,0 +1,27 @@
#
# 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
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
# Adjust shebang to proper python location on target
sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON3_VERSION)/" -i $(PKG_BUILD_DIR)/install-pip/bin/*
$(CP) $(PKG_BUILD_DIR)/install-pip/bin/pip3* $(1)/usr/bin
$(CP) \
$(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/
endef
$(eval $(call Py3BasePackage,python3-pip, \
, \
DO_NOT_ADD_TO_PACKAGE_DEPENDS \
))

+ 30
- 0
lang/python3/files/python3-package-setuptools.mk View File

@ -0,0 +1,30 @@
#
# 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
DEPENDS:=+python3
endef
define Py3Package/python3-setuptools/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
# Adjust shebang to proper python location on target
sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON3_VERSION)/" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
$(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/easy_install-* $(1)/usr/bin
$(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install-3
$(CP) \
$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/pkg_resources \
$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/setuptools \
$(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
endef
$(eval $(call Py3BasePackage,python3-setuptools, \
, \
DO_NOT_ADD_TO_PACKAGE_DEPENDS \
))

+ 0
- 31
lang/python3/patches/005-fix-libffi-x86-64-configure.patch View File

@ -1,31 +0,0 @@
diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
index 75f62a7..4d6c9f2 100755
--- a/Modules/_ctypes/libffi/configure
+++ b/Modules/_ctypes/libffi/configure
@@ -17257,20 +17257,12 @@ case "$host" in
fi
;;
- i?86-*-* | x86_64-*-*)
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- case "$host" in
- *-gnux32)
- TARGET=X86_64
- ;;
- *)
- TARGET=X86
- ;;
- esac
- else
- TARGET=X86_64;
- fi
+ i?86-*-*)
+ TARGET=X86; TARGETDIR=x86
+ ;;
+
+ x86_64-*-*)
+ TARGET=X86_64; TARGETDIR=x86
;;
ia64*-*-*)

+ 0
- 15
lang/python3/patches/011-do-not-prefer-ncursesw.patch View File

@ -1,15 +0,0 @@
diff --git a/setup.py b/setup.py
index 2779658..b6d3d61 100644
--- a/setup.py
+++ b/setup.py
@@ -693,8 +693,8 @@ class PyBuildExt(build_ext):
# use the same library for the readline and curses modules.
if 'curses' in readline_termcap_library:
curses_library = readline_termcap_library
- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
- curses_library = 'ncursesw'
+ #elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+ # curses_library = 'ncursesw'
elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
curses_library = 'ncurses'
elif self.compiler.find_library_file(lib_dirs, 'curses'):

Loading…
Cancel
Save