-
Notifications
You must be signed in to change notification settings - Fork 60
/
launcher-specific
60 lines (52 loc) · 2.05 KB
/
launcher-specific
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#############################
# QT launcher specific part #
#############################
# select qt version
. $SNAP/flavor-select
export QTCHOOSER_NO_GLOBAL_DIR=1
if [ "$USE_qt5" = true ]; then
# QT_SELECT not exported by ubuntu app platform runtime
if [ -z "$QT_SELECT" ]; then
export QT_SELECT=snappy-qt5
fi
else
export QT_SELECT=snappy-qt4
fi
# Removes Qt warning: Could not find a location
# of the system Compose files
export QTCOMPOSE=$RUNTIME/usr/share/X11/locale
# Qt Libs, Modules and helpers
if [ "$USE_qt5" = true ]; then
prepend_dir QT_PLUGIN_PATH $RUNTIME/usr/lib/$ARCH/qt5/plugins
prepend_dir QML2_IMPORT_PATH $RUNTIME/usr/lib/$ARCH/qt5/qml
prepend_dir QML2_IMPORT_PATH $RUNTIME/lib/$ARCH
# Try to use qtubuntu-print plugin, if not found Qt will fallback to the first found (usually cups plugin)
export QT_PRINTER_MODULE=qtubuntu-print
if [ "$WITH_RUNTIME" = yes ]; then
prepend_dir QML2_IMPORT_PATH $SNAP/usr/lib/$ARCH/qt5/qml
prepend_dir QML2_IMPORT_PATH $SNAP/lib/$ARCH
fi
prepend_dir PATH $RUNTIME/usr/lib/$ARCH/qt5/bin
if [ "$wayland_available" = true ]; then
export QT_QPA_PLATFORM=wayland-egl
# Does not hurt to specify these as well, just in case
export GDK_BACKEND="wayland"
export CLUTTER_BACKEND="wayland"
else
# Should check if a X11 $DISPLAY variable is set and accessible
export QT_QPA_PLATFORM=xcb
if ! [ -v QT_QPA_PLATFORMTHEME ] || [ -z "${QT_QPA_PLATFORMTHEME}" ]; then
export QT_QPA_PLATFORMTHEME=appmenu-qt5
fi
fi
else
[ "$wayland_available" = true ] && echo "Warning: Qt4 does not support Wayland!"
append_dir LD_LIBRARY_PATH $SNAP/usr/lib/$ARCH/qt4
export QT_PLUGIN_PATH=$SNAP/usr/lib/$ARCH/qt4/plugins
prepend_dir QML_IMPORT_PATH $SNAP/usr/lib/$ARCH/qt4/qml:$SNAP/lib/$ARCH
prepend_dir PATH $SNAP/usr/lib/$ARCH/qt4/bin
fi
# Use GTK styling for running under the GNOME desktop
append_dir GTK_PATH $RUNTIME/usr/lib/$ARCH/gtk-2.0
# Fix locating the QtWebEngineProcess executable
export QTWEBENGINEPROCESS_PATH=$RUNTIME/usr/lib/$ARCH/qt5/libexec/QtWebEngineProcess