1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 14:11:36 +00:00
nixpkgs/pkgs/development/libraries/qt-5/qmake-hook-darwin.sh
Anthony Cowley 7a9400d338 qt5.6: darwin compatibility
- qtbase builds on darwin
- Downstream qmake and cmake build configurations supported

Darwin-specific changes:

Prevent `qmake -project` from adding build support files in the temp
directory to the project.

Shrink the temp directory used for building with qmake.

The issue here is that `lndir` recreates the entire directory structure
of the module we are merging into the temporary build environment. On
darwin, the framework directory structures mean that this shadow
directory tree is 17MB even though the file contents are all symlinks
into the store.

To address this, we symlink the framework directories explicitly and
use `lndir` for everything else.
2016-12-08 18:28:30 -05:00

43 lines
1.2 KiB
Bash

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' \) -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