3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh

31 lines
795 B
Bash
Raw Normal View History

addToSearchPathOnceWithCustomDelimiter() {
local delim="$1"
local search="$2"
local target="$3"
local dirs
local exported
IFS="$delim" read -a dirs <<< "${!search}"
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
fi
}
addToSearchPathOnce() {
addToSearchPathOnceWithCustomDelimiter ':' "$@"
}
propagateOnce() {
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
}
2015-09-27 15:46:48 +01:00
if [[ -z "$NIX_QT_PIC" ]]; then
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