mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-07 09:18:42 +01:00
New this build bin path script (#1335)
* better this_build_bin_path script * Put new values first in PATH and PYTHONPATH. Remove LD_LIBRARY_PATH
This commit is contained in:
@@ -1,39 +1,14 @@
|
|||||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
#!/bin/bash
|
||||||
# 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
|
|
||||||
|
|
||||||
echo "this_path="$THIS_PATH
|
# Since this script could be sourced, $0 is not sufficent, BASH_SOURCE[0] is necessary
|
||||||
export PATH=$THIS_PATH:$PATH
|
SCRIPT_LOCATION="$(realpath ${BASH_SOURCE[0]})"
|
||||||
export LD_LIBRARY_PATH=$THIS_PATH:$LD_LIBRARY_PATH
|
SCRIPT_LOCATION="$(dirname ${SCRIPT_LOCATION})"
|
||||||
export PYTHONPATH=$THIS_PATH:$PYTHONPATH
|
BUILDBIN_LOCATION="${SCRIPT_LOCATION}/build/bin"
|
||||||
|
|
||||||
echo "path="$PATH
|
if [ ! -d "${BUILDBIN_LOCATION}" ]; then
|
||||||
echo "ld_library_path="$LD_LIBRARY_PATH
|
echo Cannot find path ${BUILDBIN_LOCATION}
|
||||||
echo "pythonpath="$PYTHON_PATH
|
else
|
||||||
|
echo Adding ${BUILDBIN_LOCATION} to PATH and PYTHONPATH
|
||||||
|
export PATH=${BUILDBIN_LOCATION}:${PATH}
|
||||||
|
export PYTHONPATH=${BUILDBIN_LOCATION}:${PYTHONPATH}
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user