Merge pull request #28237 from avnik/qt5-mktemp

qt5: use `mktemp -d` to create fake Qt prefix in nix-shell
This commit is contained in:
Thomas Tuegel 2017-09-23 07:18:25 -05:00 committed by GitHub
commit 5eb2c7a753

View File

@ -116,7 +116,11 @@ fi
if [ -z "$NIX_QT5_TMP" ]; then
if [ -z "$NIX_QT_SUBMODULE" ]; then
NIX_QT5_TMP=$(pwd)/__nix_qt5__
if [ -z "$IN_NIX_SHELL" ]; then
NIX_QT5_TMP=$(pwd)/__nix_qt5__
else
NIX_QT5_TMP=$(mktemp -d)
fi
else
NIX_QT5_TMP=$out
fi
@ -142,3 +146,10 @@ EOF
export QMAKE="$NIX_QT5_TMP/bin/qmake"
fi
_qtShellCleanupHook () {
rm -fr $NIX_QT5_TMP
}
if [ -n "$IN_NIX_SHELL" ]; then
trap _qtShellCleanupHook EXIT
fi