mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 13:37:21 +03:00
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="$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)
|