2016-07-16 22:01:35 +02:00
|
|
|
wrapQtProgram() {
|
|
|
|
local prog="$1"
|
|
|
|
shift
|
|
|
|
wrapProgram "$prog" \
|
2017-04-23 17:28:03 +02:00
|
|
|
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
|
|
|
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
|
|
|
|
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
2016-07-16 22:01:35 +02:00
|
|
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
|
|
|
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
2017-03-20 18:18:47 +01:00
|
|
|
--prefix GIO_EXTRA_MODULES : "$GIO_EXTRA_MODULES" \
|
2016-07-16 22:01:35 +02:00
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
makeQtWrapper() {
|
|
|
|
local old="$1"
|
|
|
|
local new="$2"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
makeWrapper "$old" "$new" \
|
2017-04-23 17:28:03 +02:00
|
|
|
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
|
|
|
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
|
|
|
|
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
2016-07-16 22:01:35 +02:00
|
|
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
|
|
|
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
2017-03-20 18:18:47 +01:00
|
|
|
--prefix GIO_EXTRA_MODULES : "$GIO_EXTRA_MODULES" \
|
2016-07-16 22:01:35 +02:00
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
_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"
|
2017-03-20 18:18:47 +01:00
|
|
|
export RUNTIME_XDG_DATA_DIRS="$RUNTIME_XDG_DATA_DIRS${RUNTIME_XDG_DATA_DIRS:+:}${!outputBin}/share${GSETTINGS_SCHEMAS_PATH:+:$GSETTINGS_SCHEMAS_PATH}"
|
2017-03-22 13:14:05 +01:00
|
|
|
export RUNTIME_XDG_CONFIG_DIRS="$RUNTIME_XDG_CONFIG_DIRS${RUNTIME_XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
|
2016-07-16 22:01:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
prePhases+=(_makeQtWrapperSetup)
|
2017-03-20 18:18:47 +01:00
|
|
|
|
|
|
|
_findGioModules() {
|
|
|
|
if [ -d "$1"/lib/gio/modules ] && [ -n "$(ls -A $1/lib/gio/modules)" ] ; then
|
|
|
|
export GIO_EXTRA_MODULES="$GIO_EXTRA_MODULES${GIO_EXTRA_MODULES:+:}$1/lib/gio/modules"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
envHooks+=(_findGioModules)
|