Skip to content

Commit

Permalink
Switch snap to gnome-3-28 extension
Browse files Browse the repository at this point in the history
* Switch to core18
* Switch to gnome-3-28 extension
* Added "cleanup" part to remove duplicated files
* Fallback to xwayland when running on wayland
* Adopt metadata from AppStream appdata.xml file
* Get version from jar
* Add native MySQL and MariaDB clients so dumping works
  • Loading branch information
merlijn-sebrechts committed Mar 6, 2020
1 parent 39f6e46 commit 90331fc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 49 deletions.
1 change: 1 addition & 0 deletions product/snapcraft/.gitignore
@@ -0,0 +1 @@
*.snap
87 changes: 38 additions & 49 deletions product/snapcraft/snapcraft.yaml
@@ -1,32 +1,31 @@
name: dbeaver-ce
version: latest
summary: Universal Database Tool
description: |
Free multi-platform database tool for developers, SQL programmers,
database administrators and analysts. Supports all popular databases
MySQL, PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase,
MS Access, Teradata, Firebird, Derby, etc.
Free multi-platform database tool for developers, SQL programmers, database administrators and analysts. Supports all popular databases: MySQL PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access, Teradata, Firebird, Derby, etc.
grade: stable
adopt-info: dbeaver-ce

base: core18
confinement: strict

architectures:
- build-on: [amd64, i386]
run-on: amd64

apps:
dbeaver-ce:
command: desktop-launch $SNAP/usr/share/dbeaver/dbeaver
desktop: usr/share/applications/dbeaver.desktop
command: $SNAP/usr/share/dbeaver/dbeaver
extensions: [ gnome-3-28 ]
common-id: dbeaver
environment:
JAVA_HOME: $SNAP/usr/lib/jvm/java-8-openjdk-amd64
PATH: $JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
FONTCONFIG_FILE: $SNAP/etc/fonts
_JAVA_OPTIONS: -Duser.home=$SNAP_USER_DATA
# Fallback to XWayland if running in a Wayland session.
DISABLE_WAYLAND: 1
plugs:
- desktop
- network
- x11
- home
- desktop-legacy

parts:
dbeaver-ce:
Expand All @@ -42,45 +41,35 @@ parts:
- x11-xserver-utils
- libxss1
- libgconf2-4
- libcurl3
- libgtk-3-dev
- libcurl4
- xdg-utils
- mariadb-client
- mysql-client
override-build: |
set -e
snapcraftctl build
DEB_API="https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb"
DEB_URL=$(curl -w "%{url_effective}\n" -I -L -s -S "${DEB_API}" -o /dev/null)
VERSION=$(echo "${DEB_URL}" | cut -d'/' -f6)
echo $VERSION > $SNAPCRAFT_STAGE/version
# Correct path to icon.
sed -i 's|Icon=dbeaver|Icon=/usr/share/dbeaver/dbeaver\.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/dbeaver.desktop
VERSION=$(echo $SNAPCRAFT_PART_INSTALL/usr/share/dbeaver/plugins/org.jkiss.dbeaver.core_*.jar)
VERSION="${VERSION##*_}"
VERSION="${VERSION%.*}"
snapcraftctl set-version "$VERSION"
parse-info: [usr/share/metainfo/dbeaver.appdata.xml]

desktop-gnome-platform:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk3"]
build-packages:
- gcc
override-build: |
snapcraftctl build
mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform
plugs:
# GTK libraries
gnome-3-26-1604:
interface: content
target: $SNAP/gnome-platform
default-provider: gnome-3-26-1604
# Common GTK themes
gtk-3-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes
# This part removes all the files in this snap which already exist in
# connected content and base snaps. Since these files will be available
# at runtime from the content and base snaps, they do not need to be
# included in this snap itself.
#
# More info: https://snapcraft-utils-library.readthedocs.io/en/latest/lib/cleanup.html
#
cleanup:
after: # Make this part run last; list all your other parts here
- dbeaver-ce
plugin: nil
build-snaps: # List all content-snaps and base snaps you're using here
- core18
- gnome-3-28-1804
override-prime: |
set -eux
for snap in "core18" "gnome-3-28-1804"; do # List all content-snaps and base snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
done

0 comments on commit 90331fc

Please sign in to comment.