From 5d72e9bf7e36d2398d1d794a882f4d0387d0451a Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 21 Feb 2019 19:52:07 +0800 Subject: [PATCH] python,python3: Add PYTHON_PKG_SETUP_DIR This adds a variable (PYTHON_PKG_SETUP_DIR / PYTHON3_PKG_SETUP_DIR) that allows a Python package Makefile to control the directory where setup.py is called (as part of PyBuild/Compile/Default / Py3Build/Compile/Default). Signed-off-by: Jeffery To --- lang/python/python-package.mk | 4 +++- lang/python/python3-package.mk | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lang/python/python-package.mk b/lang/python/python-package.mk index 260c989686..6fcf58d280 100644 --- a/lang/python/python-package.mk +++ b/lang/python/python-package.mk @@ -114,6 +114,7 @@ define Build/Compile/PyMod $(3)) endef +PYTHON_PKG_SETUP_DIR ?= PYTHON_PKG_SETUP_ARGS:=--single-version-externally-managed PYTHON_PKG_SETUP_VARS:= @@ -121,7 +122,8 @@ 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, \ + $(PYTHON_PKG_SETUP_DIR), \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ $(PYTHON_PKG_SETUP_ARGS), \ $(PYTHON_PKG_SETUP_VARS) \ diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk index 8999665469..81013ca83d 100644 --- a/lang/python/python3-package.mk +++ b/lang/python/python3-package.mk @@ -113,6 +113,7 @@ define Build/Compile/Py3Mod $(3)) endef +PYTHON3_PKG_SETUP_DIR ?= PYTHON3_PKG_SETUP_ARGS:=--single-version-externally-managed PYTHON3_PKG_SETUP_VARS:= @@ -120,7 +121,8 @@ 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, \ + $(PYTHON3_PKG_SETUP_DIR), \ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \ $(PYTHON3_PKG_SETUP_ARGS), \ $(PYTHON3_PKG_SETUP_VARS) \ -- 2.30.2