diff options
Diffstat (limited to 'lang/python')
| -rw-r--r-- | lang/python/README.md | 27 | ||||
| -rw-r--r-- | lang/python/python3-package.mk | 6 |
2 files changed, 32 insertions, 1 deletions
diff --git a/lang/python/README.md b/lang/python/README.md index 5681cb5d3..2a05d3c00 100644 --- a/lang/python/README.md +++ b/lang/python/README.md @@ -369,3 +369,30 @@ HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm ``` The Python package will be installed in `$(STAGING_DIR_HOSTPKG)/lib/pythonX.Y/site-packages`. + +#### Non-Python packages installing host-side Python packages + +Non-Python packages can also install host-side Python packages using the same mechanism: + +* Set `HOST_PYTHON3_PACKAGE_BUILD_DEPENDS` (see above for details). + +* Include `python3-package.mk` (set `PYTHON3_PKG_BUILD:=0` to avoid using the default Python package build recipes). + +* Call `Py3Build/InstallBuildDepends` to initiate the installation. + +For example: + +``` +PYTHON3_PKG_BUILD:=0 +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm + +include $(INCLUDE_DIR)/package.mk +include ../../lang/python/python3-package.mk +# If outside of the packages feed: +# include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk + +define Build/Compile + $(call Py3Build/InstallBuildDepends) + $(call Build/Compile/Default) +endef +``` diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk index 20c8ca58a..c2617f69c 100644 --- a/lang/python/python3-package.mk +++ b/lang/python/python3-package.mk @@ -215,10 +215,14 @@ define Py3Build/CheckHostPipVersionMatch endef endif -define Py3Build/Compile/Default +define Py3Build/InstallBuildDepends $(if $(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS), \ $(call HostPython3/PipInstall,$(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS)) \ ) +endef + +define Py3Build/Compile/Default + $(call Py3Build/InstallBuildDepends) $(call Python3/ModSetup, \ $(PYTHON3_PKG_SETUP_DIR), \ $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) \ |
