From a7a829530ee25b239a4e4d9ccb9ff97c6206da5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 9 Nov 2023 14:51:47 +0100 Subject: [PATCH] Update Python installation on Debian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Between Debian 11 and 12 the way to install Python packages into the system location under /usr, and not /usr/local, changed[1]. The previous setup argument --install-layout=deb is now unsupported and the environment variable DEB_PYTHON_INSTALL_LAYOUT needs to be set instead. See also [2]. [1]: https://lists.debian.org/debian-devel/2023/07/msg00307.html [2]: https://salsa.debian.org/selinux-team/libselinux/-/commit/cbfb31a0925e01591a9cce1eb3a0e517f42b144c Signed-off-by: Christian Göttsche Acked-by: James Carter --- README.md | 6 +++++- scripts/run-scan-build | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c475126..765b5626 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,11 @@ To build and install everything under a private directory, run: make DESTDIR=~/obj install install-rubywrap install-pywrap -On Debian `PYTHON_SETUP_ARGS='--install-option "--install-layout=deb"'` needs to be set when installing the python wrappers in order to create the correct python directory structure. +On Debian the environment variable `DEB_PYTHON_INSTALL_LAYOUT` needs to be set +to `deb` when installing the Python wrappers in order to create the correct +Python directory structure. +On Debian systems older than bookworm set +`PYTHON_SETUP_ARGS='--install-option "--install-layout=deb"'` instead. To run tests with the built libraries and programs, several paths (relative to `$DESTDIR`) need to be added to variables `$LD_LIBRARY_PATH`, `$PATH` and `$PYTHONPATH`. This can be done using [./scripts/env_use_destdir](./scripts/env_use_destdir): diff --git a/scripts/run-scan-build b/scripts/run-scan-build index 931ffd2a..7b731f3e 100755 --- a/scripts/run-scan-build +++ b/scripts/run-scan-build @@ -25,7 +25,7 @@ export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "import sysconfig; print(sysc export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')" if [ -f /etc/debian_version ] && [ -z "${IS_CIRCLE_CI:-}" ] ; then - export PYTHON_SETUP_ARGS='--install-layout=deb' + export DEB_PYTHON_INSTALL_LAYOUT='deb' fi # Build and analyze