diff --git a/lang/python/gunicorn/Makefile b/lang/python/gunicorn/Makefile index 75f3bef57..49df326d2 100644 --- a/lang/python/gunicorn/Makefile +++ b/lang/python/gunicorn/Makefile @@ -66,7 +66,7 @@ define Package/gunicorn3/install $(PKG_INSTALL_DIR)/usr/bin/gunicorn \ $(1)/usr/bin/gunicorn3 $(LN) gunicorn3 $(1)/usr/bin/gunicorn - $(call Py3Shebang,$(1)/usr/bin/*) + $(call Python3/FixShebang,$(1)/usr/bin/*) endef $(eval $(call Py3Package,python3-gunicorn)) diff --git a/lang/python/python-gnupg/Makefile b/lang/python/python-gnupg/Makefile index 53f716547..fd439b245 100644 --- a/lang/python/python-gnupg/Makefile +++ b/lang/python/python-gnupg/Makefile @@ -50,7 +50,7 @@ Python 3.3, Python 3.4, or PyPy. endef define Py3Build/Compile - $(call Build/Compile/Py3Mod,,\ + $(call Python3/ModSetup,,\ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ ) endef diff --git a/lang/python/python-lxml/Makefile b/lang/python/python-lxml/Makefile index c2c7d3ad3..05decd704 100644 --- a/lang/python/python-lxml/Makefile +++ b/lang/python/python-lxml/Makefile @@ -48,7 +48,7 @@ endef TARGET_LDFLAGS += -lxml2 -lxslt -lexslt define Py3Build/Compile - $(call Build/Compile/Py3Mod,, \ + $(call Python3/ModSetup,, \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ --static \ --single-version-externally-managed \ diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk index 88ab726eb..b3326eaa8 100644 --- a/lang/python/python3-package.mk +++ b/lang/python/python3-package.mk @@ -34,7 +34,7 @@ ifdef CONFIG_USE_MIPS16 TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16 endif -define Py3Shebang +define Python3/FixShebang $(SED) "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python3," -i --follow-symlinks $(1) endef @@ -86,7 +86,7 @@ define Py3Package "$(HOST_PYTHON3_BIN)" "$$(2)" \ "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" && \ if [ -d "$$(1)/usr/bin" ]; then \ - $(call Py3Shebang,$$(1)/usr/bin/*) ; \ + $(call Python3/FixShebang,$$(1)/usr/bin/*) ; \ fi endef @@ -117,7 +117,7 @@ PYTHON3_VARS = \ # $(1) => directory of python script # $(2) => python script and its arguments # $(3) => additional variables -define Build/Compile/HostPy3RunTarget +define Python3/Run cd "$(if $(strip $(1)),$(strip $(1)),.)" && \ $(PYTHON3_VARS) \ $(3) \ @@ -127,9 +127,9 @@ endef # $(1) => build subdir # $(2) => additional arguments to setup.py # $(3) => additional variables -define Build/Compile/Py3Mod +define Python3/ModSetup $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR) - $(call Build/Compile/HostPy3RunTarget, \ + $(call Python3/Run, \ $(PKG_BUILD_DIR)/$(strip $(1)), \ setup.py $(2), \ $(3)) @@ -144,7 +144,7 @@ define Py3Build/Compile/Default $(if $(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS), $(call HostPython3/PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS)) ) - $(call Build/Compile/Py3Mod, \ + $(call Python3/ModSetup, \ $(PYTHON3_PKG_SETUP_DIR), \ $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ diff --git a/lang/python/python3-packages/Makefile b/lang/python/python3-packages/Makefile index 4310fe920..b1b37dac0 100644 --- a/lang/python/python3-packages/Makefile +++ b/lang/python/python3-packages/Makefile @@ -104,10 +104,10 @@ define Build/Compile $(call HostPython3/Run,,$(HOST_PYTHON3_PIP_INSTALL_HOST) $(pkg)) ) $(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list), - $(call Build/Compile/HostPy3RunTarget,,$(call HOST_PYTHON3_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs)) + $(call Python3/Run,,$(call HOST_PYTHON3_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs)) ) $(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list-cleanup), - $(call Build/Compile/HostPy3RunTarget,,$(HOST_PYTHON3_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs)) + $(call Python3/Run,,$(HOST_PYTHON3_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs)) ) endef diff --git a/net/scapy/Makefile b/net/scapy/Makefile index 19c06031e..4a3b395d3 100644 --- a/net/scapy/Makefile +++ b/net/scapy/Makefile @@ -37,7 +37,7 @@ define Package/scapy/description endef define Build/Compile - $(call Build/Compile/Py3Mod,., \ + $(call Python3/ModSetup,., \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \ ) endef diff --git a/net/uwsgi/Makefile b/net/uwsgi/Makefile index 9b95027d7..d658c9c28 100644 --- a/net/uwsgi/Makefile +++ b/net/uwsgi/Makefile @@ -108,7 +108,7 @@ define Build/Compile $(call Build/Compile/Default,plugin.logfile PROFILE=openwrt) $(call Build/Compile/Default,plugin.syslog PROFILE=openwrt) $(call Build/Compile/Default,plugin.cgi PROFILE=openwrt) - $(call Build/Compile/HostPy3RunTarget, \ + $(call Python3/Run, \ $(PKG_BUILD_DIR), \ uwsgiconfig.py --plugin plugins/python openwrt, \ CPP="$(TARGET_CROSS)cpp" \