mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 03:34:58 +00:00
7a9400d338
- 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.
39 lines
1.5 KiB
Bash
39 lines
1.5 KiB
Bash
wrapQtProgram() {
|
|
local prog="$1"
|
|
shift
|
|
wrapProgram "$prog" \
|
|
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
|
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
|
|
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
|
--set DYLD_FRAMEWORK_PATH "/System/Library/Frameworks" \
|
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
|
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
|
"$@"
|
|
}
|
|
|
|
makeQtWrapper() {
|
|
local old="$1"
|
|
local new="$2"
|
|
shift
|
|
shift
|
|
makeWrapper "$old" "$new" \
|
|
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
|
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
|
|
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
|
--set DYLD_FRAMEWORK_PATH "/System/Library/Frameworks" \
|
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
|
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
|
"$@"
|
|
}
|
|
|
|
_makeQtWrapperSetup() {
|
|
# cannot use addToSearchPath because these directories may not exist yet
|
|
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins"
|
|
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports"
|
|
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml"
|
|
export RUNTIME_XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputBin}/share"
|
|
export RUNTIME_XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
|
|
}
|
|
|
|
prePhases+=(_makeQtWrapperSetup)
|