From b4d692e68d78dd7494995a1999f30ceaea1bc792 Mon Sep 17 00:00:00 2001 From: Qt6 Port Date: Thu, 12 Nov 2026 08:33:10 +0100 Subject: [PATCH] Make this_build_bin_path.sh work with the Qt6 build directory Auto-detect build_qt6/build (under the script directory, its parent or the current directory), accept an explicit build dir or bin dir, honour SLS_BUILD_DIR, and keep the exported PATH/LD_LIBRARY_PATH/PYTHONPATH free of duplicate entries. The old script only knew build/bin and used BASH_ARGV debug prints. --- this_build_bin_path.sh | 124 +++++++++++++++++++++++++++++------------ 1 file changed, 88 insertions(+), 36 deletions(-) diff --git a/this_build_bin_path.sh b/this_build_bin_path.sh index 8d0528673..1de99142a 100755 --- a/this_build_bin_path.sh +++ b/this_build_bin_path.sh @@ -1,39 +1,91 @@ # SPDX-License-Identifier: LGPL-3.0-or-other # Copyright (C) 2021 Contributors to the SLS Detector Package -#echo $# -#if [ $# = 0 ]; then -# f=$0 -#else -# f=$1 -#fi -#echo $f -if [ "x${BASH_ARGV[0]}" = "x" ]; then -#if [ "x$f" = "x" ]; then - if [ ! -f this_build_bin_path.sh ]; then - f=$0 - echo "aaaa" - #thispath=$(dirname ${BASH_ARGV[0]}) - thispath=$(dirname $f) - p=$(cd ${thispath};pwd); - THIS_PATH="$p/build/bin/" - # echo "ERROR: must cd where/this/package/is before calling this_path.sh" -# echo "Try sourcing it" - else - echo "bbb" - THIS_PATH="$PWD/build/bin/"; - fi -else - thispath=$(dirname ${BASH_ARGV[0]}) - p=$(cd ${thispath};pwd); - THIS_PATH="$p/build/bin/" - echo "ccc" -fi +# +# Put the binaries of a build tree on PATH/LD_LIBRARY_PATH/PYTHONPATH. +# +# Usage (the exports only survive when the script is sourced): +# source this_build_bin_path.sh # auto-detect build dir +# source this_build_bin_path.sh build_qt6 # explicit build dir +# SLS_BUILD_DIR=/path/to/build_qt6 source this_build_bin_path.sh +# +# Auto-detection looks for