qt55.qtbase: canonicalize paths in addToSearchPathOnce

This commit is contained in:
Thomas Tuegel 2016-04-18 08:43:37 -05:00
parent 51fe07711f
commit 8727485e08

View File

@ -2,7 +2,7 @@ if [[ -z "$QMAKE" ]]; then
_qtLinkDependencyDir() { _qtLinkDependencyDir() {
@lndir@/bin/lndir -silent "$1/$2" "$qtOut/$2" @lndir@/bin/lndir -silent "$1/$2" "$qtOut/$2"
if [[ -n "$NIX_QT_SUBMODULE" ]]; then if [ -n "$NIX_QT_SUBMODULE" ]; then
find "$1/$2" -printf "$2/%P\n" >> "$out/nix-support/qt-inputs" find "$1/$2" -printf "$2/%P\n" >> "$out/nix-support/qt-inputs"
fi fi
} }
@ -22,13 +22,13 @@ _qtLinkModule() {
_qtRmModules() { _qtRmModules() {
cat "$out/nix-support/qt-inputs" | while read file; do cat "$out/nix-support/qt-inputs" | while read file; do
if [[ -h "$out/$file" ]]; then if [ -h "$out/$file" ]; then
rm "$out/$file" rm "$out/$file"
fi fi
done done
cat "$out/nix-support/qt-inputs" | while read file; do cat "$out/nix-support/qt-inputs" | while read file; do
if [[ -d "$out/$file" ]]; then if [ -d "$out/$file" ]; then
rmdir --ignore-fail-on-non-empty -p "$out/$file" rmdir --ignore-fail-on-non-empty -p "$out/$file"
fi fi
done done
@ -43,11 +43,14 @@ addToSearchPathOnceWithCustomDelimiter() {
local dirs local dirs
local exported local exported
IFS="$delim" read -a dirs <<< "${!search}" IFS="$delim" read -a dirs <<< "${!search}"
for dir in ${dirs[@]}; do local canonical
if [ "z$dir" == "z$target" ]; then exported=1; fi if canonical=$(readlink -e "$target"); then
done for dir in ${dirs[@]}; do
if [ -z $exported ]; then if [ "z$dir" == "z$canonical" ]; then exported=1; fi
eval "export ${search}=\"${!search}${!search:+$delim}$target\"" done
if [ -z $exported ]; then
eval "export ${search}=\"${!search}${!search:+$delim}$canonical\""
fi
fi fi
} }
@ -97,7 +100,7 @@ _qtMultioutDevs() {
} }
qtOut="" qtOut=""
if [[ -z "$NIX_QT_SUBMODULE" ]]; then if [ -z "$NIX_QT_SUBMODULE" ]; then
qtOut=`mktemp -d` qtOut=`mktemp -d`
else else
qtOut=$out qtOut=$out