mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 06:04:31 +04:00
python: unify HostPython and HostHostPython functions
That means basically moving the host Python from $(STAGING_DIR_HOST) to $(STAGING_DIR_HOST)/usr and making the PYTHONPATH var as an argument. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
@@ -17,21 +17,10 @@ PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
|
||||
|
||||
PYTHON:=python$(PYTHON_VERSION)
|
||||
|
||||
HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION)
|
||||
HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/usr/lib/python$(PYTHON_VERSION)
|
||||
HOST_PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/python2
|
||||
|
||||
PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
|
||||
define HostPython
|
||||
( export PYTHONPATH="$(PYTHONPATH)"; \
|
||||
export PYTHONOPTIMIZE=""; \
|
||||
export PYTHONDONTWRITEBYTECODE=1; \
|
||||
export _python_sysroot="$(STAGING_DIR)"; \
|
||||
export _python_prefix="/usr"; \
|
||||
export _python_exec_prefix="/usr"; \
|
||||
$(1) \
|
||||
$(HOST_PYTHON_BIN) $(2); \
|
||||
)
|
||||
endef
|
||||
|
||||
# These configure args are needed in detection of path to Python header files
|
||||
# using autotools.
|
||||
@@ -94,6 +83,8 @@ define PyPackage
|
||||
endef
|
||||
endef
|
||||
|
||||
$(call include_mk, python-host.mk)
|
||||
|
||||
# $(1) => build subdir
|
||||
# $(2) => additional arguments to setup.py
|
||||
# $(3) => additional variables
|
||||
@@ -114,6 +105,8 @@ define Build/Compile/PyMod
|
||||
$(3) \
|
||||
, \
|
||||
./setup.py $(2) \
|
||||
, \
|
||||
$(PYTHONPATH) \
|
||||
)
|
||||
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
|
||||
endef
|
||||
|
||||
Reference in New Issue
Block a user