From d5d9442928cdeed790a96fb85a5a6bf8ed95674d Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 09:31:31 +0300 Subject: [PATCH 1/7] python3: fixup python-package.mk include Signed-off-by: Alexandru Ardelean --- lang/python3/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/python3/Makefile b/lang/python3/Makefile index 8edc19d18..3841ce275 100644 --- a/lang/python3/Makefile +++ b/lang/python3/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk # The file included below defines PYTHON_VERSION --include $(if $(DUMP),,./files/python-package.mk) +-include $(if $(DUMP),,./files/python3-package.mk) PKG_NAME:=python3 PKG_RELEASE:=1 @@ -116,7 +116,7 @@ endef define Build/InstallDev $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(INSTALL_DIR) $(STAGING_DIR)/mk/ - $(INSTALL_DATA) ./files/python-package.mk $(STAGING_DIR)/mk/ + $(INSTALL_DATA) ./files/python3-package.mk $(STAGING_DIR)/mk/ $(CP) \ $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \ $(1)/usr/include/ From 9500f50f2b798a4127a9a10b33d2d153b30cc885 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 09:29:34 +0300 Subject: [PATCH 2/7] python3: avoid making python3 the default python command Signed-off-by: Alexandru Ardelean --- lang/python3/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lang/python3/Makefile b/lang/python3/Makefile index 3841ce275..9d93873c5 100644 --- a/lang/python3/Makefile +++ b/lang/python3/Makefile @@ -132,9 +132,6 @@ define Build/InstallDev $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \ $(2)/bin/ $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config - - (cd $(2)/bin; \ - ln -sf python$(PYTHON_VERSION)-config python-config;) endef define PyPackage/python3/filespec @@ -158,7 +155,6 @@ endef define PyPackage/python3/install # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/ - ln -sf python$(PYTHON_VERSION) $(1)/usr/bin/python endef define Host/Configure From dee4a69cea3d75ba37c6ae22bce3d8e2126158d5 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 09:38:43 +0300 Subject: [PATCH 3/7] python3: enforce version assignment Signed-off-by: Alexandru Ardelean --- lang/python3/files/python3-package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk index 3a49bc089..313b404e1 100644 --- a/lang/python3/files/python3-package.mk +++ b/lang/python3/files/python3-package.mk @@ -5,8 +5,8 @@ # See /LICENSE for more information. # -PYTHON_VERSION=3.4 -PYTHON_VERSION_MICRO=1 +PYTHON_VERSION:=3.4 +PYTHON_VERSION_MICRO:=1 PYTHON_DIR:=$(STAGING_DIR)/usr PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin From e4d94961c3bfca97d17014b5350683837e24ee7a Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 09:39:42 +0300 Subject: [PATCH 4/7] python3: include python*-package.mk irespective of DUMP env var Signed-off-by: Alexandru Ardelean --- lang/python3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/python3/Makefile b/lang/python3/Makefile index 9d93873c5..032b5a032 100644 --- a/lang/python3/Makefile +++ b/lang/python3/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk # The file included below defines PYTHON_VERSION --include $(if $(DUMP),,./files/python3-package.mk) +include ./files/python3-package.mk PKG_NAME:=python3 PKG_RELEASE:=1 From 72092dabf297d7f55b159b81a4c7d7fe3d520e0a Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 11:52:06 +0300 Subject: [PATCH 5/7] python3: suffix vars with 3 --- lang/python3/Makefile | 9 ++++--- lang/python3/files/python3-package.mk | 36 +++++++++++++-------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/lang/python3/Makefile b/lang/python3/Makefile index 032b5a032..f4e245b13 100644 --- a/lang/python3/Makefile +++ b/lang/python3/Makefile @@ -10,6 +10,9 @@ include $(TOPDIR)/rules.mk # The file included below defines PYTHON_VERSION include ./files/python3-package.mk +PYTHON_VERSION:=$(PYTHON3_VERSION) +PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO) + PKG_NAME:=python3 PKG_RELEASE:=1 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO) @@ -134,7 +137,7 @@ define Build/InstallDev $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config endef -define PyPackage/python3/filespec +define Py3Package/python3/filespec +|/usr/bin/python$(PYTHON_VERSION) +|/usr/lib/python$(PYTHON_VERSION)/encodings +|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py @@ -152,7 +155,7 @@ define PyPackage/python3/filespec +|/usr/lib/python$(PYTHON_VERSION)/stat.py endef -define PyPackage/python3/install +define Py3Package/python3/install # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/ endef @@ -190,6 +193,6 @@ endef $(eval $(call HostBuild)) -$(eval $(call PyPackage,python3)) +$(eval $(call Py3Package,python3)) $(eval $(call BuildPackage,python3)) diff --git a/lang/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk index 313b404e1..4112a41da 100644 --- a/lang/python3/files/python3-package.mk +++ b/lang/python3/files/python3-package.mk @@ -5,34 +5,34 @@ # See /LICENSE for more information. # -PYTHON_VERSION:=3.4 -PYTHON_VERSION_MICRO:=1 +PYTHON3_VERSION:=3.4 +PYTHON3_VERSION_MICRO:=1 -PYTHON_DIR:=$(STAGING_DIR)/usr -PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin -PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION) -PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION) +PYTHON3_DIR:=$(STAGING_DIR)/usr +PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin +PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION) +PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION) -PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages +PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages -PYTHON:=python$(PYTHON_VERSION) +PYTHON3:=python$(PYTHON3_VERSION) -HOST_PYTHON_BIN:=$(STAGING_DIR)/usr/bin/hostpython +HOST_PYTHON3_BIN:=$(STAGING_DIR)/usr/bin/hostpython3 -define HostPython - ( export PYTHONPATH="$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)"; \ +define HostPython3 + ( export PYTHONPATH="$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)"; \ export PYTHONOPTIMIZE=""; \ export PYTHONDONTWRITEBYTECODE=1; \ $(1) \ - $(HOST_PYTHON_BIN) $(2); \ + $(HOST_PYTHON3_BIN) $(2); \ ) endef -define PyPackage - $(call shexport,PyPackage/$(1)/filespec) +define Py3Package + $(call shexport,Py3Package/$(1)/filespec) define Package/$(1)/install - @$(SH_FUNC) getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \ + @$(SH_FUNC) getvar $$(call shvar,Py3Package/$(1)/filespec) | ( \ IFS='|'; \ while read fop fspec fperm; do \ if [ "$$$$$$$$fop" = "+" ]; then \ @@ -57,15 +57,15 @@ define PyPackage fi; \ done; \ ) - $(call PyPackage/$(1)/install,$$(1)) + $(call Py3Package/$(1)/install,$$(1)) endef endef # $(1) => build subdir # $(2) => additional arguments to setup.py # $(3) => additional variables -define Build/Compile/PyMod - $(call HostPython, \ +define Build/Compile/Py3Mod + $(call HostPython3, \ cd $(PKG_BUILD_DIR)/$(strip $(1)); \ CFLAGS="$(TARGET_CFLAGS)" \ CPPFLAGS="$(TARGET_CPPFLAGS)" \ From a964feec68ca354b86ecd788c22f84831cb91055 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 14:45:28 +0300 Subject: [PATCH 6/7] python3: add python3 symlink to python exec as per PEP394 --- lang/python3/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lang/python3/Makefile b/lang/python3/Makefile index f4e245b13..d97611ea8 100644 --- a/lang/python3/Makefile +++ b/lang/python3/Makefile @@ -99,8 +99,6 @@ endif define Build/Configure -$(MAKE) -C $(PKG_BUILD_DIR) distclean (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0) - # The python executable needs to stay in the rootdir since its location will - # be used to compute the path of the config files. $(CP) ./files/config.site $(PKG_BUILD_DIR) $(call Build/Configure/Default, \ --sysconfdir=/etc \ @@ -158,6 +156,7 @@ endef define Py3Package/python3/install # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/ + $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3 endef define Host/Configure From 5cb802cac4f402688a763ea3f758922ebcaf895a Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 14 Oct 2014 17:51:30 +0300 Subject: [PATCH 7/7] python3: fix python host path --- lang/python3/files/python3-package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk index 4112a41da..e85b64819 100644 --- a/lang/python3/files/python3-package.mk +++ b/lang/python3/files/python3-package.mk @@ -17,7 +17,7 @@ PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages PYTHON3:=python$(PYTHON3_VERSION) -HOST_PYTHON3_BIN:=$(STAGING_DIR)/usr/bin/hostpython3 +HOST_PYTHON3_BIN:=$(STAGING_DIR_HOST)/bin/python3 define HostPython3 ( export PYTHONPATH="$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)"; \