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:
parent
87b8f45230
commit
fc8387614c
7 changed files with 13 additions and 13 deletions
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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)" \
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" \
|
||||
|
|
Loading…
Reference in a new issue