Browse Source

Merge pull request #3754 from commodo/python-upgrade

python: upgrade to version 2.7.13 (and do some cleanups)
lilik-openwrt-22.03
Hannu Nyman 8 years ago
committed by GitHub
parent
commit
3bf2135e27
5 changed files with 50 additions and 22 deletions
  1. +13
    -4
      lang/python/Makefile
  2. +16
    -0
      lang/python/files/python-host.mk
  3. +1
    -1
      lang/python/files/python-package-dev.mk
  4. +19
    -16
      lang/python/files/python-package.mk
  5. +1
    -1
      lang/python/files/python-version.mk

+ 13
- 4
lang/python/Makefile View File

@ -12,11 +12,12 @@ include ./files/python-version.mk
PKG_NAME:=python
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
PKG_MD5SUM:=57dffcee9cee8bb2ab5f82af1d8e9a69
PKG_MD5SUM:=53b43534153bb2a0363f08bae8b9d990
PKG_HASH:=35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
@ -122,13 +123,21 @@ ifeq ($(CONFIG_IPV6),y)
ENABLE_IPV6 += --enable-ipv6
endif
PYTHON_FOR_BUILD:= \
_PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
_PYTHON_HOST_PLATFORM=linux2 \
PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
$(HOST_PYTHON_BIN)
CONFIGURE_ARGS+= \
--sysconfdir=/etc \
--enable-shared \
--without-cxx-main \
--with-threads \
--with-system-ffi="$(STAGING_DIR)/usr" \
--with-system-ffi \
--without-pymalloc \
PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
$(ENABLE_IPV6) \
CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
OPT="$(TARGET_CFLAGS)"
@ -227,7 +236,7 @@ HOST_CONFIGURE_ARGS+= \
--prefix=$(HOST_PYTHON_DIR) \
--exec-prefix=$(HOST_PYTHON_DIR) \
--with-system-expat=$(STAGING_DIR_HOSTPKG) \
--with-system-ffi=$(STAGING_DIR_HOSTPKG) \
--with-system-ffi \
CONFIG_SITE= \
CFLAGS="$(HOST_CFLAGS)"


+ 16
- 0
lang/python/files/python-host.mk View File

@ -77,4 +77,20 @@ define Build/Compile/HostPyMod
$(3))
endef
define HostPy/Compile/Default
$(call Build/Compile/HostPyMod,,\
install --root="$(HOST_BUILD_PREFIX)" --prefix="" \
--single-version-externally-managed \
)
endef
ifeq ($(BUILD_VARIANT),python)
define Host/Compile
$(call HostPy/Compile/Default)
endef
define Host/Install
endef
endif # python
endif # __python_host_mk_inc

+ 1
- 1
lang/python/files/python-package-dev.mk View File

@ -8,7 +8,7 @@
define Package/python-dev
$(call Package/python/Default)
TITLE:=Python $(PYTHON_VERSION) development files
DEPENDS:=+python
DEPENDS:=+python +python-lib2to3
endef
define PyPackage/python-dev/install


+ 19
- 16
lang/python/files/python-package.mk View File

@ -41,6 +41,15 @@ define PyPackage
endef
endif
ifndef PyPackage/$(1)/install
define PyPackage/$(1)/install
if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
$(INSTALL_DIR) $$(1)/usr/bin \
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/
fi
endef
endif
$(call shexport,PyPackage/$(1)/filespec)
define Package/$(1)/install
@ -115,21 +124,15 @@ define Build/Compile/PyMod
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
endef
define PyMod/Default
define Build/Compile
$$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $$(1)$(PYTHON_PKG_DIR) $$(1)/usr/bin
if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then find $(PKG_INSTALL_DIR)/usr/bin -mindepth 1 -maxdepth 1 -type f -exec $(CP) \{\} $$(1)/usr/bin/ \; ; fi
find $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR) -mindepth 1 -maxdepth 1 \( -type f -o -type d \) -exec $(CP) \{\} $$(1)$(PYTHON_PKG_DIR)/ \;
endef
define Build/InstallDev
$(INSTALL_DIR) $$(1)/usr/bin $$(1)$(PYTHON_PKG_DIR)
if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then find $(PKG_INSTALL_DIR)/usr/bin -mindepth 1 -maxdepth 1 -type f -exec $(CP) \{\} $$(1)/usr/bin/ \; ; fi
find $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR) -mindepth 1 -maxdepth 1 \( -type f -o -type d \) -exec $(CP) \{\} $$(1)$(PYTHON_PKG_DIR)/ \;
endef
define PyBuild/Compile/Default
$(call Build/Compile/PyMod,, \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
--single-version-externally-managed \
)
endef
ifeq ($(BUILD_VARIANT),python)
define Build/Compile
$(call PyBuild/Compile/Default)
endef
endif # python

+ 1
- 1
lang/python/files/python-version.mk View File

@ -6,5 +6,5 @@
#
PYTHON_VERSION:=2.7
PYTHON_VERSION_MICRO:=12
PYTHON_VERSION_MICRO:=13

Loading…
Cancel
Save