blob: 69147392626b677077b33a0b702a2d07c4fc0917 (
plain)
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
|
# Maintainer:
## options
: ${_ffmpeg_version=}
_pkgname="telegram-desktop"
pkgname="$_pkgname-git"
pkgver=5.7.2.r0.g02c01e2
pkgrel=1
pkgdesc='Official Telegram Desktop client'
url="https://github.com/telegramdesktop/tdesktop"
license=('GPL-3.0-or-later')
arch=('x86_64')
depends+=(
ada
ffmpeg${_ffmpeg_version:-}
hunspell
jemalloc
kcoreaddons
libdispatch
libvpx
libxdamage
minizip
openal
openh264
opus
protobuf
qt6-base
qt6-declarative
qt6-svg
qt6-wayland
rnnoise
xcb-util-keysyms
xxhash
)
makedepends+=(
boost
cmake
extra-cmake-modules
fmt
git
glib2-devel
gobject-introspection
ninja
)
optdepends+=(
'webkit2gtk: embedded browser features'
'xdg-desktop-portal: desktop integration'
)
provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")
_source_main() {
_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')
}
_source_telegram_desktop() {
source+=(
#'apple.swift-corelibs-libdispatch'::'git+https://github.com/apple/swift-corelibs-libdispatch.git'
'cyan4973.xxhash'::'git+https://github.com/Cyan4973/xxHash.git'
'desktop-app.cmake_helpers'::'git+https://github.com/desktop-app/cmake_helpers.git'
'desktop-app.codegen'::'git+https://github.com/desktop-app/codegen.git'
'desktop-app.lib_base'::'git+https://github.com/desktop-app/lib_base.git'
'desktop-app.lib_crl'::'git+https://github.com/desktop-app/lib_crl.git'
'desktop-app.lib_lottie'::'git+https://github.com/desktop-app/lib_lottie.git'
'desktop-app.lib_qr'::'git+https://github.com/desktop-app/lib_qr.git'
'desktop-app.lib_rpl'::'git+https://github.com/desktop-app/lib_rpl.git'
'desktop-app.lib_spellcheck'::'git+https://github.com/desktop-app/lib_spellcheck.git'
'desktop-app.lib_storage'::'git+https://github.com/desktop-app/lib_storage.git'
'desktop-app.lib_tl'::'git+https://github.com/desktop-app/lib_tl.git'
'desktop-app.lib_ui'::'git+https://github.com/desktop-app/lib_ui.git'
'desktop-app.lib_webrtc'::'git+https://github.com/desktop-app/lib_webrtc.git'
'desktop-app.lib_webview'::'git+https://github.com/desktop-app/lib_webview.git'
'desktop-app.libprisma'::'git+https://github.com/desktop-app/libprisma.git'
'desktop-app.rlottie'::'git+https://github.com/desktop-app/rlottie.git'
'ericniebler.range-v3'::'git+https://github.com/ericniebler/range-v3.git'
'fcitx.fcitx5-qt'::'git+https://github.com/fcitx/fcitx5-qt.git'
'flatpak.xdg-desktop-portal'::'git+https://github.com/flatpak/xdg-desktop-portal.git'
'google.cld3'::'git+https://github.com/google/cld3.git'
'hamonikr.nimf'::'git+https://github.com/hamonikr/nimf.git'
'hime-ime.hime'::'git+https://github.com/hime-ime/hime.git'
#'hunspell'::'git+https://github.com/hunspell/hunspell.git'
#'jemalloc'::'git+https://github.com/jemalloc/jemalloc.git'
#'kde.kcoreaddons'::'git+https://github.com/KDE/kcoreaddons.git'
#'kde.kimageformats'::'git+https://github.com/KDE/kimageformats.git'
'lz4'::'git+https://github.com/lz4/lz4.git'
'microsoft.gsl'::'git+https://github.com/Microsoft/GSL.git'
'nayuki.qr-code-generator'::'git+https://github.com/nayuki/QR-Code-generator.git'
'tartanllama.expected'::'git+https://github.com/TartanLlama/expected.git'
'telegramdesktop.libtgvoip'::'git+https://github.com/telegramdesktop/libtgvoip.git'
'telegrammessenger.tgcalls'::'git+https://github.com/TelegramMessenger/tgcalls.git'
)
sha256sums+=(
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
_prepare_telegram_desktop() (
cd "$srcdir/$_pkgsrc"
local _submodules=(
#'apple.swift-corelibs-libdispatch'::'Telegram/ThirdParty/dispatch'
'cyan4973.xxhash'::'Telegram/ThirdParty/xxHash'
'desktop-app.cmake_helpers'::'cmake'
'desktop-app.codegen'::'Telegram/codegen'
'desktop-app.lib_base'::'Telegram/lib_base'
'desktop-app.lib_crl'::'Telegram/lib_crl'
'desktop-app.lib_lottie'::'Telegram/lib_lottie'
'desktop-app.lib_qr'::'Telegram/lib_qr'
'desktop-app.lib_rpl'::'Telegram/lib_rpl'
'desktop-app.lib_spellcheck'::'Telegram/lib_spellcheck'
'desktop-app.lib_storage'::'Telegram/lib_storage'
'desktop-app.lib_tl'::'Telegram/lib_tl'
'desktop-app.lib_ui'::'Telegram/lib_ui'
'desktop-app.lib_webrtc'::'Telegram/lib_webrtc'
'desktop-app.lib_webview'::'Telegram/lib_webview'
'desktop-app.libprisma'::'Telegram/ThirdParty/libprisma'
'desktop-app.rlottie'::'Telegram/ThirdParty/rlottie'
'ericniebler.range-v3'::'Telegram/ThirdParty/range-v3'
'fcitx.fcitx5-qt'::'Telegram/ThirdParty/fcitx5-qt'
'flatpak.xdg-desktop-portal'::'Telegram/ThirdParty/xdg-desktop-portal'
'google.cld3'::'Telegram/ThirdParty/cld3'
'hamonikr.nimf'::'Telegram/ThirdParty/nimf'
'hime-ime.hime'::'Telegram/ThirdParty/hime'
#'hunspell'::'Telegram/ThirdParty/hunspell'
#'jemalloc'::'Telegram/ThirdParty/jemalloc'
#'kde.kcoreaddons'::'Telegram/ThirdParty/kcoreaddons'
#'kde.kimageformats'::'Telegram/ThirdParty/kimageformats'
'lz4'::'Telegram/ThirdParty/lz4'
'microsoft.gsl'::'Telegram/ThirdParty/GSL'
'nayuki.qr-code-generator'::'Telegram/ThirdParty/QR'
'tartanllama.expected'::'Telegram/ThirdParty/expected'
'telegramdesktop.libtgvoip'::'Telegram/ThirdParty/libtgvoip'
'telegrammessenger.tgcalls'::'Telegram/ThirdParty/tgcalls'
)
_submodule_update
)
}
_source_telegramdesktop_libtgvoip() {
source+=(
'desktop-app.cmake_helpers'::'git+https://github.com/desktop-app/cmake_helpers.git'
)
sha256sums+=(
'SKIP'
)
_prepare_telegramdesktop_libtgvoip() (
cd "$srcdir/$_pkgsrc"
cd "Telegram/ThirdParty/libtgvoip"
local _submodules=(
'desktop-app.cmake_helpers'::'cmake'
)
_submodule_update
)
}
_source_desktop_app_cmake_helpers() {
source+=(
'mnauw.cppgir'::'git+https://gitlab.com/mnauw/cppgir.git'
'yugr.implib.so'::'git+https://github.com/yugr/Implib.so.git'
)
sha256sums+=(
'SKIP'
'SKIP'
)
_prepare_desktop_app_cmake_helpers() (
cd "$srcdir/$_pkgsrc"
cd "cmake"
local _submodules=(
'mnauw.cppgir'::'external/glib/cppgir'
'yugr.implib.so'::'external/Implib.so'
)
_submodule_update
)
}
_source_mnauw_cppgir() {
source+=(
'martinmoene.expected-lite'::'git+https://github.com/martinmoene/expected-lite.git'
)
sha256sums+=(
'SKIP'
)
_prepare_mnauw_cppgir() (
cd "$srcdir/$_pkgsrc"
cd "cmake"
cd "external/glib/cppgir"
local _submodules=(
'martinmoene.expected-lite'::'expected-lite'
)
_submodule_update
)
}
_source_tg_owt() {
depends+=(
libpipewire
libxcomposite
libxrandr
libxtst
)
makedepends+=(
yasm
)
_pkgsrc_tgowt="telegram-tg_owt"
source+=(
"$_pkgsrc_tgowt"::"git+https://github.com/desktop-app/tg_owt.git"
)
sha256sums+=(
'SKIP'
)
source+=(
'abseil.abseil-cpp'::'git+https://github.com/abseil/abseil-cpp.git'
'chromiumsrc.libyuv'::'git+https://gitlab.com/chromiumsrc/libyuv.git'
'cisco.libsrtp'::'git+https://github.com/cisco/libsrtp.git'
'google.crc32c'::'git+https://github.com/google/crc32c.git'
)
sha256sums+=(
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
_prepare_tg_owt() (
cd "$srcdir/$_pkgsrc_tgowt"
local _submodules=(
'abseil.abseil-cpp'::'src/third_party/abseil-cpp'
'chromiumsrc.libyuv'::'src/third_party/libyuv'
'cisco.libsrtp'::'src/third_party/libsrtp'
'google.crc32c'::'src/third_party/crc32c/src'
)
_submodule_update
)
}
_source_main
_source_telegram_desktop
_source_telegramdesktop_libtgvoip
_source_desktop_app_cmake_helpers
_source_mnauw_cppgir
_source_tg_owt
prepare() {
_submodule_update() {
local _module
for _module in "${_submodules[@]}"; do
git submodule init "${_module##*::}"
git submodule set-url "${_module##*::}" "$srcdir/${_module%::*}"
git -c protocol.file.allow=always submodule update "${_module##*::}"
done
}
_prepare_tg_owt
_prepare_telegram_desktop
_prepare_telegramdesktop_libtgvoip
_prepare_desktop_app_cmake_helpers
_prepare_mnauw_cppgir
}
pkgver() {
cd "$_pkgsrc"
git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
| sed -E 's/^[^0-9]+//;s/([^-]*-g)/r\1/;s/-/./g'
}
_build_tg_owt() (
local _cmake_crc32=(
-B "build_crc32"
-S "$srcdir/google.crc32c"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX=/usr
-DCRC32C_BUILD_TESTS=OFF
-DCRC32C_BUILD_BENCHMARKS=OFF
-DCRC32C_USE_GLOG=OFF
-Wno-dev
)
cmake "${_cmake_crc32[@]}"
cmake --build "build_crc32"
DESTDIR="$srcdir/deps_crc32" cmake --install "build_crc32"
local _cmake_tg_owt=(
-B "build_tg_owt"
-S "$_pkgsrc_tgowt"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DBUILD_SHARED_LIBS=OFF
-DTG_OWT_PACKAGED_BUILD=ON
-DCMAKE_PREFIX_PATH="$srcdir/deps_crc32/usr"
-Wno-dev
)
cmake "${_cmake_tg_owt[@]}"
cmake --build "build_tg_owt"
)
_build_telegram() (
local _cmake_options=(
-B build
-S "$_pkgsrc"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX=/usr
-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON
-DTDESKTOP_API_TEST=ON
-DTDESKTOP_API_ID=611335
-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF
-Dtg_owt_DIR="$srcdir/build_tg_owt"
-DCMAKE_PREFIX_PATH="$srcdir/deps_crc32/usr"
-Wno-dev
)
cmake "${_cmake_options[@]}"
cmake --build build
)
build() {
export LDFLAGS+=" -Wl,--copy-dt-needed-entries"
[ -n "${_ffmpeg_version}" ] && export PKG_CONFIG_PATH="/usr/lib/ffmpeg${_ffmpeg_version:-}/pkgconfig"
_build_tg_owt
_build_telegram
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
|