mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 10:24:31 +04:00
python: introduce Build/Compile/HostPyRun{Host,Target}
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
@@ -82,13 +82,12 @@ endef
|
||||
|
||||
$(call include_mk, python-host.mk)
|
||||
|
||||
# $(1) => build subdir
|
||||
# $(2) => additional arguments to setup.py
|
||||
# $(1) => commands to execute before running pythons script
|
||||
# $(2) => python script and its arguments
|
||||
# $(3) => additional variables
|
||||
define Build/Compile/PyMod
|
||||
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
|
||||
define Build/Compile/HostPyRunTarget
|
||||
$(call HostPython, \
|
||||
cd $(PKG_BUILD_DIR)/$(strip $(1)); \
|
||||
$(if $(1),$(1);) \
|
||||
CC="$(TARGET_CC)" \
|
||||
CCSHARED="$(TARGET_CC) $(FPIC)" \
|
||||
CXX="$(TARGET_CXX)" \
|
||||
@@ -101,8 +100,19 @@ define Build/Compile/PyMod
|
||||
__PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
|
||||
$(3) \
|
||||
, \
|
||||
./setup.py $(2) \
|
||||
$(2) \
|
||||
)
|
||||
endef
|
||||
|
||||
# $(1) => build subdir
|
||||
# $(2) => additional arguments to setup.py
|
||||
# $(3) => additional variables
|
||||
define Build/Compile/PyMod
|
||||
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
|
||||
$(call Build/Compile/HostPyRunTarget, \
|
||||
cd $(PKG_BUILD_DIR)/$(strip $(1)), \
|
||||
./setup.py $(2), \
|
||||
$(3))
|
||||
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
|
||||
endef
|
||||
|
||||
|
||||
Reference in New Issue
Block a user