Skip to content

Commit

Permalink
Fixed error related to libgail and libatk modules
Browse files Browse the repository at this point in the history
* Priming the gtk modules to fix
```
     Gtk-Message: Failed to load module "gail"
     Gtk-Message: Failed to load module "atk-bridge"
 ```

Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
  • Loading branch information
deepsidhu1313 committed Aug 12, 2018
1 parent a54fd6e commit cacd7e3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 29 deletions.
29 changes: 14 additions & 15 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Import and export databases from/to SQL dump files
* Issue SQL queries and inspect the results
* Examine a log of all SQL commands issued by the application
SQLite Database Browser is not a visual shell for the sqlite command line tool. It does not require familiarity with SQL commands. # a longer description for the snap
SQLite Database Browser is not a visual shell for the sqlite command line tool. It does not require familiarity with SQL commands.
confinement: strict # use "strict" to enforce system access only via declared interfaces

grade: devel
Expand Down Expand Up @@ -81,20 +81,13 @@
# - ttf-ubuntu-font-family
# - dmz-cursor-theme
# - light-themes
# - adwaita-icon-theme
# - gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5
- try:
- appmenu-qt5
# - locales-all
# - xdg-user-dirs
# prime:
# - -usr/lib/*-linux-gnu*/dri/*
# - -usr/lib/*-linux-gnu*/libLLVM*
# - -usr/lib/*-linux-gnu*/libcudata.so.*
- appmenu-qt5
- locales-all
- xdg-user-dirs

dump:
plugin: dump
Expand All @@ -103,14 +96,14 @@
- sqlitebrowser
stage-packages:
# - qtbase5-dev
- libqt5gui5
# - libqt5gui5
# - libqt4gui4
# - libxkbcommon0
# - libxkbfile1
- gtk2-engines
# - gtk2-engines
- libc6
# - gtk2-engines-oxygen
- gtk3-engines-breeze
# - gtk3-engines-breeze
- libgcc1
# - libqcustomplot1.3
# - libqt5network5
Expand All @@ -120,6 +113,9 @@
- libsqlcipher-dev
- libatk-adaptor
- libgail-common
- libgail-3-0
- libgail-3-dev
- libgail-dev
filesets:
wanted:
- bin/*
Expand All @@ -129,6 +125,9 @@
- usr/lib/*-linux-gnu*/libz.so*
- usr/lib/*-linux-gnu*/libatk*
- usr/lib/*-linux-gnu*/libgail*

- usr/lib/*-linux-gnu*/gtk-2.0/modules/*
- etc/X11/Xsession.d/90atk-adaptor
- usr/lib/gnome-settings-daemon-3.0/gtk-modules/at-spi2-atk.desktop
- usr/lib/unity-settings-daemon-1.0/gtk-modules/at-spi2-atk.desktop
prime:
- $wanted
52 changes: 38 additions & 14 deletions snap/wrappers/sqlitebrowser
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

SNAP=`echo $SNAP | sed -e "s|/var/lib/snapd||g"`

export PATH=$SNAP/bin:$SNAP/usr/bin:/snap/bin:$PATH
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"

Expand Down Expand Up @@ -74,6 +76,24 @@ export XLOCALEDIR=$RUNTIME/usr/share/X11/locale
# Set XCursors path
export XCURSOR_PATH=$RUNTIME/usr/share/icons

# Mesa Libs for OpenGL support
append_dir LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/mesa
append_dir LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/mesa-egl

# Tell libGL where to find the drivers
export LIBGL_DRIVERS_PATH=$RUNTIME/usr/lib/$ARCH/dri
append_dir LD_LIBRARY_PATH $LIBGL_DRIVERS_PATH

# Workaround in snapd for proprietary nVidia drivers mounts the drivers in
# /var/lib/snapd/lib/gl that needs to be in LD_LIBRARY_PATH
# Without that OpenGL using apps do not work with the nVidia drivers.
# Ref.: https://bugs.launchpad.net/snappy/+bug/1588192
append_dir LD_LIBRARY_PATH /var/lib/snapd/lib/gl

# Unity7 export (workaround for https://launchpad.net/bugs/1638405)
append_dir LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/libunity


# XDG Config
prepend_dir XDG_CONFIG_DIRS $SNAP/etc/xdg

Expand Down Expand Up @@ -284,29 +304,33 @@ for f in ${gtk_configs[@]}; do
fi
done

# create symbolic link to ibus socket path for ibus to look up its socket files
# (see comments #3 and #6 on https://launchpad.net/bugs/1580463)
IBUS_CONFIG_PATH=$XDG_CONFIG_HOME/ibus
mkdir -p $IBUS_CONFIG_PATH
[ -d $IBUS_CONFIG_PATH/bus ] && rm -rf $IBUS_CONFIG_PATH/bus
ln -sfn $REALHOME/.config/ibus/bus $IBUS_CONFIG_PATH


##############################
# GTK launcher specific part #
##############################

export GTK_PATH=$RUNTIME/usr/lib/$ARCH/gtk-3.0:$RUNTIME/usr/lib/$ARCH/gtk-2.0

# # ibus and fcitx integration
# GTK_IM_MODULE_DIR=$XDG_CACHE_HOME/immodules
# export GTK_IM_MODULE_FILE=$GTK_IM_MODULE_DIR/immodules.cache
# if [ $needs_update = true ]; then
# rm -rf $GTK_IM_MODULE_DIR
# mkdir -p $GTK_IM_MODULE_DIR
# ln -s $RUNTIME/usr/lib/gtk-2.0/2.10.0/immodules/*.so $GTK_IM_MODULE_DIR
# $RUNTIME/usr/bin/gtk-query-immodules-2.0 > $GTK_IM_MODULE_FILE
# $RUNTIME/usr/bin/gtk-query-immodules-3.0 >> $GTK_IM_MODULE_FILE
# fi
# ibus and fcitx integration
GTK_IM_MODULE_DIR=$XDG_CACHE_HOME/immodules
export GTK_IM_MODULE_FILE=$GTK_IM_MODULE_DIR/immodules.cache
if [ $needs_update = true ]; then
rm -rf $GTK_IM_MODULE_DIR
mkdir -p $GTK_IM_MODULE_DIR
ln -s $RUNTIME/usr/lib/$ARCH/gtk-2.0/2.10.0/immodules/*.so $GTK_IM_MODULE_DIR
$RUNTIME/usr/lib/$ARCH/libgtk2.0-0/gtk-query-immodules-2.0 > $GTK_IM_MODULE_FILE
# $RUNTIME/usr/lib/$ARCH/libgtk3.0-0/gtk-query-immodules-3.0 >> $GTK_IM_MODULE_FILE
fi

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH:$SNAP/usr/lib/$ARCH:$SNAP/usr/lib/$ARCH/mesa:$SNAP/usr/lib/$ARCH/mesa-egl"
export LD_LIBRARY_PATH="$SNAP/usr/lib/$ARCH:$SNAP/usr/lib/$ARCH/mesa:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH



cd /snap/sqlitebrowser/current/bin
./sqlitebrowser "$@"
exec "desktop-launch" "$SNAP/bin/sqlitebrowser" "$@"

0 comments on commit cacd7e3

Please sign in to comment.