From 378f0f6ef63c023f4f27004152810451c6aa0a7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Sun, 27 Mar 2011 17:25:04 +0200
Subject: [PATCH] python.mk: add py_builddir_sh macro

---
 debian/python.mk | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/debian/python.mk b/debian/python.mk
index c3137a3..de4ff44 100644
--- a/debian/python.mk
+++ b/debian/python.mk
@@ -30,6 +30,9 @@ py_libdir = /usr/lib/python$(strip $(if $(findstring 3.,$(subst python,,$(1))),3
 
 py_pkgname = $(if $(findstring 3.,$(2)),$(subst python-,python3-,$(1)),$(1))
 
+# distutils' build directory
+py_builddir = $(shell python$(strip $(1)) -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)')
+
 
 # The same macros for use inside loops in shell snippets
 
@@ -37,8 +40,7 @@ py_sitename_sh = $$(basename $$(_py_=$(strip $(1)); python$${_py_\#python*} -c '
 
 py_libdir_sh = $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())')
 
+py_builddir_sh = $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)')
+
 # Arguments to pass to setup.py install
 py_setup_install_args = --install-layout=deb
-
-# distutils' build directory
-py_builddir = $(shell python$(strip $(1)) -c "from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)")
-- 
GitLab