$(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))
endef
define Py3Build/Compile
- $(call Build/Compile/Py3Mod,,\
+ $(call Python3/ModSetup,,\
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
)
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 \
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
"$(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
# $(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) \
# $(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))
$(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)" \
$(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
endef
define Build/Compile
- $(call Build/Compile/Py3Mod,., \
+ $(call Python3/ModSetup,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
)
endef
$(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" \