2016-01-28 02:05:40 +00:00
|
|
|
addToSearchPathOnceWithCustomDelimiter() {
|
|
|
|
local delim="$1"
|
|
|
|
local search="$2"
|
|
|
|
local target="$3"
|
|
|
|
local dirs
|
|
|
|
local exported
|
|
|
|
IFS="$delim" read -a dirs <<< "${!search}"
|
2016-04-18 14:43:37 +01:00
|
|
|
local canonical
|
|
|
|
if canonical=$(readlink -e "$target"); then
|
|
|
|
for dir in ${dirs[@]}; do
|
|
|
|
if [ "z$dir" == "z$canonical" ]; then exported=1; fi
|
|
|
|
done
|
|
|
|
if [ -z $exported ]; then
|
|
|
|
eval "export ${search}=\"${!search}${!search:+$delim}$canonical\""
|
|
|
|
fi
|
2016-01-28 02:05:40 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
addToSearchPathOnce() {
|
|
|
|
addToSearchPathOnceWithCustomDelimiter ':' "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
propagateOnce() {
|
|
|
|
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
|
|
|
|
}
|
|
|
|
|
2015-09-27 15:46:48 +01:00
|
|
|
if [[ -z "$NIX_QT_PIC" ]]; then
|
2016-01-28 02:05:40 +00:00
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
|
2015-09-27 15:46:48 +01:00
|
|
|
export NIX_QT_PIC=1
|
|
|
|
fi
|