qt5: factor out common qmake setup hook

This commit is contained in:
Thomas Tuegel 2016-12-03 09:55:39 -06:00
parent 53a694e096
commit 2c4995c013
No known key found for this signature in database
GPG key ID: 22CBF5249D4B4D59
6 changed files with 9 additions and 87 deletions

View file

@ -113,7 +113,10 @@ let
];
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
qmakeHook = makeSetupHook { substitutions = { qt_dev = qtbase.dev; lndir = pkgs.xorg.lndir; }; } ./qmake-hook.sh;
qmakeHook =
makeSetupHook
{ deps = [ self.qtbase.dev ]; }
../qmake-hook.sh;
};

View file

@ -110,7 +110,10 @@ let
];
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
qmakeHook = makeSetupHook { deps = [ self.qtbase.dev ]; } ./qmake-hook.sh;
qmakeHook =
makeSetupHook
{ deps = [ self.qtbase.dev ]; }
../qmake-hook.sh;
};

View file

@ -1,42 +0,0 @@
qmakeConfigurePhase() {
runHook preConfigure
qmake PREFIX=$out $qmakeFlags
runHook postConfigure
}
if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then
configurePhase=qmakeConfigurePhase
fi
_qtModuleMultioutDevsPre() {
# We cannot simply set these paths in configureFlags because libQtCore retains
# references to the paths it was built with.
moveToOutput "bin" "${!outputDev}"
moveToOutput "include" "${!outputDev}"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "${!outputDev}/share"
moveToOutput "share/doc" "${!outputDev}"
}
_qtModuleMultioutDevsPost() {
# Move libtool archives and qmake project files to $dev/lib
if [ "z${!outputLib}" != "z${!outputDev}" ]; then
pushd "${!outputLib}"
if [ -d "lib" ]; then
find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \
while read -r -d $'\0' file; do
mkdir -p "${!outputDev}/$(dirname "$file")"
mv "${!outputLib}/$file" "${!outputDev}/$file"
done
fi
popd
fi
}
if [ -n "$NIX_QT_SUBMODULE" ]; then
preFixupHooks+=(_qtModuleMultioutDevsPre)
postFixupHooks+=(_qtModuleMultioutDevsPost)
fi

View file

@ -112,7 +112,7 @@ let
qmakeHook =
makeSetupHook
{ deps = [ self.qtbase.dev ]; }
./qmake-hook.sh;
../qmake-hook.sh;
};

View file

@ -1,42 +0,0 @@
qmakeConfigurePhase() {
runHook preConfigure
qmake PREFIX=$out $qmakeFlags
runHook postConfigure
}
if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then
configurePhase=qmakeConfigurePhase
fi
_qtModuleMultioutDevsPre() {
# We cannot simply set these paths in configureFlags because libQtCore retains
# references to the paths it was built with.
moveToOutput "bin" "${!outputDev}"
moveToOutput "include" "${!outputDev}"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "${!outputDev}/share"
moveToOutput "share/doc" "${!outputDev}"
}
_qtModuleMultioutDevsPost() {
# Move libtool archives and qmake project files to $dev/lib
if [ "z${!outputLib}" != "z${!outputDev}" ]; then
pushd "${!outputLib}"
if [ -d "lib" ]; then
find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \
while read -r -d $'\0' file; do
mkdir -p "${!outputDev}/$(dirname "$file")"
mv "${!outputLib}/$file" "${!outputDev}/$file"
done
fi
popd
fi
}
if [ -n "$NIX_QT_SUBMODULE" ]; then
preFixupHooks+=(_qtModuleMultioutDevsPre)
postFixupHooks+=(_qtModuleMultioutDevsPost)
fi