From 0e78a105c83f5f8b92edd1f55be684afbb483377 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Tue, 27 Aug 2019 03:37:06 -0400 Subject: [PATCH] uwsgi-cgi: use python3 hostpkg not system python3 On a Debian system without python3-distutils install, uwsgi-cgi was failing to build because it couldn't import sysconfig from distutils. OpenWrt packages should be using the OpenWrt python not the system python. In addition we need to use python3 not python2, even when both are available. (cherry-pick c387d0923c8ced06f685b487f84ae0836d7f3e9b from master) Signed-off-by: Daniel F. Dickinson --- net/uwsgi-cgi/Makefile | 5 ++++- .../patches/020-uwsgiconfig-system-python3.patch | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 net/uwsgi-cgi/patches/020-uwsgiconfig-system-python3.patch diff --git a/net/uwsgi-cgi/Makefile b/net/uwsgi-cgi/Makefile index 06041f2b68..933ce885ea 100644 --- a/net/uwsgi-cgi/Makefile +++ b/net/uwsgi-cgi/Makefile @@ -15,6 +15,8 @@ PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Ansuel Smith +PKG_BUILD_DEPENDS:=python3/host + include $(INCLUDE_DIR)/package.mk define Package/uwsgi-cgi @@ -39,7 +41,8 @@ define Package/uwsgi-cgi/description endef MAKE_VARS+=\ - CPP=$(TARGET_CROSS)cpp + CPP=$(TARGET_CROSS)cpp \ + PYTHON=$(STAGING_DIR_HOSTPKG)/bin/python3 define Build/Compile $(call Build/Compile/Default,PROFILE=cgi) diff --git a/net/uwsgi-cgi/patches/020-uwsgiconfig-system-python3.patch b/net/uwsgi-cgi/patches/020-uwsgiconfig-system-python3.patch new file mode 100644 index 0000000000..82522be19a --- /dev/null +++ b/net/uwsgi-cgi/patches/020-uwsgiconfig-system-python3.patch @@ -0,0 +1,10 @@ +Index: uwsgi-2.0.18/Makefile +=================================================================== +--- uwsgi-2.0.18.orig/Makefile ++++ uwsgi-2.0.18/Makefile +@@ -1,4 +1,4 @@ +-PYTHON := python ++PYTHON ?= python3 + + all: + $(PYTHON) uwsgiconfig.py --build $(PROFILE) -- 2.30.2