1From bf9f0d619e2e0a424e471a2f9235d26ece5b348c Mon Sep 17 00:00:00 2001 2From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> 3Date: Fri, 7 Jan 2022 19:32:18 +0100 4Subject: [PATCH] pybind11/commands.py: support STAGING_DIR 5 6In Buildroot, we install build-time python scripts in the host directory 7(otherwise they can't be run with host python), but when running 8pybind11 --includes it should return the staging directory. 9 10Patch commands.py to use the STAGING_DIR environment variable instead of 11the current directory, if it is set. 12 13Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> 14Upstream-Status: N/A, Buildroot specific 15Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com> 16--- 17 pybind11/commands.py | 3 ++- 18 1 file changed, 2 insertions(+), 1 deletion(-) 19 20diff --git a/pybind11/commands.py b/pybind11/commands.py 21index a29c8ca..de8a27c 100644 22--- a/pybind11/commands.py 23+++ b/pybind11/commands.py 24@@ -1,6 +1,7 @@ 25 import os 26 27-DIR = os.path.abspath(os.path.dirname(__file__)) 28+DIR = os.environ.get('STAGING_DIR') or \ 29+ os.path.abspath(os.path.dirname(__file__)) 30 31 32 def get_include(user: bool = False) -> str: # pylint: disable=unused-argument 33-- 342.31.1 35 36