From 618771c3a3305df9bc925fbf1ff0f43757262c69 Mon Sep 17 00:00:00 2001 From: Jan Kardell Date: Mon, 1 Oct 2018 19:13:44 +0200 Subject: [PATCH 1/3] Python3: Fix host build on OpenSUSE The linker option -rpath is required to find libs in staging_dir. Now it is included when building host modules. Without it the import test of the _ctypes and _uuid modules would fail. The _ctypes module uses libffi.so.6 from staging, but OpenSUSE LEAP 15 has libffi.so.7. It will also fail on LEAP 42.x, Fedora28 and 29 and future or old versions of Ubuntu. Fix needed in master and 18.06 branches. Signed-off-by: Jan Kardell (cherry picked from commit 6ade5a1e3adb189d062b707e2b8f731c9faab844) --- lang/python/python3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 32b564cb4..5180ee928 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -264,7 +264,7 @@ define Py3Package/python3/filespec endef HOST_LDFLAGS += \ - $$$$(pkg-config --static --libs libcrypto libssl) + $$$$(pkg-config --static --libs libcrypto libssl) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib ifeq ($(HOST_OS),Linux) HOST_LDFLAGS += \ From e2aa53d376f235101b253e4af4536b7ec7656386 Mon Sep 17 00:00:00 2001 From: Jan Kardell Date: Mon, 8 Oct 2018 11:57:14 +0200 Subject: [PATCH 2/3] Python: Fix compile of host modules Add -rpath linker option to host build, pointing to staging/hostpkh/lib. It's needed to find the correct host libs during runtime, without it the hosts libs may be used instaead, causing failures. Signed-off-by: Jan Kardell (cherry picked from commit 0311e58bb645b8f5a2b96528d78edc90c811ed94) --- lang/python/python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index 6ad838909..4c7fc9eef 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -268,7 +268,7 @@ define PyPackage/python/filespec endef HOST_LDFLAGS += \ - $$$$(pkg-config --static --libs libcrypto libssl) + $$$$(pkg-config --static --libs libcrypto libssl) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib ifeq ($(HOST_OS),Linux) HOST_LDFLAGS += \ From 76a67189c5f1c934144a462d8a88f2aa7d57dcfb Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Wed, 20 May 2020 15:46:59 +0800 Subject: [PATCH 3/3] python-openssl,python3-openssl: Add dependency on ca-bundle The ssl module assumes OpenSSL can load the default trust anchors (root CA certificates). From https://github.com/openwrt/packages/issues/12209 Signed-off-by: Jeffery To --- lang/python/python/Makefile | 2 +- lang/python/python/files/python-package-openssl.mk | 2 +- lang/python/python3/Makefile | 2 +- lang/python/python3/files/python3-package-openssl.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile index 4c7fc9eef..a192a65be 100644 --- a/lang/python/python/Makefile +++ b/lang/python/python/Makefile @@ -12,7 +12,7 @@ include ../python-version.mk PKG_NAME:=python PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION) diff --git a/lang/python/python/files/python-package-openssl.mk b/lang/python/python/files/python-package-openssl.mk index dbf6fe180..efb6f6ef3 100644 --- a/lang/python/python/files/python-package-openssl.mk +++ b/lang/python/python/files/python-package-openssl.mk @@ -8,7 +8,7 @@ define Package/python-openssl $(call Package/python/Default) TITLE:=Python $(PYTHON_VERSION) SSL module - DEPENDS:=+python-light +libopenssl + DEPENDS:=+python-light +libopenssl +ca-bundle endef $(eval $(call PyBasePackage,python-openssl, \ diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 5180ee928..5ea8019a2 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION) PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO) PKG_NAME:=python3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz diff --git a/lang/python/python3/files/python3-package-openssl.mk b/lang/python/python3/files/python3-package-openssl.mk index 6971993f7..f1308d6b7 100644 --- a/lang/python/python3/files/python3-package-openssl.mk +++ b/lang/python/python3/files/python3-package-openssl.mk @@ -8,7 +8,7 @@ define Package/python3-openssl $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) SSL module - DEPENDS:=+python3-light +libopenssl + DEPENDS:=+python3-light +libopenssl +ca-bundle endef $(eval $(call Py3BasePackage,python3-openssl, \