mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 14:44:36 +04:00
python: fix HostPython host/target selection
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
@@ -11,15 +11,19 @@ HOST_PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
|
|||||||
|
|
||||||
HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOST)/$(HOST_PYTHON_PKG_DIR)
|
HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOST)/$(HOST_PYTHON_PKG_DIR)
|
||||||
define HostPython
|
define HostPython
|
||||||
ifeq ($(3),)
|
ifeq ($(strip $(3)),HOST)
|
||||||
$(3):=$(PYTHONPATH)
|
LOCAL_PYTHONPATH:=$(HOST_PYTHONPATH)
|
||||||
|
LOCAL_STAGING_DIR:=$(STAGING_DIR_HOST)
|
||||||
|
else
|
||||||
|
LOCAL_PYTHONPATH:=$(PYTHONPATH)
|
||||||
|
LOCAL_STAGING_DIR:=$(STAGING_DIR)
|
||||||
endif
|
endif
|
||||||
( export PYTHONPATH="$(3)"; \
|
( export PYTHONPATH="$(LOCAL_PYTHONPATH)"; \
|
||||||
export PYTHONOPTIMIZE=""; \
|
export PYTHONOPTIMIZE=""; \
|
||||||
export PYTHONDONTWRITEBYTECODE=1; \
|
export PYTHONDONTWRITEBYTECODE=1; \
|
||||||
export _python_sysroot="$(STAGING_DIR_HOST)"; \
|
export _python_sysroot="$(LOCAL_STAGING_DIR)/usr"; \
|
||||||
export _python_prefix=""; \
|
export _python_prefix="/usr"; \
|
||||||
export _python_exec_prefix=""; \
|
export _python_exec_prefix="/usr"; \
|
||||||
$(1) \
|
$(1) \
|
||||||
$(HOST_PYTHON_BIN) $(2); \
|
$(HOST_PYTHON_BIN) $(2); \
|
||||||
)
|
)
|
||||||
@@ -52,7 +56,7 @@ define Build/Compile/HostPyMod
|
|||||||
, \
|
, \
|
||||||
./setup.py $(2) \
|
./setup.py $(2) \
|
||||||
, \
|
, \
|
||||||
$(HOST_PYTHONPATH) \
|
HOST \
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|||||||
@@ -105,8 +105,6 @@ define Build/Compile/PyMod
|
|||||||
$(3) \
|
$(3) \
|
||||||
, \
|
, \
|
||||||
./setup.py $(2) \
|
./setup.py $(2) \
|
||||||
, \
|
|
||||||
$(PYTHONPATH) \
|
|
||||||
)
|
)
|
||||||
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
|
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
|
||||||
endef
|
endef
|
||||||
|
|||||||
Reference in New Issue
Block a user