python,python3: add host python pip install support
To install Python packages host side, that may be needed for a build. The intent, is to try to reduce host-side Python packages being installed via LEDE/OpenWrt build system. Because those seem like a pain to maintain. The idea is adapted from Yousong's `python-packages` package. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
parent
93a6545591
commit
612c53fc6c
4 changed files with 32 additions and 0 deletions
|
@ -60,6 +60,19 @@ define Build/Compile/HostPyRunHost
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
|
||||||
|
HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
|
||||||
|
define host_python_pip_install
|
||||||
|
$(HOST_PYTHON_PIP) install \
|
||||||
|
--root=$(1) \
|
||||||
|
--prefix=$(2) \
|
||||||
|
--ignore-installed \
|
||||||
|
$(3)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define host_python_pip_install_host
|
||||||
|
$(call host_python_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
|
||||||
|
endef
|
||||||
|
|
||||||
# $(1) => build subdir
|
# $(1) => build subdir
|
||||||
# $(2) => additional arguments to setup.py
|
# $(2) => additional arguments to setup.py
|
||||||
|
|
|
@ -126,6 +126,9 @@ define Build/Compile/PyMod
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define PyBuild/Compile/Default
|
define PyBuild/Compile/Default
|
||||||
|
$(foreach pkg,$(HOST_PYTHON_PACKAGE_BUILD_DEPENDS),
|
||||||
|
$(call host_python_pip_install_host,$(pkg))
|
||||||
|
)
|
||||||
$(call Build/Compile/PyMod,, \
|
$(call Build/Compile/PyMod,, \
|
||||||
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
|
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
|
||||||
--single-version-externally-managed \
|
--single-version-externally-managed \
|
||||||
|
|
|
@ -60,6 +60,19 @@ define Build/Compile/HostPy3RunHost
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
|
||||||
|
HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
|
||||||
|
define host_python3_pip_install
|
||||||
|
$(HOST_PYTHON3_PIP) install \
|
||||||
|
--root=$(1) \
|
||||||
|
--prefix=$(2) \
|
||||||
|
--ignore-installed \
|
||||||
|
$(3)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define host_python3_pip_install_host
|
||||||
|
$(call host_python3_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
|
||||||
|
endef
|
||||||
|
|
||||||
# $(1) => build subdir
|
# $(1) => build subdir
|
||||||
# $(2) => additional arguments to setup.py
|
# $(2) => additional arguments to setup.py
|
||||||
|
|
|
@ -126,6 +126,9 @@ define Build/Compile/Py3Mod
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Py3Build/Compile/Default
|
define Py3Build/Compile/Default
|
||||||
|
$(foreach pkg,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
|
||||||
|
$(call host_python3_pip_install_host,$(pkg))
|
||||||
|
)
|
||||||
$(call Build/Compile/Py3Mod,, \
|
$(call Build/Compile/Py3Mod,, \
|
||||||
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
|
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
|
||||||
--single-version-externally-managed \
|
--single-version-externally-managed \
|
||||||
|
|
Loading…
Reference in a new issue