forked from KATRIN-Experiment/Kassiopeia
-
Notifications
You must be signed in to change notification settings - Fork 2
/
kasperenv.sh.in
executable file
·92 lines (73 loc) · 3.38 KB
/
kasperenv.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
# To automatically set the KASPER directory on opening a terminal,
# append this line to your ~/.bashrc or ~/.zshrc file (or similar):
# source <kasper install path>/bin/kasperenv.sh
printf "\033[32;1mThis is KASSIOPEIA v@KASPER_VERSION@ (build: @KASPER_BUILD_TIMESTAMP@) [git:@KASPER_GIT_REVISION@]\n"
if [ -n "${KASPERSYS}" ]
then
export OLD_KASPERSYS=${KASPERSYS}
OLD_PATH=${OLD_KASPERSYS}/bin:
OLD_LDLIBPATH=${OLD_KASPERSYS}/lib:
OLD_PKGCFGPATH=${OLD_KASPERSYS}/lib/pkgconfig:
OLD_PYTHONPATH=${OLD_KASPERSYS}/lib/python:
OLD_CMAKE_PREF=${OLD_KASPERSYS}:
OLD_ROOT_INCLUDE_PATH=${OLD_KASPERSYS}/include:
fi
if [ -n "${KASPER_INSTALL}" ]
then
export OLD_KASPER_INSTALL=${KASPER_INSTALL}
OLD_PATH=${OLD_KASPER_INSTALL}/bin:
OLD_LDLIBPATH=${OLD_KASPER_INSTALL}/lib:
OLD_PKGCFGPATH=${OLD_KASPER_INSTALL}/lib/pkgconfig:
OLD_PYTHONPATH=${OLD_KASPER_INSTALL}/lib/python:
OLD_CMAKE_PREF=${OLD_KASPER_INSTALL}:
OLD_ROOT_INCLUDE_PATH=${OLD_KASPER_INSTALL}/include:
fi
if [ -n "${KASPER_SOURCE}" ]
then
export OLD_KASPER_SOURCE=${KASPER_SOURCE}
fi
export KASPER_SOURCE=@CMAKE_HOME_DIRECTORY@
export KASPER_INSTALL=@KASPER_INSTALL_DIR@
KASPER_INSTALL_BIN=@BIN_INSTALL_DIR@
KASPER_INSTALL_LIB=@LIB_INSTALL_DIR@
KASPER_INSTALL_CACHE=@CACHE_INSTALL_DIR@
KASPER_INSTALL_INCLUDE=@INCLUDE_INSTALL_DIR@
printf "\033[32;1m** KASPER source directory set to ${KASPER_SOURCE}\033[0m\n"
printf "\033[32;1m** KASPER install directory set to ${KASPER_INSTALL}\033[0m\n"
if [ $# -eq 0 ]
then
KASPERSYS=${KASPER_INSTALL}
else
KASPERSYS=`readlink -f $1`
fi
export KASPERSYS
printf "\033[32;1m** KASPER config directory set to ${KASPERSYS}\033[0m\n"
if [ ! -z "${KEMFIELD_CACHE}" -a -w "${KEMFIELD_CACHE}" ]
then
printf "\033[32;1m** Using KEMField cache in ${KEMFIELD_CACHE}\033[0m\n"
else
if [ -w "${KASPER_INSTALL_CACHE}/KEMField/" ]
then
printf "\033[36;1m** Setting KEMField cache to ${KASPER_INSTALL_CACHE}/KEMField\033[0m\n"
KEMFIELD_CACHE=${KASPER_INSTALL_CACHE}/KEMField
else
printf "\033[33;1m** Directory ${KASPER_INSTALL_CACHE}/KEMField/ does not exist or is not writeable, setting KEMField cache to ${HOME}/.cache/KEMField\033[0m\n"
KEMFIELD_CACHE=${HOME}/.cache/KEMField
fi
fi
export KEMFIELD_CACHE
mkdir -p ${KEMFIELD_CACHE}
[[ -n $OLD_PATH ]] && export PATH=$(echo $PATH | sed "s;${OLD_PATH};;g")
export PATH=${KASPER_INSTALL_BIN}:$PATH
[[ -n $OLD_LDLIBPATH ]] && export LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed "s;${OLD_LDLIBPATH};;g")
export LD_LIBRARY_PATH=${KASPER_INSTALL_LIB}:$LD_LIBRARY_PATH
[[ -n $OLD_PKGCFGPATH ]] && export PKG_CONFIG_PATH=$(echo $PKG_CONFIG_PATH | sed "s;${OLD_PKGCFGPATH};;g")
export PKG_CONFIG_PATH=${KASPER_INSTALL_LIB}/pkgconfig:$PKG_CONFIG_PATH
[[ -n $OLD_PYTHONPATH ]] && export PYTHONPATH=$(echo $PYTHONPATH | sed "s;${OLD_PYTHONPATH};;g")
export PYTHONPATH=${KASPER_INSTALL_LIB}/python:$PYTHONPATH
[[ -n $OLD_CMAKE_PREF ]] && export CMAKE_PREFIX_PATH=$(echo $CMAKE_PREFIX_PATH | sed "s;${OLD_CMAKE_PREF};;g")
export CMAKE_PREFIX_PATH=${KASPER_INSTALL}:$CMAKE_PREFIX_PATH
[[ -n $OLD_ROOT_INCLUDE_PATH ]] && export ROOT_INCLUDE_PATH=$(echo $ROOT_INCLUDE_PATH | sed "s;${OLD_ROOT_INCLUDE_PATH};;g")
export ROOT_INCLUDE_PATH=${KASPER_INSTALL_INCLUDE}:$ROOT_INCLUDE_PATH
return 0