From 1c54e2b0fbe2e9a7dfb050b45ff79a0f72b8582f Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 20 Feb 2017 11:49:29 +0200 Subject: [PATCH 1/3] python,python3: fix underlinking issues with lrt (clock_gettime()) Seems it's called underlinking that's happening only on Ubuntu 12.04 with libressl (that comes from LEDE's tools folder). Link here: https://ubuntuforums.org/showthread.php?t=1870586 I'm still reading about this a bit. Since I don't really get it. But applying that fix (as in the link) seems to fix compiling on Ubuntu 12.04, and tried also on 16.04 (to make sure). Signed-off-by: Alexandru Ardelean --- lang/python/python/Makefile | 1 + lang/python/python3/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index 1d37a51d8..77652bd1f 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -276,6 +276,7 @@ define Package/python-pip-conf/install endef HOST_LDFLAGS += \ + -Wl,--no-as-needed -lrt \ $$$$(pkg-config --static --libs libcrypto libssl) HOST_CONFIGURE_ARGS+= \ diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 9e10d1806..614dc2c88 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -251,6 +251,7 @@ define Py3Package/python3/filespec endef HOST_LDFLAGS += \ + -Wl,--no-as-needed -lrt \ $$$$(pkg-config --static --libs libcrypto libssl) HOST_CONFIGURE_ARGS+= \ From a2b76b54030c0771b28c501dfd699898b8a85fd6 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 3 Jul 2017 09:43:42 +0300 Subject: [PATCH 2/3] python,python3: simplify `sed` expression for setuptools & pip A suggestion from comment (from Philip Prindeville): https://github.com/openwrt/packages/issues/4529#issuecomment-312518121 Avoids some escaping of slashes. Signed-off-by: Alexandru Ardelean --- lang/python/python/files/python-package-pip.mk | 2 +- lang/python/python/files/python-package-setuptools.mk | 2 +- lang/python/python3/files/python3-package-pip.mk | 2 +- lang/python/python3/files/python3-package-setuptools.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/python/python/files/python-package-pip.mk b/lang/python/python/files/python-package-pip.mk index 8dd0d6c79..a3934cc19 100644 --- a/lang/python/python/files/python-package-pip.mk +++ b/lang/python/python/files/python-package-pip.mk @@ -15,7 +15,7 @@ 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/* + 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 \ diff --git a/lang/python/python/files/python-package-setuptools.mk b/lang/python/python/files/python-package-setuptools.mk index 48823731e..c35fad8c5 100644 --- a/lang/python/python/files/python-package-setuptools.mk +++ b/lang/python/python/files/python-package-setuptools.mk @@ -15,7 +15,7 @@ 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/* + 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 \ diff --git a/lang/python/python3/files/python3-package-pip.mk b/lang/python/python3/files/python3-package-pip.mk index 43e05f1c7..ff9b5ac74 100644 --- a/lang/python/python3/files/python3-package-pip.mk +++ b/lang/python/python3/files/python3-package-pip.mk @@ -15,7 +15,7 @@ endef define Package/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/* + 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 \ diff --git a/lang/python/python3/files/python3-package-setuptools.mk b/lang/python/python3/files/python3-package-setuptools.mk index 9a646334f..684d3e64e 100644 --- a/lang/python/python3/files/python3-package-setuptools.mk +++ b/lang/python/python3/files/python3-package-setuptools.mk @@ -15,7 +15,7 @@ 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/* + 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) \ From 3fa0c06d48acbbc94a58d4bbcd03345539451a70 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 3 Jul 2017 10:46:59 +0300 Subject: [PATCH 3/3] python,python3: add dependency on CONFIG_PACKAGE_ symbols for setuptools & pip If you build python/python3 and later decide to build python(3)-setuptools and/or python(3)-pip, the build won't re-run without adding `CONFIG_PACKAGE_python(3)-setuptools` and `CONFIG_PACKAGE_python(3)-pip`. Seems to resolve issue: https://github.com/openwrt/packages/issues/4529 Signed-off-by: Alexandru Ardelean --- lang/python/python/Makefile | 2 ++ lang/python/python3/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index 77652bd1f..d4c657b4f 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -35,6 +35,8 @@ HOST_BUILD_PARALLEL:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION) +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_python-setuptools CONFIG_PACKAGE_python-pip + PKG_BUILD_DEPENDS:=python/host HOST_BUILD_DEPENDS:=bzip2/host expat/host diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 614dc2c88..02c103193 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -38,6 +38,8 @@ HOST_BUILD_PARALLEL:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION) +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_python3-setuptools CONFIG_PACKAGE_python3-pip + PKG_BUILD_DEPENDS:=python3/host HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host