python3: Rename canned recipes in python3-package.mk

This renames "internal" recipes to use the Python3/ prefix and clarifies
the names (RunTarget to Run, Mod to ModSetup, Shebang to FixShebang).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To 2020-04-09 23:28:07 +08:00
parent 87b8f45230
commit fc8387614c
7 changed files with 13 additions and 13 deletions

View file

@ -66,7 +66,7 @@ define Package/gunicorn3/install
$(PKG_INSTALL_DIR)/usr/bin/gunicorn \ $(PKG_INSTALL_DIR)/usr/bin/gunicorn \
$(1)/usr/bin/gunicorn3 $(1)/usr/bin/gunicorn3
$(LN) gunicorn3 $(1)/usr/bin/gunicorn $(LN) gunicorn3 $(1)/usr/bin/gunicorn
$(call Py3Shebang,$(1)/usr/bin/*) $(call Python3/FixShebang,$(1)/usr/bin/*)
endef endef
$(eval $(call Py3Package,python3-gunicorn)) $(eval $(call Py3Package,python3-gunicorn))

View file

@ -50,7 +50,7 @@ Python 3.3, Python 3.4, or PyPy.
endef endef
define Py3Build/Compile define Py3Build/Compile
$(call Build/Compile/Py3Mod,,\ $(call Python3/ModSetup,,\
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
) )
endef endef

View file

@ -48,7 +48,7 @@ endef
TARGET_LDFLAGS += -lxml2 -lxslt -lexslt TARGET_LDFLAGS += -lxml2 -lxslt -lexslt
define Py3Build/Compile define Py3Build/Compile
$(call Build/Compile/Py3Mod,, \ $(call Python3/ModSetup,, \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
--static \ --static \
--single-version-externally-managed \ --single-version-externally-managed \

View file

@ -34,7 +34,7 @@ ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16 TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
endif endif
define Py3Shebang define Python3/FixShebang
$(SED) "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python3," -i --follow-symlinks $(1) $(SED) "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python3," -i --follow-symlinks $(1)
endef endef
@ -86,7 +86,7 @@ define Py3Package
"$(HOST_PYTHON3_BIN)" "$$(2)" \ "$(HOST_PYTHON3_BIN)" "$$(2)" \
"$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" && \ "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" && \
if [ -d "$$(1)/usr/bin" ]; then \ if [ -d "$$(1)/usr/bin" ]; then \
$(call Py3Shebang,$$(1)/usr/bin/*) ; \ $(call Python3/FixShebang,$$(1)/usr/bin/*) ; \
fi fi
endef endef
@ -117,7 +117,7 @@ PYTHON3_VARS = \
# $(1) => directory of python script # $(1) => directory of python script
# $(2) => python script and its arguments # $(2) => python script and its arguments
# $(3) => additional variables # $(3) => additional variables
define Build/Compile/HostPy3RunTarget define Python3/Run
cd "$(if $(strip $(1)),$(strip $(1)),.)" && \ cd "$(if $(strip $(1)),$(strip $(1)),.)" && \
$(PYTHON3_VARS) \ $(PYTHON3_VARS) \
$(3) \ $(3) \
@ -127,9 +127,9 @@ endef
# $(1) => build subdir # $(1) => build subdir
# $(2) => additional arguments to setup.py # $(2) => additional arguments to setup.py
# $(3) => additional variables # $(3) => additional variables
define Build/Compile/Py3Mod define Python3/ModSetup
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR) $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
$(call Build/Compile/HostPy3RunTarget, \ $(call Python3/Run, \
$(PKG_BUILD_DIR)/$(strip $(1)), \ $(PKG_BUILD_DIR)/$(strip $(1)), \
setup.py $(2), \ setup.py $(2), \
$(3)) $(3))
@ -144,7 +144,7 @@ define Py3Build/Compile/Default
$(if $(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS), $(if $(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
$(call HostPython3/PipInstall,$(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_DIR), \
$(PYTHON3_PKG_SETUP_GLOBAL_ARGS) \ $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \

View file

@ -104,10 +104,10 @@ define Build/Compile
$(call HostPython3/Run,,$(HOST_PYTHON3_PIP_INSTALL_HOST) $(pkg)) $(call HostPython3/Run,,$(HOST_PYTHON3_PIP_INSTALL_HOST) $(pkg))
) )
$(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list), $(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), $(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

View file

@ -37,7 +37,7 @@ define Package/scapy/description
endef endef
define Build/Compile define Build/Compile
$(call Build/Compile/Py3Mod,., \ $(call Python3/ModSetup,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
) )
endef endef

View file

@ -108,7 +108,7 @@ define Build/Compile
$(call Build/Compile/Default,plugin.logfile PROFILE=openwrt) $(call Build/Compile/Default,plugin.logfile PROFILE=openwrt)
$(call Build/Compile/Default,plugin.syslog PROFILE=openwrt) $(call Build/Compile/Default,plugin.syslog PROFILE=openwrt)
$(call Build/Compile/Default,plugin.cgi PROFILE=openwrt) $(call Build/Compile/Default,plugin.cgi PROFILE=openwrt)
$(call Build/Compile/HostPy3RunTarget, \ $(call Python3/Run, \
$(PKG_BUILD_DIR), \ $(PKG_BUILD_DIR), \
uwsgiconfig.py --plugin plugins/python openwrt, \ uwsgiconfig.py --plugin plugins/python openwrt, \
CPP="$(TARGET_CROSS)cpp" \ CPP="$(TARGET_CROSS)cpp" \