diff --git a/.travis.yml b/.travis.yml index 7eb257aa..b6e71220 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,10 @@ branches: only: - master +# env: +# - ARCH=x86_64 DOCKER_IMAGE=amd64/ubuntu:trusty +# - ARCH=i686 DOCKER_IMAGE=i386/ubuntu:trusty + matrix: fast_finish: true include: diff --git a/BUILDING.md b/BUILDING.md index a30a53e0..cc2caef7 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -57,7 +57,7 @@ The same process works for building the code in any platform supported by Qt ```bash $ sudo apt install build-essential git-core cmake libsqlite3-dev qt5-default qttools5-dev-tools \ - libsqlcipher-dev + libsqlcipher-dev qtbase5-dev libantlr-dev libqt5scintilla2-dev libqcustomplot-dev qttools5-dev $ git clone https://github.com/sqlitebrowser/sqlitebrowser $ cd sqlitebrowser $ mkdir build @@ -90,6 +90,22 @@ $ sudo make install This should complete without errors, and `sqlitebrowser` should now be launch-able from the command line. +### OpenSUSE + +```bash + + +$ zypper in -y build git-core, libQt5Core5, libQt5Core5-32bit, libqt5-qtbase, libqt5-qtbase-devel, libqt5-qttools, libqt5-qttools-devel, build, gcc-c++, gcc, sqlite3-devel, libsqlite3-0, cmake, antlr-devel, sqlcipher-devel +$ git clone https://github.com/sqlitebrowser/sqlitebrowser +$ cd sqlitebrowser +$ mkdir build +$ cd build +$ cmake -Dsqlcipher=1 -Wno-dev -DFORCE_INTERNAL_QSCINTILLA=ON .. +$ make +$ sudo make install +``` + + ### MacOS X The application can be compiled to a single executable binary file, similar to diff --git a/README.md b/README.md index 0ff09121..ad982ba1 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Download Windows releases here: * https://github.com/sqlitebrowser/sqlitebrowser/releases -**Note** - If for some reason the standard Windows release does not work +**Note** - If for some reason the standard Windows release does not work (e.g. gives an error), try a nightly build. Nightly builds often fix bugs reported after the last release. :D @@ -169,7 +169,20 @@ or this command: # pkg install sqlitebrowser -### Compiling +## Snap packages + +[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/sqlitebrowser) + +#### Snap Nightlies + + snap install sqlitebrowser --devmode + +#### Snap Stable + + snap install sqlitebrowser + + +## Compiling Instructions for compiling on Windows, OSX, Linux, and FreeBSD are in [BUILDING](BUILDING.md). diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 44aa44e7..2958bf9d 100755 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -4,7 +4,7 @@ version-script: printf "`cat currentrelease | head -n 1 `-`git rev-list master --count`-` git -C . rev-parse --short HEAD`" summary: DB Browser for SQLite # 79 char long summary - description: | + description: | SQLite Database Browser is a visual tool used to create, design and edit database files compatible with SQLite. Its interface is based on Qt, and is meant to be used for users and developers that want to create databases, edit and search data using a familiar spreadsheet-like interface, without the need to learn complicated SQL commands. Controls and wizards are available for users to: * Create and compact database files * Create, define, modify and delete tables @@ -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 @@ -25,7 +25,7 @@ apps: sqlitebrowser: - command: desktop-launch $SNAP/wrappers/sqlitebrowser + command: desktop-launch $SNAP/bin/sqlitebrowser desktop: share/applications/sqlitebrowser.desktop environment: TMPDIR: $XDG_RUNTIME_DIR @@ -59,9 +59,9 @@ - libqt5scintilla2-dev - git parts: - wrappers: - plugin: dump - source: snap/ + # wrappers: + # plugin: dump + # source: snap/ sqlitebrowser: # source-type: git plugin: cmake @@ -71,6 +71,7 @@ build-packages: - qtbase5-dev - dpkg-dev + - libgtk-3-dev make-parameters: - FLAVOR=qt5 plugin: make @@ -78,24 +79,26 @@ source-subdir: qt stage-packages: - libxkbcommon0 - # - ttf-ubuntu-font-family - # - dmz-cursor-theme - # - light-themes - # - adwaita-icon-theme - # - gnome-themes-standard + # - qt5-gtk-platformtheme + - ttf-ubuntu-font-family + - dmz-cursor-theme + - light-themes + - adwaita-icon-theme + - gnome-themes-standard - shared-mime-info + - libgtk-3-0 - 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 + - libglib2.0-bin + - libgtk-3-bin + - unity-gtk3-module + - libappindicator3-1 + - locales-all + - xdg-user-dirs + - ibus-gtk3 + - libibus-1.0-5 dump: plugin: dump after: @@ -103,14 +106,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 @@ -120,15 +123,23 @@ - libsqlcipher-dev - libatk-adaptor - libgail-common + - libgail-3-0 + - libgail-3-dev + - libgail-dev + # - qt5-gtk-platformtheme filesets: wanted: - bin/* - share/* + - usr/lib/*.* - usr/lib/*-linux-gnu*/libsqlcipher.so.0* - usr/lib/*-linux-gnu*/libdb* - 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 diff --git a/snap/wrappers/sqlitebrowser b/snap/wrappers/sqlitebrowser deleted file mode 100755 index 7ebe128a..00000000 --- a/snap/wrappers/sqlitebrowser +++ /dev/null @@ -1,312 +0,0 @@ -#!/bin/bash - -export PATH=$SNAP/bin:$SNAP/usr/bin:/snap/bin:$PATH -export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" - -echo 'Please create an issue on https://github.com/sqlitebrowser/sqlitebrowser, if you encounter any problems with SNAP package of sqlitebrowser. Thanks !! @deepsidhu1313.' - -needs_update=true - -. $SNAP_USER_DATA/.last_revision 2>/dev/null || true -if [ "$SNAP_DESKTOP_LAST_REVISION" = "$SNAP_REVISION" ]; then - needs_update=false -fi - -# If the user has modified their user-dirs settings, force an update -if [[ -f $REALHOME/.config/user-dirs.dirs.md5sum && -f $REALHOME/.config/user-dirs.locale.md5sum ]]; then - if [[ "$(md5sum < $REALHOME/.config/user-dirs.dirs)" != "$(cat $HOME/.config/user-dirs.dirs.md5sum)" || - "$(md5sum < $REALHOME/.config/user-dirs.locale)" != "$(cat $HOME/.config/user-dirs.locale.md5sum)" ]]; then - needs_update=true - fi -fi - -# Set $REALHOME to the users real home directory -REALHOME=`getent passwd $UID | cut -d ':' -f 6` - -if [ "$SNAP_ARCH" == "amd64" ]; then - ARCH="x86_64-linux-gnu" -elif [ "$SNAP_ARCH" == "armhf" ]; then - ARCH="arm-linux-gnueabihf" -elif [ "$SNAP_ARCH" == "arm64" ]; then - ARCH="aarch64-linux-gnu" -else - ARCH="$SNAP_ARCH-linux-gnu" -fi - - - - -############################################### -# Launcher common exports for any desktop app # -############################################### - -function prepend_dir() { - local var="$1" - local dir="$2" - if [ -d "$dir" ]; then - eval "export $var=\"\$dir\${$var:+:\$$var}\"" - fi -} - -function append_dir() { - local var="$1" - local dir="$2" - if [ -d "$dir" ]; then - eval "export $var=\"\${$var:+\$$var:}\$dir\"" - fi -} - -function can_open_file() { - return `head -c0 "$1" &> /dev/null`; -} - - -RUNTIME=$SNAP - -# XKB config -export XKB_CONFIG_ROOT=$RUNTIME/usr/share/X11/xkb - -# Give XOpenIM a chance to locate locale data. -# This is required for text input to work in SDL2 games. -export XLOCALEDIR=$RUNTIME/usr/share/X11/locale - - -# Set XCursors path -export XCURSOR_PATH=$RUNTIME/usr/share/icons - -# XDG Config -prepend_dir XDG_CONFIG_DIRS $SNAP/etc/xdg - -# Define snaps' own data dir -prepend_dir XDG_DATA_DIRS $SNAP/usr/share -prepend_dir XDG_DATA_DIRS $SNAP_USER_DATA - -# prepend_dir XDG_DATA_DIRS $SNAP/usr/share/gimp/2.0 - -# Set XDG_DATA_HOME to local path -export XDG_DATA_HOME=$SNAP_USER_DATA/.local/share -mkdir -p $XDG_DATA_HOME - -# Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME: -# https://bugzilla.gnome.org/show_bug.cgi?id=741335 -prepend_dir XDG_DATA_DIRS $XDG_DATA_HOME - - -# Set cache folder to local path -export XDG_CACHE_HOME=$SNAP_USER_COMMON/.cache -if [[ -d $SNAP_USER_DATA/.cache && ! -e $XDG_CACHE_HOME ]]; then - # the .cache directory used to be stored under $SNAP_USER_DATA, migrate it - mv $SNAP_USER_DATA/.cache $SNAP_USER_COMMON/ -fi -mkdir -p $XDG_CACHE_HOME - -# Set config folder to local path -export XDG_CONFIG_HOME=$SNAP_USER_DATA/.config -mkdir -p $XDG_CONFIG_HOME - -# Create $XDG_RUNTIME_DIR if not exists (to be removed when LP: #1656340 is fixed) -[ -n "$XDG_RUNTIME_DIR" ] && mkdir -p $XDG_RUNTIME_DIR -m 700 - -# Ensure the app finds locale definitions (requires locales-all to be installed) -append_dir LOCPATH $RUNTIME/usr/lib/locale - -# If any, keep track of where XDG dirs were so we can potentially migrate the content later -test -f ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs && . ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs -for d in DOCUMENTS DESKTOP DOWNLOAD MUSIC PICTURES VIDEOS PUBLICSHARE TEMPLATES; do - eval $(echo "OLD_XDG_${d}_DIR")=`eval "$(echo "echo \\$XDG_${d}_DIR")"` -done - -# Setup user-dirs.* or run xdg-user-dirs-update if needed -needs_xdg_update=false -needs_xdg_links=false -if can_open_file "$REALHOME/.config/user-dirs.dirs" && can_open_file "$REALHOME/.config/user-dirs.locale"; then - sed /^#/!s#\$HOME#${REALHOME}#g $REALHOME/.config/user-dirs.dirs > $HOME/.config/user-dirs.dirs - cp -a $REALHOME/.config/user-dirs.locale $HOME/.config/ - for f in user-dirs.dirs user-dirs.locale; do - md5sum < $REALHOME/.config/$f > $HOME/.config/$f.md5sum - done -else - needs_xdg_update=true - needs_xdg_links=true -fi - -# Check if we can actually read the contents of each xdg dir -test -f ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs && . ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs -XDG_SPECIAL_DIRS=($XDG_DOCUMENTS_DIR $XDG_DESKTOP_DIR $XDG_DOWNLOAD_DIR $XDG_MUSIC_DIR $XDG_PICTURES_DIR $XDG_VIDEOS_DIR $XDG_PUBLIC_DIR $XDG_TEMPLATES_DIR) -for d in ${XDG_SPECIAL_DIRS[@]}; do - if ! can_open_file $d; then - needs_xdg_update=true - fi -done - -# If needs XDG update and xdg-user-dirs-update exists in $PATH, run it -if [ $needs_xdg_update = true ] && [ `which xdg-user-dirs-update` ]; then - xdg-user-dirs-update -fi - -# Create links for user-dirs.dirs -if [ $needs_xdg_links = true ]; then - test -f ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs && . ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs - XDG_SPECIAL_DIRS=($XDG_DOCUMENTS_DIR $XDG_DESKTOP_DIR $XDG_DOWNLOAD_DIR $XDG_MUSIC_DIR $XDG_PICTURES_DIR $XDG_VIDEOS_DIR $XDG_PUBLIC_DIR $XDG_TEMPLATES_DIR) - for d in ${XDG_SPECIAL_DIRS[@]}; do - b=$(realpath "$d" --relative-to="$REALHOME") - if [ -e $REALHOME/$b ] && [ ! -e $HOME/$b ]; then - ln -s $REALHOME/$b $HOME/$b - fi - done -else - # If we aren't creating new links, check if we have content saved in old locations and move it - for d in DOCUMENTS DESKTOP DOWNLOAD MUSIC PICTURES VIDEOS PUBLICSHARE TEMPLATES; do - old=`eval "$(echo "echo \\$OLD_XDG_${d}_DIR")"` - new=`eval "$(echo "echo \\$XDG_${d}_DIR")"` - if [ -L "$old" ] && [ -d "$new" ] && [ `readlink "$old"` != "$new" ]; then - mv "$old"/* "$new"/ 2>/dev/null - elif [ -d "$old" ] && [ -d "$new" ] && [ "$old" != "$new" ]; then - mv "$old"/* "$new"/ 2>/dev/null - fi - done -fi - -# If detect wayland server socket, then set environment so applications prefer -# wayland, and setup compat symlink (until we use user mounts. Remember, -# XDG_RUNTIME_DIR is /run/user//snap.$SNAP so look in the parent directory -# for the socket. For details: -# https://forum.snapcraft.io/t/wayland-dconf-and-xdg-runtime-dir/186/10 -# Applications that don't support wayland natively may define DISABLE_WAYLAND -# (to any non-empty value) to skip that logic entirely. -if [[ -n "$XDG_RUNTIME_DIR" && -z "$DISABLE_WAYLAND" ]]; then - wdisplay="wayland-0" - if [ -n "$WAYLAND_DISPLAY" ]; then - wdisplay="$WAYLAND_DISPLAY" - fi - wayland_sockpath="$XDG_RUNTIME_DIR/../$wdisplay" - wayland_snappath="$XDG_RUNTIME_DIR/$wdisplay" - if [ -S "$wayland_sockpath" ]; then - # if running under wayland, use it - #export WAYLAND_DEBUG=1 - export GDK_BACKEND="wayland" - export CLUTTER_BACKEND="wayland" - export QT_QPA_PLATFORM="wayland-egl" - # create the compat symlink for now - if [ ! -e "$wayland_snappath" ]; then - ln -s "$wayland_sockpath" "$wayland_snappath" - fi - fi -fi - -# Keep an array of data dirs, for looping through them -IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS" - -# Font Config and themes -export FONTCONFIG_PATH=$RUNTIME/etc/fonts/conf.d -export FONTCONFIG_FILE=$XDG_CONFIG_HOME/fontconfig/fonts.conf - - -function make_user_fontconfig { - echo "" - if [ -d $REALHOME/.local/share/fonts ]; then - echo " $REALHOME/.local/share/fonts" - fi - if [ -d $REALHOME/.fonts ]; then - echo " $REALHOME/.fonts" - fi - for d in "${data_dirs_array[@]}"; do - if [ -d "$d/fonts" ]; then - echo " $d/fonts" - fi - done - # We need to include this default cachedir first so that caching - # works: without it, fontconfig will try to write to the real user home - # cachedir and be blocked by AppArmor. - echo ' fontconfig' - if [ -d $REALHOME/.cache/fontconfig ]; then - echo " $REALHOME/.cache/fontconfig" - fi - echo "" -} - -if [ $needs_update = true ]; then - rm -rf $XDG_DATA_HOME/{fontconfig,fonts,fonts-*,themes,.themes} - mkdir -p $XDG_CONFIG_HOME/fontconfig - make_user_fontconfig > $FONTCONFIG_FILE - - # the themes symlink are needed for GTK 3.18 when the prefix isn't changed - # GTK 3.20 looks into XDG_DATA_DIR which has connected themes. - ln -sf $RUNTIME/usr/share/themes $XDG_DATA_HOME - ln -sfn $RUNTIME/usr/share/themes $SNAP_USER_DATA/.themes -fi - -# Build mime.cache -# needed for gtk and qt icon -if [ $needs_update = true ]; then - rm -rf $XDG_DATA_HOME/mime - if [ ! -f $RUNTIME/usr/share/mime/mime.cache ]; then - if [ `which update-mime-database` ]; then - cp --preserve=timestamps -dR $RUNTIME/usr/share/mime $XDG_DATA_HOME - update-mime-database $XDG_DATA_HOME/mime - fi - fi -fi - - -# Enable gsettings user changes -# symlink the dconf file if home plug is connected for read -DCONF_DEST_USER_DIR=$SNAP_USER_DATA/.config/dconf -if [ ! -f $DCONF_DEST_USER_DIR/user ]; then - if [ -f $REALHOME/.config/dconf/user ]; then - mkdir -p $DCONF_DEST_USER_DIR - ln -s $REALHOME/.config/dconf/user $DCONF_DEST_USER_DIR - fi -fi - - -# Gdk-pixbuf loaders -export GDK_PIXBUF_MODULE_FILE=$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache -export GDK_PIXBUF_MODULEDIR=$RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders -if [ $needs_update = true ]; then - rm -f $GDK_PIXBUF_MODULE_FILE - if [ -f $RUNTIME/usr/bin/gdk-pixbuf-query-loaders ]; then - $RUNTIME/usr/bin/gdk-pixbuf-query-loaders > $GDK_PIXBUF_MODULE_FILE - fi -fi - - - -# GTK theme and behavior modifier -# Those can impact the theme engine used by Qt as well -gtk_configs=(.config/gtk-3.0/settings.ini .config/gtk-3.0/bookmarks .config/gtk-2.0/gtkfilechooser.ini) -for f in ${gtk_configs[@]}; do - dest="$SNAP_USER_DATA/$f" - if [ ! -L "$dest" ] - then - mkdir -p `dirname $dest` - ln -s $REALHOME/$f $dest - fi -done - - -############################## -# 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 - -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 "$@"