New this build bin path script (#1335)
All checks were successful
Build on RHEL8 / build (push) Successful in 5m34s
Build on RHEL9 / build (push) Successful in 5m54s

* better this_build_bin_path script
* Put new values first in PATH and PYTHONPATH. Remove LD_LIBRARY_PATH
This commit is contained in:
2025-11-25 16:29:48 +01:00
committed by GitHub
parent 1cf9dc21ab
commit 0ba9a269a1

View File

@@ -1,39 +1,14 @@
# SPDX-License-Identifier: LGPL-3.0-or-other #!/bin/bash
# Copyright (C) 2021 Contributors to the SLS Detector Package
#echo $# # Since this script could be sourced, $0 is not sufficent, BASH_SOURCE[0] is necessary
#if [ $# = 0 ]; then SCRIPT_LOCATION="$(realpath ${BASH_SOURCE[0]})"
# f=$0 SCRIPT_LOCATION="$(dirname ${SCRIPT_LOCATION})"
#else BUILDBIN_LOCATION="${SCRIPT_LOCATION}/build/bin"
# f=$1
#fi if [ ! -d "${BUILDBIN_LOCATION}" ]; then
#echo $f echo Cannot find path ${BUILDBIN_LOCATION}
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 else
thispath=$(dirname ${BASH_ARGV[0]}) echo Adding ${BUILDBIN_LOCATION} to PATH and PYTHONPATH
p=$(cd ${thispath};pwd); export PATH=${BUILDBIN_LOCATION}:${PATH}
THIS_PATH="$p/build/bin/" export PYTHONPATH=${BUILDBIN_LOCATION}:${PYTHONPATH}
echo "ccc"
fi fi
echo "this_path="$THIS_PATH
export PATH=$THIS_PATH:$PATH
export LD_LIBRARY_PATH=$THIS_PATH:$LD_LIBRARY_PATH
export PYTHONPATH=$THIS_PATH:$PYTHONPATH
echo "path="$PATH
echo "ld_library_path="$LD_LIBRARY_PATH
echo "pythonpath="$PYTHON_PATH