forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
503 lines (477 loc) · 12.5 KB
/
snapcraft.yaml
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
name: telegram-desktop
adopt-info: telegram
icon: Telegram/Resources/art/[email protected]
base: core20
grade: stable
confinement: strict
compression: lzo
architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf
- build-on: ppc64el
apps:
telegram-desktop:
command: bin/desktop-launch telegram-desktop
common-id: org.telegram.desktop
desktop: usr/share/applications/telegram-desktop_telegram-desktop.desktop
environment:
# Tell glib to use portals on file associations handling.
GTK_USE_PORTAL: 1
# Use sandboxed ibus api
IBUS_USE_PORTAL: 1
plugs:
- alsa
- audio-playback
- audio-record
- camera
- desktop
- desktop-legacy
- hardware-observe
- home
- network
- opengl
- removable-media
- unity7
- wayland
- x11
slots:
- tdesktop-mpris
hooks:
configure:
command-chain:
- bin/hooks-configure-desktop
plugs:
- desktop
plugs:
desktop:
mount-host-font-cache: false
# Support for common GTK themes
# https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
gsettings:
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
slots:
tdesktop-mpris:
interface: mpris
name: tdesktop
layout:
/usr/share/alsa:
bind: $SNAP/usr/share/alsa
/usr/share/X11:
bind: $SNAP/usr/share/X11
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0
parts:
telegram:
plugin: cmake
source: .
source-type: git
parse-info: [usr/share/metainfo/telegram-desktop_telegram-desktop.metainfo.xml]
build-environment:
- CC: gcc-10
- CXX: g++-10
- LD_LIBRARY_PATH: $SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:$LD_LIBRARY_PATH
build-packages:
- clang
- g++-10
- python
- libasound2-dev
- libglib2.0-dev
- libglibmm-2.4-dev
- libopus-dev
- libpulse-dev
- libssl-dev
- libwayland-dev
- libxcb1-dev
- libxcb-keysyms1-dev
- libxcb-record0-dev
- libxcb-screensaver0-dev
- zlib1g-dev
stage-packages:
- libasound2
- libglib2.0-0
- libglibmm-2.4-1v5
- libopus0
- libpulse0
- libssl1.1
- libwayland-client0
- libwebkit2gtk-4.0-37
- libxcb1
- libxcb-keysyms1
- libxcb-record0
- libxcb-screensaver0
- zlib1g
- systemd
cmake-parameters:
- -GNinja
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DJPEG_LIBRARY_RELEASE=$SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so
- -DJPEG_INCLUDE_DIR=$SNAPCRAFT_STAGE/usr/include
- -DTDESKTOP_API_ID=611335
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
- -DTDESKTOP_LAUNCHER_BASENAME=telegram-desktop_telegram-desktop
override-pull: |
snapcraftctl pull
version_file=Telegram/build/version
version=$(sed -n "s/AppVersionStr[ ]\+\(.*\)\+/\1/p" $version_file)
beta=$(sed -n "s/BetaChannel[ ]\+\(.*\)\+/\1/p" $version_file)
if [ "$beta" != "0" ]; then
version="$version-beta"
fi
version="${version}$(git describe --tags | sed 's,^v[^-]\+,,')"
snapcraftctl set-version "$version"
sed -i 's|^Icon=telegram$|Icon=${SNAP}/meta/gui/icon.png|g' lib/xdg/telegramdesktop.desktop
override-build: |
snapcraftctl build
rm -rf "$SNAPCRAFT_PART_INSTALL/usr/share/icons"
stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
prime:
- -./lib/systemd
after:
- desktop-qt
- ffmpeg
- mozjpeg
- openal
- rnnoise
- webrtc
patches:
source: https://github.com/desktop-app/patches.git
source-depth: 1
plugin: dump
organize:
"*": patches/
prime: [-./*]
desktop-qt:
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:
- 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
stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after:
- mozjpeg
- qt
epoxy:
source: https://github.com/anholt/libepoxy.git
source-depth: 1
source-tag: 1.5.9
plugin: meson
meson-parameters:
- --buildtype=release
- --prefix=/usr
- --default-library=static
- -Dtests=false
override-pull: |
snapcraftctl pull
patch -p1 < $SNAPCRAFT_STAGE/patches/libepoxy.patch
prime: [-./*]
after:
- patches
ffmpeg:
plugin: nil
build-packages:
- libavcodec-dev
- libavformat-dev
- libavutil-dev
- libswresample-dev
- libswscale-dev
stage-packages:
- libavcodec58
- libavformat58
- libavutil56
- libswresample3
- libswscale5
stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after:
- mozjpeg
mozjpeg:
source: https://github.com/mozilla/mozjpeg.git
source-depth: 1
source-tag: v4.0.3
plugin: cmake
cmake-parameters:
- -GNinja
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DENABLE_STATIC=OFF
- -DWITH_JPEG8=ON
- -DPNG_SUPPORTED=OFF
prime:
- -./usr/bin
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.so
- -./usr/share
openal:
source: https://github.com/telegramdesktop/openal-soft.git
source-depth: 1
source-branch: fix_pulse_default
plugin: cmake
build-packages:
- libasound2-dev
- libpulse-dev
stage-packages:
- libasound2
- libpulse0
cmake-parameters:
- -GNinja
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DALSOFT_EXAMPLES=OFF
- -DALSOFT_TESTS=OFF
- -DALSOFT_UTILS=OFF
- -DALSOFT_CONFIG=OFF
prime:
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libopenal.so
qt:
plugin: nil
build-packages:
- libdbus-1-dev
- libegl-dev
- libfontconfig1-dev
- libfreetype-dev
- libglib2.0-dev
- libglx-dev
- libgtk-3-dev
- libharfbuzz-dev
- libice-dev
- libicu-dev
- libopengl-dev
- libpcre2-dev
- libpng-dev
- libsm-dev
- libssl-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-xinput-dev
- libxcb-xkb-dev
- libxcursor-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- zlib1g-dev
stage-packages:
- libdbus-1-3
- libegl1
- libfontconfig1
- libfreetype6
- libglib2.0-0
- libglx0
- libgtk-3-0
- libharfbuzz0b
- libice6
- libicu66
- libopengl0
- libpcre2-16-0
- libpng16-16
- libsm6
- libssl1.1
- 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-xinput0
- libxcb-xkb1
- libxcursor1
- libxkbcommon0
- libxkbcommon-x11-0
- zlib1g
override-pull: |
QT=6_2_3
git clone -b v6.2.3 --depth=1 git://code.qt.io/qt/qt5.git .
perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat
cd qtbase
find $SNAPCRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qtwayland
find $SNAPCRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qt5compat
find $SNAPCRAFT_STAGE/patches/qt5compat_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ..
override-build: |
./configure \
-prefix /usr \
-libdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET \
-release \
-opensource \
-confirm-license \
-no-feature-getentropy \
-no-feature-renameat2 \
-no-feature-statx \
-no-feature-highdpiscaling \
-openssl-linked \
-nomake examples \
-nomake tests \
-- \
-DINPUT_egl_extension_platform_wayland=no
cmake --build . -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
DESTDIR="$SNAPCRAFT_PART_INSTALL" cmake --install .
stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
prime:
- -./usr/bin
- -./usr/doc
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/metatypes
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.a
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.la
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.prl
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.so
- -./usr/libexec
- -./usr/mkspecs
- -./usr/modules
# Allow tdesktop's custom try-portal-and-fallback logic to work
- -./usr/plugins/platformthemes/libqxdgdesktopportal.so
after:
- epoxy
- mozjpeg
- patches
rnnoise:
source: https://gitlab.xiph.org/xiph/rnnoise.git
source-depth: 1
source-commit: 7f449bf8bd3b933891d12c30112268c4090e4d59
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$SNAPCRAFT_ARCH_TRIPLET
- --disable-static
- --disable-examples
- --disable-doc
prime:
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/librnnoise.la
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/librnnoise.so
- -./usr/share
vpx:
source: https://github.com/webmproject/libvpx.git
source-depth: 1
source-tag: v1.11.0
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
- --libdir=/usr/lib/$SNAPCRAFT_ARCH_TRIPLET
- --disable-examples
- --disable-unit-tests
- --disable-tools
- --disable-docs
- --enable-shared
- --disable-static
- --enable-vp8
- --enable-vp9
- --enable-webm-io
prime:
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvpx.so
webrtc:
source: https://github.com/desktop-app/tg_owt.git
source-depth: 1
source-commit: d618d0b5ff3e59bea0143e6070481f8f4316a428
plugin: cmake
build-packages:
- yasm
#- libdrm-dev
#- libgbm-dev
#- libglib2.0-dev
- libopus-dev
#- libpipewire-0.2-dev
- libssl-dev
- libx11-dev
- libxcomposite-dev
- libxdamage-dev
- libxext-dev
- libxfixes-dev
- libxrender-dev
- libxrandr-dev
- libxtst-dev
stage-packages:
#- libdrm2
#- libgbm1
#- libglib2.0-0
- libopus0
#- libpipewire-0.2-1
- libssl1.1
- libx11-6
- libxcomposite1
- libxdamage1
- libxext6
- libxfixes3
- libxrender1
- libxrandr2
- libxtst6
cmake-parameters:
- -GNinja
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DJPEG_LIBRARY_RELEASE=$SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so
- -DJPEG_INCLUDE_DIR=$SNAPCRAFT_STAGE/usr/include
- -DTG_OWT_USE_PIPEWIRE=OFF
prime:
- -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.a
after:
#- epoxy
- ffmpeg
- mozjpeg
- vpx