forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
227 lines (211 loc) · 5.46 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
name: telegram-desktop
adopt-info: telegram
icon: Telegram/Resources/art/[email protected]
base: core18
grade: stable
confinement: strict
apps:
telegram-desktop:
command: bin/desktop-launch telegram-desktop
common-id: org.telegram.desktop
desktop: share/applications/telegramdesktop.desktop
environment:
# Use GTK3 cursor theme, icon theme and open/save file dialogs.
QT_QPA_PLATFORMTHEME: gtk3
# Wayland support is still too bad.
DISABLE_WAYLAND: 1
plugs:
- desktop
- desktop-legacy
- home
- network
- network-manager
- pulseaudio
- removable-media
- unity7
- x11
plugs:
# 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
parts:
telegram:
plugin: cmake
source: .
source-type: git
parse-info: [share/metainfo/telegramdesktop.appdata.xml]
build-packages:
- gcc-8
- g++-8
- qtbase5-private-dev
- libmapbox-variant-dev
- libasound2-dev
- libavcodec-dev
- libavformat-dev
- libavutil-dev
- libswscale-dev
- libswresample-dev
- libdbusmenu-qt5-dev
- liblz4-dev
- liblzma-dev
- libminizip-dev
- libopenal-dev
- libopus-dev
- libpulse-dev
- libssl-dev
- zlib1g-dev
stage-packages:
- qt5-image-formats-plugins
- libasound2
- libavcodec57
- libavformat57
- libavutil55
- libswscale4
- libswresample2
- libdbusmenu-qt5-2
- liblz4-1
- liblzma5
- libminizip1
- libopenal1
- libopus0
- libpulse0
- libssl1.1
- zlib1g
configflags:
- -DCMAKE_C_COMPILER=gcc-8
- -DCMAKE_CXX_COMPILER=g++-8
- -DCMAKE_BUILD_TYPE=Release
- -DTDESKTOP_API_ID=611335
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
- -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF
- -DDESKTOP_APP_USE_PACKAGED_GSL=OFF
- -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
- -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
- -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF
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=.*|Icon=/share/icons/hicolor/512x512/apps/telegram.png|g' lib/xdg/telegramdesktop.desktop
after:
- cmake
- desktop-qt5
- enchant
- range-v3
- xxhash
spellchecking:
plugin: nil
stage-packages:
- hunspell-de-de
- hunspell-en-au
- hunspell-en-ca
- hunspell-en-gb
- hunspell-en-us
- hunspell-en-za
- hunspell-fr-classical
- hunspell-it
- hunspell-pl
- hunspell-es
- hunspell-pt-br
- hunspell-pt-pt
desktop-qt5:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-packages:
- build-essential
- qtbase5-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- try: [appmenu-qt5] # not available on core18
- locales-all
- xdg-user-dirs
- fcitx-frontend-qt5
qt5-gtk-platform:
plugin: nil
stage-packages:
- qt5-gtk-platformtheme
cmake:
source: "https://gitlab.kitware.com/cmake/cmake.git"
source-depth: 1
source-tag: v3.16.4
source-type: git
plugin: make
override-build: |
${SNAPCRAFT_PART_SRC}/bootstrap \
--parallel=${SNAPCRAFT_PARALLEL_BUILD_COUNT} \
-- \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/ \
-DBUILD_TESTING=OFF
snapcraftctl build
build-packages:
- build-essential
- libssl-dev
- libncurses5-dev
stage-packages:
- libssl1.1
- libncurses5
- libtinfo5
prime: [-./*]
enchant:
source: https://github.com/AbiWord/enchant.git
source-depth: 1
source-tag: v2.2.7
plugin: autotools
build-packages:
- libltdl-dev
- libglib2.0-dev
- libhunspell-dev
stage-packages:
- libglib2.0-0
- libhunspell-1.6-0
configflags:
- --enable-relocatable
prime: [-./bin/*]
range-v3:
source: https://github.com/ericniebler/range-v3.git
source-depth: 1
source-tag: 0.10.0
plugin: cmake
configflags:
- -DRANGE_V3_TESTS=OFF
- -DRANGE_V3_EXAMPLES=OFF
- -DRANGE_V3_DOCS=OFF
prime: [-./*]
xxhash:
source: https://github.com/Cyan4973/xxHash.git
source-depth: 1
source-tag: v0.7.2
plugin: make
make-parameters: [PREFIX=]
prime: [-./bin/*]