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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
name: ${binaryName}
version: ${version}
summary: ${applicationName}, secure VPN. Powered by Bitmask.
description: |
${applicationName} is an easy, fast, and secure VPN service from ${providerURL}.
${applicationName} does not require a user account, keep logs, or track you in
any way. The service is paid for entirely by donations from users like you.
grade: stable
confinement: classic
icon: snap/gui/icon.svg
base: core20
compression: lzo
architectures:
- build-on: amd64
- build-on: i386
parts:
bitmask-root:
plugin: dump
source: helpers
source-type: local
override-prime: |
mkdir -p bin
cp $SNAPCRAFT_PART_SRC/bitmask-root bin/
chmod +x bin/bitmask-root
openvpn:
plugin: nil
stage-packages: [openvpn]
prime:
- -usr/share/doc
- -usr/share/man
bitmask-vpn:
plugin: nil
source: .
source-type: local
stage:
- bin/${binaryName}
override-build: |
# TODO - this still has some round corners for vendoring.
# Maybe we just need to put the providers.json in the VENDOR_PATH
# and pass it to gui/providers from some path that snap can access.
# Same for the vendor.qrc
mkdir -p $SNAPCRAFT_PART_INSTALL/snap/
mkdir -p $SNAPCRAFT_PRIME/snap/
echo ${version} > $SNAPCRAFT_PRIME/snap/version.txt
make build_golib
ln -fs /usr/lib/qt5/bin/lrelease /root/parts/qt5/install/usr/lib/qt5/bin/lrelease
QMAKE=/root/parts/qt5/install/usr/lib/qt5/bin/qmake LRELEASE=/usr/lib/qt5/bin/lrelease QT_SELECT=5 XBUILD=no TARGET=${binaryName} make build_gui
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
mv build/qt/release/${binaryName} $SNAPCRAFT_PART_INSTALL/bin/
override-prime: |
rm -rf $SNAPCRAFT_PROJECT_DIR/snap/hooks/.mypy_cache
snapcraftctl prime
build-packages:
- pkg-config
- g++
- golang
- git
- make
- qttools5-dev-tools
stage-packages:
- qml-module-qt-labs-platform
after: [desktop-qt5]
desktop-integration:
plugin: nil
stage-packages:
- libx11-data
- libx11-xcb1
- xkb-data
desktop-qt5:
source: https://github.com/desktop-app/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-packages:
- build-essential
- dpkg-dev
stage-packages:
- libjpeg-turbo8
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgdk-pixbuf2.0-0
- locales-all
- xdg-user-dirs
- fcitx-frontend-qt5
- libglib2.0-bin
stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libQt5Core.so.5
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libQt5DBus.so.5
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libQt5EglFSDeviceIntegration.so.5
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libQt5Gui.so.5
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libQt5Network.so.5
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libQt5XcbQpa.so.5
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/bearer/libqconnmanbearer.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/bearer/libqgenericbearer.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/bearer/libqnmbearer.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/egldeviceintegrations/libqeglfs-emu-integration.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/generic/libqevdevkeyboardplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/generic/libqevdevmouseplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/generic/libqevdevtabletplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/generic/libqevdevtouchplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/generic/libqtuiotouchplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/imageformats/libqgif.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/imageformats/libqico.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/imageformats/libqjpeg.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqeglfs.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqlinuxfb.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqminimal.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqminimalegl.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqoffscreen.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqvnc.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms/libqxcb.so
after:
- qt5
qt5:
plugin: nil
build-packages:
- libdbus-1-dev
- libegl-dev
- libfontconfig1-dev
- libfreetype-dev
- libgl-dev
- libglib2.0-dev
- libharfbuzz-dev
- libicu-dev
- libpcre2-dev
- libpng-dev
- libwayland-dev
- libx11-dev
- libx11-xcb-dev
- libxcb1-dev
- libxcb-glx0-dev
- libxcb-icccm4-dev
- libxcb-image0-dev
- libxcb-keysyms1-dev
- libxcb-randr0-dev
- libxcb-render0-dev
- libxcb-render-util0-dev
- libxcb-shape0-dev
- libxcb-shm0-dev
- libxcb-sync-dev
- libxcb-util-dev
- libxcb-xfixes0-dev
- libxcb-xinerama0-dev
- libxcb-xinput-dev
- libxcb-xkb-dev
- libxcursor-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- zlib1g-dev
stage-packages:
- libdbus-1-3
- libegl1
- libfontconfig1
- libfreetype6
- libgl1
- libglib2.0-0
- libharfbuzz0b
- libicu66
- libpcre2-16-0
- libpng16-16
#- libwayland-client0
#- libwayland-cursor0
#- libwayland-egl1
- libx11-6
- libx11-xcb1
- libxcb1
- libxcb-glx0
- libxcb-icccm4
- libxcb-image0
- libxcb-keysyms1
- libxcb-randr0
- libxcb-render0
- libxcb-render-util0
- libxcb-shape0
- libxcb-shm0
- libxcb-sync1
- libxcb-util1
- libxcb-xfixes0
- libxcb-xinerama0
- libxcb-xinput0
- libxcb-xkb1
- libxcursor1
- libxkbcommon0
- libxkbcommon-x11-0
- zlib1g
- try: [appmenu-qt5] # not available on core18
override-pull: |
QT=5_15_2
git clone -b v5.15.2 --depth=1 git://code.qt.io/qt/qt5.git .
perl init-repository --module-subset=qtbase,qtimageformats,qtsvg,qtdeclarative,qtgraphicaleffects,qtquickcontrols,qtquickcontrols2,qtscript
git submodule update qtbase qtimageformats qtsvg qtdeclarative qtgraphicaleffects qtquickcontrols qtquickcontrols2 qtscript
override-build: |
./configure \
-prefix /usr \
-bindir /usr/lib/qt5/bin \
-libdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET \
-docdir /usr/share/qt5/doc \
-headerdir /usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5 \
-datadir /usr/share/qt5 \
-archdatadir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 \
-plugindir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins \
-importdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/imports \
-translationdir /usr/share/qt5/translations \
-hostdatadir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 \
-sysconfdir /etc/xdg \
-examplesdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/examples \
-release \
-opensource \
-confirm-license \
-no-gtk \
-no-feature-xcb-sm \
-no-openssl \
-nomake examples \
-nomake tests \
-opengl desktop \
-I $SNAPCRAFT_STAGE/usr/include \
-L $SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET
make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
make INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL" install
stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
prime:
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/bin
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/mkspecs
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/examples
- -./usr/lib/qt5
- -./usr/share
apps:
bitmask-root:
command: bin/bitmask-root
openvpn:
command: usr/sbin/openvpn
launcher:
command: bin/${binaryName} -platform xcb
environment:
QT_PLUGIN_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platforms:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/qml:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/qml/QtQuick/Controls.2/:$SNAP/usr/lib/x86_64-linux-gnu/qt5/plugins:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/xcbglintegrations
QT_QPA_PLATFORM_PLUGIN_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins:$SNAP/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms
# QT_STYLE_OVERRIDE: Fusion
QML2_IMPORT_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/qml
DISABLE_WAYLAND: 1
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
# debug -------------
# QT_OPENGL: software
# QT_DEBUG_PLUGINS: 1
SNAP_DESKTOP_DEBUG: 1
# debug -------------
|