Skip to content

Commit 1e8e1eb

Browse files
committed
Added CD (Continuous Deployment) snap packaging support
* Added required files to create a snap package. Launchpad account will automate the build whenever code is committed to git repo # What is a snap? A snap : * is a squashFS filesystem containing your app code and a snap.yaml file containing specific metadata. It has a read-only file-system and, once installed, a writable area. * is self-contained. It bundles most of the libraries and run-times it needs and can be updated and reverted without affecting the rest of the system. * is confined from the OS and other apps through security mechanisms, but can exchange content and functions with other snaps according to fine-grained policies controlled by the user and the OS defaults. //TODO * Try reducing the size of final snap packages by removing unnecessary packages from priming stage Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
1 parent d3d9d10 commit 1e8e1eb

2 files changed

Lines changed: 139 additions & 0 deletions

File tree

‎snap/snapcraft.yaml‎

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: sqlitebrowser # the name of the snap
2+
# version: 3.10.1 # the version of the snap
3+
version: master
4+
version-script: printf "`cat currentrelease | head -n 1 `-` git -C . rev-parse --short HEAD`"
5+
6+
summary: DB browser for Sqlite # 79 char long summary
7+
description: GUI editor for SQLite databases # a longer description for the snap
8+
confinement: strict # use "strict" to enforce system access only via declared interfaces
9+
10+
grade: devel
11+
icon: images/sqlitebrowser.svg
12+
type: app
13+
14+
apps:
15+
sqlitebrowser:
16+
command: desktop-launch $SNAP/wrappers/sqlitebrowser
17+
desktop: share/applications/sqlitebrowser.desktop
18+
environment:
19+
TMPDIR: $XDG_RUNTIME_DIR
20+
plugs:
21+
# - browser-support
22+
- desktop
23+
# - gsettings
24+
- home
25+
# - network
26+
# - opengl
27+
- unity7
28+
# - wayland
29+
- x11
30+
- removable-media
31+
# - ssh-keys
32+
33+
build-packages:
34+
- build-essential
35+
- g++
36+
- qtbase5-dev
37+
- qttools5-dev
38+
- qttools5-dev-tools
39+
- libsqlite3-dev
40+
- cmake
41+
- libantlr-dev
42+
- libsqlcipher-dev
43+
- libqcustomplot-dev
44+
# - libx11-xcb1
45+
# - libx11-xcb-dev
46+
# - libxcb-xkb-dev
47+
- libqt5scintilla2-dev
48+
- git
49+
parts:
50+
wrappers:
51+
plugin: dump
52+
source: snap/
53+
sqlitebrowser:
54+
# source-type: git
55+
plugin: cmake
56+
configflags: ["-DUSE_QT5=True", "-Dsqlcipher=1", "-Wno-dev"]
57+
source: .
58+
desktop-qt5:
59+
build-packages:
60+
- qtbase5-dev
61+
- dpkg-dev
62+
make-parameters:
63+
- FLAVOR=qt5
64+
plugin: make
65+
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
66+
source-subdir: qt
67+
stage-packages:
68+
- libxkbcommon0
69+
- ttf-ubuntu-font-family
70+
- dmz-cursor-theme
71+
- light-themes
72+
# - adwaita-icon-theme
73+
# - gnome-themes-standard
74+
- shared-mime-info
75+
- libqt5gui5
76+
- libgdk-pixbuf2.0-0
77+
- libqt5svg5
78+
- try:
79+
- appmenu-qt5
80+
# - locales-all
81+
# - xdg-user-dirs
82+
83+
dump:
84+
plugin: dump
85+
after:
86+
- desktop-qt5
87+
- sqlitebrowser
88+
stage-packages:
89+
# - qtbase5-dev
90+
# - libqt5gui5
91+
# - libqt4gui4
92+
# - libxkbcommon0
93+
# - libxkbfile1
94+
# - gtk2-engines
95+
- libc6
96+
# - gtk2-engines-oxygen
97+
# - gtk3-engines-breeze
98+
- libgcc1
99+
# - libqcustomplot1.3
100+
# - libqt5network5
101+
# - libqt5scintilla2-12v5
102+
- libsqlite3-0
103+
- libstdc++6
104+
- libsqlcipher-dev
105+
- libatk-adaptor
106+
- libgail-common
107+
filesets:
108+
wanted:
109+
# - etc/*
110+
# - lib/*
111+
- bin/*
112+
#- share/icons/hicolor/256x256/apps/*
113+
- share/*
114+
# - usr/lib/*-linux-gnu/libsqlcipher.so.0
115+
# - usr/lib/*-linux-gnu/libdb*
116+
# - usr/lib/*-linux-gnu/libz.so*
117+
# - usr/share/*
118+
# - usr/share/doc
119+
# - usr/share/man
120+
# - usr/share/lintian
121+
# - usr/bin/sqlitebrowser
122+
# - usr/share/applications/sqlitebrowser.desktop
123+
# - usr/lib/*
124+
# - usr/lib/*-linux-gnu/*
125+
# - usr/lib/*
126+
# - lib/*-linux-gnu/*
127+
# - usr/lib/x86_64-linux-gnu/mesa/*
128+
# - usr/lib/*-linux-gnu/qt5/plugins/*
129+
prime:
130+
- $wanted

‎snap/wrappers/sqlitebrowser‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
export PATH=$SNAP/bin:$SNAP/usr/bin:/snap/bin:$PATH
4+
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
5+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/*-linux-gnu:$SNAP/usr/lib/*-linux-gnu:$SNAP/usr/lib/*-linux-gnu/mesa:$SNAP/usr/lib/*-linux-gnu/mesa-egl"
6+
export LD_LIBRARY_PATH="$SNAP/usr/lib/*-linux-gnu:$SNAP/usr/lib/*-linux-gnu/mesa:$LD_LIBRARY_PATH"
7+
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
8+
cd /snap/sqlitebrowser/current/bin
9+
./sqlitebrowser "$@"

0 commit comments

Comments
 (0)