nixpkgs/pkgs/development/libraries/qt-5/make-qt-wrapper-darwin.sh
Thomas Tuegel 3f3d33a078
qt5: use distinct lib/qt-5.x prefix for each minor version
Using a distinct prefix for plugins and QML libraries allows multiple Qt 5 minor
versions to coexist in the same environment.
2017-06-18 08:41:57 -05:00

36 lines
1.3 KiB
Bash

wrapQtProgram() {
local prog="$1"
shift
wrapProgram "$prog" \
--set QT_PLUGIN_PATH "$QT_PLUGIN_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 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}/$qtPluginPrefix"
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/$qtQmlPrefix"
export RUNTIME_XDG_DATA_DIRS="$RUNTIME_XDG_DATA_DIRS${RUNTIME_XDG_DATA_DIRS:+:}${!outputBin}/share"
export RUNTIME_XDG_CONFIG_DIRS="$RUNTIME_XDG_CONFIG_DIRS${RUNTIME_XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
}
prePhases+=(_makeQtWrapperSetup)