Commit | Line | Data |
---|---|---|
a84399ed RG |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
7 | ;;; under the terms of the GNU General Public License as published by | |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
9 | ;;; your option) any later version. | |
10 | ;;; | |
11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ;;; GNU General Public License for more details. | |
15 | ;;; | |
16 | ;;; You should have received a copy of the GNU General Public License | |
17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | (define-module (gnu packages telegram) | |
20 | #:use-module (gnu packages) | |
edfbb1d2 | 21 | #:use-module (gnu packages aidc) |
cda5fb48 | 22 | #:use-module (gnu packages animation) |
a84399ed | 23 | #:use-module (gnu packages assembly) |
edfbb1d2 | 24 | #:use-module (gnu packages audio) |
27fa4844 | 25 | #:use-module (gnu packages autotools) |
edfbb1d2 | 26 | #:use-module (gnu packages base) |
cda5fb48 | 27 | #:use-module (gnu packages check) |
edfbb1d2 RG |
28 | #:use-module (gnu packages cmake) |
29 | #:use-module (gnu packages compression) | |
30 | #:use-module (gnu packages cpp) | |
31 | #:use-module (gnu packages digest) | |
32 | #:use-module (gnu packages fcitx) | |
33 | #:use-module (gnu packages fcitx5) | |
34 | #:use-module (gnu packages gcc) | |
35 | #:use-module (gnu packages glib) | |
36 | #:use-module (gnu packages gnome) | |
d1e7a01c | 37 | #:use-module (gnu packages gnupg) |
edfbb1d2 | 38 | #:use-module (gnu packages gtk) |
a84399ed | 39 | #:use-module (gnu packages image) |
edfbb1d2 RG |
40 | #:use-module (gnu packages kde-frameworks) |
41 | #:use-module (gnu packages language) | |
d1e7a01c | 42 | #:use-module (gnu packages libevent) |
edfbb1d2 | 43 | #:use-module (gnu packages libreoffice) |
a84399ed | 44 | #:use-module (gnu packages linux) |
edfbb1d2 | 45 | #:use-module (gnu packages lxqt) |
86f461d6 RG |
46 | #:use-module (gnu packages lua) |
47 | #:use-module (gnu packages perl) | |
a84399ed RG |
48 | #:use-module (gnu packages pkg-config) |
49 | #:use-module (gnu packages protobuf) | |
50 | #:use-module (gnu packages pulseaudio) | |
51 | #:use-module (gnu packages python) | |
edfbb1d2 | 52 | #:use-module (gnu packages qt) |
86f461d6 RG |
53 | #:use-module (gnu packages readline) |
54 | #:use-module (gnu packages textutils) | |
27fa4844 | 55 | #:use-module (gnu packages telephony) |
a84399ed RG |
56 | #:use-module (gnu packages tls) |
57 | #:use-module (gnu packages video) | |
86f461d6 | 58 | #:use-module (gnu packages web) |
a84399ed | 59 | #:use-module (gnu packages xiph) |
edfbb1d2 | 60 | #:use-module (gnu packages xorg) |
a84399ed RG |
61 | #:use-module ((guix licenses) #:prefix license:) |
62 | #:use-module (guix packages) | |
63 | #:use-module (guix git-download) | |
cda5fb48 | 64 | #:use-module (guix build-system cmake) |
8b4e8933 | 65 | #:use-module (guix build-system copy) |
edfbb1d2 | 66 | #:use-module (guix build-system glib-or-gtk) |
27fa4844 | 67 | #:use-module (guix build-system gnu) |
edfbb1d2 RG |
68 | #:use-module (guix build-system meson) |
69 | #:use-module (guix build-system qt)) | |
a84399ed RG |
70 | |
71 | (define-public webrtc-for-telegram-desktop | |
81ffe224 RG |
72 | (let ((commit "a19877363082da634a3c851a4698376504d2eaee") |
73 | (revision "83")) | |
a84399ed RG |
74 | (hidden-package |
75 | (package | |
76 | (name "webrtc-for-telegram-desktop") | |
77 | (version | |
78 | (git-version "0" revision commit)) | |
79 | (source | |
80 | (origin | |
81 | (method git-fetch) | |
82 | (uri | |
83 | (git-reference | |
84 | (url "https://github.com/desktop-app/tg_owt.git") | |
85 | (commit commit))) | |
86 | (file-name | |
87 | (git-file-name name version)) | |
88 | (sha256 | |
81ffe224 | 89 | (base32 "0961zm1m1mc2kh54dx5ax95q8sw13impvpjvg9jv12bmfkgm17wr")) |
a84399ed RG |
90 | (modules '((guix build utils) |
91 | (ice-9 ftw) | |
92 | (srfi srfi-1))) | |
93 | (snippet | |
94 | `(begin | |
95 | (let ((keep | |
96 | '( ;; Custom forks which are incompatible with the ones in Guix. | |
97 | "abseil-cpp" "libsrtp" "openh264" "rnnoise" | |
98 | ;; Not available in Guix. | |
99 | "pffft" "usrsctp" | |
100 | ;; Has cmake support files for libvpx input. | |
101 | "libvpx"))) | |
102 | (with-directory-excursion "src/third_party" | |
103 | (for-each delete-file-recursively | |
104 | (lset-difference string=? | |
105 | (scandir ".") | |
106 | (cons* "." ".." keep)))) | |
107 | #t))))) | |
108 | (build-system cmake-build-system) | |
109 | (arguments | |
110 | `(#:tests? #f ; No target | |
111 | #:configure-flags | |
112 | (list | |
113 | "-DCMAKE_C_FLAGS=-fPIC" | |
114 | "-DCMAKE_CXX_FLAGS=-fPIC") | |
115 | #:phases | |
116 | (modify-phases %standard-phases | |
117 | (add-after 'unpack 'copy-inputs | |
118 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
119 | (let* ((libvpx-from (assoc-ref inputs "libvpx")) | |
120 | (libyuv-from (assoc-ref inputs "libyuv")) | |
121 | (libvpx-to (string-append (getcwd) | |
122 | "/src/third_party/libvpx/source/libvpx")) | |
123 | (libyuv-to (string-append (getcwd) | |
124 | "/src/third_party/libyuv"))) | |
125 | (copy-recursively libvpx-from libvpx-to) | |
126 | (copy-recursively libyuv-from libyuv-to)) | |
127 | #t))))) | |
128 | (native-inputs | |
129 | `(("pkg-config" ,pkg-config) | |
130 | ("python" ,python-wrapper) | |
131 | ("yasm" ,yasm))) | |
132 | (inputs | |
133 | `(("alsa" ,alsa-lib) | |
134 | ("ffmpeg" ,ffmpeg) | |
135 | ("libjpeg" ,libjpeg-turbo) | |
136 | ("libvpx" | |
137 | ,(origin | |
138 | (method git-fetch) | |
139 | (uri | |
140 | (git-reference | |
141 | (url "https://chromium.googlesource.com/webm/libvpx") | |
142 | (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9"))) | |
143 | (file-name | |
144 | (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version)) | |
145 | (sha256 | |
146 | (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68")))) | |
147 | ("libyuv" | |
148 | ,(origin | |
149 | (method git-fetch) | |
150 | (uri | |
151 | (git-reference | |
152 | (url "https://chromium.googlesource.com/libyuv/libyuv") | |
153 | (commit "ad890067f661dc747a975bc55ba3767fe30d4452"))) | |
154 | (file-name | |
155 | (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version)) | |
156 | (sha256 | |
157 | (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))) | |
158 | ("openssl" ,openssl) | |
159 | ("opus" ,opus) | |
160 | ("protobuf" ,protobuf) | |
81ffe224 RG |
161 | ("pulseaudio" ,pulseaudio) |
162 | ("x11" ,libx11) | |
163 | ("xext" ,libxext) | |
164 | ("xtst" ,libxtst))) | |
a84399ed RG |
165 | (synopsis "WebRTC support for Telegram Desktop") |
166 | (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by | |
167 | Telegram project, for its use in telegram desktop client.") | |
168 | (home-page "https://github.com/desktop-app/tg_owt") | |
169 | (license | |
170 | (list | |
171 | ;; Abseil-CPP | |
172 | license:asl2.0 | |
173 | ;; LibYuv | |
174 | (license:non-copyleft "file:///src/third_party/libyuv/LICENSE") | |
175 | ;; OpenH264 | |
176 | license:bsd-2 | |
177 | ;; PFFFT | |
178 | (license:non-copyleft "file:///src/third_party/pffft/LICENSE") | |
179 | ;; RnNoise | |
180 | license:gpl3 | |
181 | ;; LibSRTP, LibVPx, UsrSCTP and Others | |
182 | license:bsd-3)))))) | |
cda5fb48 RG |
183 | |
184 | (define-public rlottie-for-telegram-desktop | |
185 | (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b") | |
186 | (revision "671")) | |
187 | (hidden-package | |
188 | (package | |
189 | (inherit rlottie) | |
190 | (version | |
191 | (git-version "0.0.1" revision commit)) | |
192 | (source | |
193 | (origin | |
194 | (method git-fetch) | |
195 | (uri | |
196 | (git-reference | |
197 | (url "https://github.com/desktop-app/rlottie.git") | |
198 | (commit commit))) | |
199 | (file-name | |
200 | (git-file-name "rlottie-for-telegram-desktop" version)) | |
201 | (sha256 | |
202 | (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c")))) | |
203 | (arguments | |
204 | `(#:configure-flags | |
205 | (list | |
206 | "-Dlog=true" | |
207 | "-Ddumptree=true" | |
208 | "-Dtest=true") | |
209 | #:phases | |
210 | (modify-phases %standard-phases | |
211 | (add-after 'unpack 'patch-cxx-flags | |
212 | (lambda _ | |
213 | (substitute* "meson.build" | |
214 | (("werror=true") | |
215 | "werror=false")) | |
216 | #t))))))))) | |
27fa4844 RG |
217 | |
218 | (define-public libtgvoip-for-telegram-desktop | |
b89b5ff3 RG |
219 | (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd") |
220 | (revision "88")) | |
27fa4844 RG |
221 | (hidden-package |
222 | (package | |
223 | (inherit libtgvoip) | |
224 | (version | |
225 | (git-version "2.4.4" revision commit)) | |
226 | (source | |
227 | (origin | |
228 | (method git-fetch) | |
229 | (uri | |
230 | (git-reference | |
231 | (url "https://github.com/telegramdesktop/libtgvoip.git") | |
232 | (commit commit))) | |
233 | (file-name | |
234 | (git-file-name "libtgvoip-for-telegram-desktop" version)) | |
235 | (sha256 | |
b89b5ff3 | 236 | (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd")))) |
27fa4844 RG |
237 | (arguments |
238 | `(#:configure-flags | |
239 | (list | |
240 | "--disable-static" | |
241 | "--disable-dsp" ; FIXME | |
242 | "--enable-audio-callback" | |
243 | "--with-alsa" | |
244 | "--with-pulse") | |
245 | #:phases | |
246 | (modify-phases %standard-phases | |
247 | (add-after 'unpack 'patch-linkers | |
248 | (lambda _ | |
249 | (substitute* "Makefile.am" | |
250 | (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)") | |
251 | "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)")) | |
252 | (substitute* "tgvoip.pc.in" | |
253 | (("libcrypto opus") | |
254 | "libcrypto opus alsa libpulse")) | |
255 | #t))))) | |
256 | (native-inputs | |
257 | `(("autoconf" ,autoconf) | |
258 | ("automake" ,automake) | |
259 | ("libtool" ,libtool) | |
260 | ("pkg-config" ,pkg-config))))))) | |
edfbb1d2 RG |
261 | |
262 | (define-public telegram-desktop | |
263 | (package | |
264 | (name "telegram-desktop") | |
b7f75432 | 265 | (version "2.5.9") |
edfbb1d2 RG |
266 | (source |
267 | (origin | |
268 | (method git-fetch) | |
269 | (uri | |
270 | (git-reference | |
271 | (url "https://github.com/telegramdesktop/tdesktop.git") | |
272 | (commit | |
273 | (string-append "v" version)))) | |
274 | (file-name | |
275 | (git-file-name name version)) | |
276 | (sha256 | |
b7f75432 | 277 | (base32 "1lqs06scqvzg37a2py8jk7nnlvk42jjifcpnhdd5rgd5biw70nyx")) |
edfbb1d2 RG |
278 | (modules '((guix build utils) |
279 | (ice-9 ftw) | |
280 | (srfi srfi-1))) | |
281 | (snippet | |
282 | `(begin | |
283 | (let ((keep | |
284 | '( ;; Not available in Guix. | |
285 | "SPMediaKeyTap" "statusnotifieritem" "tgcalls"))) | |
286 | (with-directory-excursion "Telegram/ThirdParty" | |
287 | (for-each delete-file-recursively | |
288 | (lset-difference string=? | |
289 | (scandir ".") | |
290 | (cons* "." ".." keep)))) | |
291 | #t))))) | |
292 | (build-system qt-build-system) | |
293 | (arguments | |
294 | `(#:tests? #f ; No target | |
295 | #:imported-modules | |
296 | (,@%qt-build-system-modules | |
297 | (guix build glib-or-gtk-build-system)) | |
298 | #:modules | |
299 | ((guix build qt-build-system) | |
300 | ((guix build glib-or-gtk-build-system) | |
301 | #:prefix glib-or-gtk:) | |
302 | (guix build utils) | |
303 | (ice-9 match)) | |
304 | #:configure-flags | |
305 | (list | |
306 | ;; Client applications must provide their own API-ID and API-HASH, | |
307 | ;; see also <https://core.telegram.org/api/obtaining_api_id>. | |
308 | ;; In case, that the credentials below fail to work, contact | |
309 | ;; Raghav Gururajan <rg@raghavgururajan.name> | |
310 | "-DTDESKTOP_API_ID=2791056" | |
311 | "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2" | |
312 | ;; Use bundled fonts as fallback. | |
313 | "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF") | |
314 | #:phases | |
315 | (modify-phases %standard-phases | |
316 | (add-after 'unpack 'make-writable | |
317 | (lambda _ | |
318 | (for-each make-file-writable (find-files ".")) | |
319 | #t)) | |
320 | (add-after 'make-writable 'copy-inputs | |
321 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
322 | (for-each | |
323 | (match-lambda | |
324 | ((dst src) | |
325 | (copy-recursively src dst) | |
326 | (for-each make-file-writable (find-files dst)))) | |
327 | `(("cmake" ,(assoc-ref inputs "cmake-helpers")) | |
328 | ("Telegram/codegen" ,(assoc-ref inputs "codegen-source")) | |
329 | ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source")) | |
330 | ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source")) | |
331 | ("Telegram/lib_lottie" | |
332 | ,(assoc-ref inputs "lib-lottie-source")) | |
333 | ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source")) | |
334 | ("Telegram/lib_rlottie" | |
335 | ,(assoc-ref inputs "lib-rlottie-source")) | |
336 | ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source")) | |
337 | ("Telegram/lib_spellcheck" | |
338 | ,(assoc-ref inputs "lib-spellcheck-source")) | |
339 | ("Telegram/lib_storage" | |
340 | ,(assoc-ref inputs "lib-storage-source")) | |
341 | ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source")) | |
342 | ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source")) | |
343 | ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source")) | |
344 | ("Telegram/ThirdParty/tgcalls" | |
345 | ,(assoc-ref inputs "tgcalls-source")))) | |
346 | #t)) | |
347 | (add-before 'configure 'patch-cxx-flags | |
348 | (lambda _ | |
349 | (substitute* "cmake/options_linux.cmake" | |
350 | (("class-memaccess") "all")) | |
351 | #t)) | |
352 | (add-after 'install 'glib-or-gtk-compile-schemas | |
353 | (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas)) | |
354 | (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap | |
355 | (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))))) | |
356 | (native-inputs | |
357 | `(("cmake-helpers" | |
358 | ,(origin | |
359 | (method git-fetch) | |
360 | (uri | |
361 | (git-reference | |
362 | (url "https://github.com/desktop-app/cmake_helpers.git") | |
b7f75432 | 363 | (commit "695fabda6830b58bdc02d09db70531d5dececcd0"))) |
edfbb1d2 RG |
364 | (file-name |
365 | (git-file-name "cmake-helpers-for-telegram-desktop" version)) | |
366 | (sha256 | |
b7f75432 | 367 | (base32 "1j3ppgfmihcjl22w5jk8jhwif10i9wbycq5zqnssn6pnhnj7di5i")))) |
edfbb1d2 RG |
368 | ("cmake-shared" ,cmake-shared) |
369 | ("extra-cmake-modules" ,extra-cmake-modules) | |
370 | ("gcc" ,gcc-9) | |
371 | ("glib:bin" ,glib "bin") | |
372 | ("gobject-introspection" ,gobject-introspection) | |
373 | ("gtk+:bin" ,gtk+ "bin") | |
374 | ("pkg-config" ,pkg-config) | |
375 | ("python" ,python-wrapper) | |
376 | ("qttools" ,qttools))) | |
377 | (inputs | |
378 | `(("alsa" ,alsa-lib) | |
379 | ("c++-gsl" ,c++-gsl) | |
380 | ("catch" ,catch-framework2) | |
381 | ("codegen-source" | |
382 | ,(origin | |
383 | (method git-fetch) | |
384 | (uri | |
385 | (git-reference | |
386 | (url "https://github.com/desktop-app/codegen.git") | |
387 | (commit "127968de8129e8ccfa6ac50721c70415a5a087c3"))) | |
388 | (file-name | |
389 | (git-file-name "codegen" version)) | |
390 | (sha256 | |
391 | (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2")))) | |
392 | ("expected" ,libexpected) | |
393 | ("fcitx-qt5" ,fcitx-qt5) | |
394 | ("fcitx5-qt" ,fcitx5-qt) | |
395 | ("ffmpeg" ,ffmpeg) | |
396 | ("glib" ,glib) | |
397 | ("gtk+" ,gtk+) | |
398 | ("hime" ,hime) | |
399 | ("hunspell" ,hunspell) | |
400 | ("iconv" ,libiconv) | |
b7f75432 | 401 | ("kwayland" ,kwayland) |
edfbb1d2 RG |
402 | ("lib-base-source" |
403 | ,(origin | |
404 | (method git-fetch) | |
405 | (uri | |
406 | (git-reference | |
407 | (url "https://github.com/desktop-app/lib_base.git") | |
b7f75432 | 408 | (commit "f1e4168081428fa451d2f50eee7b1c448268c43a"))) |
edfbb1d2 RG |
409 | (file-name |
410 | (git-file-name "lib-base-for-telegram-desktop" version)) | |
411 | (sha256 | |
b7f75432 | 412 | (base32 "0piqp7llwi7sfy4c15g0p8ihr90rz1qps6q5fkl1iasrf5ysw8qc")))) |
edfbb1d2 RG |
413 | ("lib-crl-source" |
414 | ,(origin | |
415 | (method git-fetch) | |
416 | (uri | |
417 | (git-reference | |
418 | (url "https://github.com/desktop-app/lib_crl.git") | |
419 | (commit "16150bf71d79382738114b913f137ec1a1a7630c"))) | |
420 | (file-name | |
421 | (git-file-name "lib-crl-for-telegram-desktop" version)) | |
422 | (sha256 | |
423 | (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q")))) | |
424 | ("lib-lottie-source" | |
425 | ,(origin | |
426 | (method git-fetch) | |
427 | (uri | |
428 | (git-reference | |
429 | (url "https://github.com/desktop-app/lib_lottie.git") | |
430 | (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae"))) | |
431 | (file-name | |
432 | (git-file-name "lib-lottie-for-telegram-desktop" version)) | |
433 | (sha256 | |
434 | (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw")))) | |
435 | ("lib-qr-source" | |
436 | ,(origin | |
437 | (method git-fetch) | |
438 | (uri | |
439 | (git-reference | |
440 | (url "https://github.com/desktop-app/lib_qr.git") | |
441 | (commit "92ce41a690a463eb462089a4eb1e51e019308018"))) | |
442 | (file-name | |
443 | (git-file-name "lib-qr-for-telegram-desktop" version)) | |
444 | (sha256 | |
445 | (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj")))) | |
446 | ("lib-rlottie-source" | |
447 | ,(origin | |
448 | (method git-fetch) | |
449 | (uri | |
450 | (git-reference | |
451 | (url "https://github.com/desktop-app/lib_rlottie.git") | |
452 | (commit "0671bf70547381effcf442ec9618e04502a8adbc"))) | |
453 | (file-name | |
454 | (git-file-name "lib-rlottie-for-telegram-desktop" version)) | |
455 | (sha256 | |
456 | (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv")))) | |
457 | ("lib-rpl-source" | |
458 | ,(origin | |
459 | (method git-fetch) | |
460 | (uri | |
461 | (git-reference | |
462 | (url "https://github.com/desktop-app/lib_rpl.git") | |
463 | (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f"))) | |
464 | (file-name | |
465 | (git-file-name "lib-rpl-for-telegram-desktop" version)) | |
466 | (sha256 | |
467 | (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss")))) | |
468 | ("lib-spellcheck-source" | |
469 | ,(origin | |
470 | (method git-fetch) | |
471 | (uri | |
472 | (git-reference | |
473 | (url "https://github.com/desktop-app/lib_spellcheck.git") | |
474 | (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277"))) | |
475 | (file-name | |
476 | (git-file-name "lib-spellcheck-for-telegram-desktop" version)) | |
477 | (sha256 | |
478 | (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7")))) | |
479 | ("lib-storage-source" | |
480 | ,(origin | |
481 | (method git-fetch) | |
482 | (uri | |
483 | (git-reference | |
484 | (url "https://github.com/desktop-app/lib_storage.git") | |
485 | (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936"))) | |
486 | (file-name | |
487 | (git-file-name "lib-storage-for-telegram-desktop" version)) | |
488 | (sha256 | |
489 | (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87")))) | |
490 | ("lib-tl-source" | |
491 | ,(origin | |
492 | (method git-fetch) | |
493 | (uri | |
494 | (git-reference | |
495 | (url "https://github.com/desktop-app/lib_tl.git") | |
496 | (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e"))) | |
497 | (file-name | |
498 | (git-file-name "lib-tl-for-telegram-desktop" version)) | |
499 | (sha256 | |
500 | (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f")))) | |
501 | ("lib-ui-source" | |
502 | ,(origin | |
503 | (method git-fetch) | |
504 | (uri | |
505 | (git-reference | |
506 | (url "https://github.com/desktop-app/lib_ui.git") | |
b7f75432 | 507 | (commit "e14bc4681d69c1b538b8c5af51501077ae5a8a86"))) |
edfbb1d2 RG |
508 | (file-name |
509 | (git-file-name "lib-ui-for-telegram-desktop" version)) | |
510 | (sha256 | |
b7f75432 | 511 | (base32 "04b1x4bswk3bxqrwpv5g7w4frkprrwf0px6aibh6z4drinv08wsv")))) |
edfbb1d2 RG |
512 | ("lib-webrtc-source" |
513 | ,(origin | |
514 | (method git-fetch) | |
515 | (uri | |
516 | (git-reference | |
517 | (url "https://github.com/desktop-app/lib_webrtc.git") | |
b7f75432 | 518 | (commit "60d5c43daf882a6c03944a3e6198b5f35b654a0e"))) |
edfbb1d2 RG |
519 | (file-name |
520 | (git-file-name "lib-webrtc-for-telegram-desktop" version)) | |
521 | (sha256 | |
b7f75432 | 522 | (base32 "0mxmbw8i37axllg9h976p6np2gcfyci6xwwl9hc9mhs49vwwsw5s")))) |
edfbb1d2 RG |
523 | ("libdbusmenu-qt" ,libdbusmenu-qt) |
524 | ("libjpeg" ,libjpeg-turbo) | |
525 | ("libtgvoip" ,libtgvoip-for-telegram-desktop) | |
526 | ("lz4" ,lz4) | |
2a4e1ace | 527 | ("materialdecoration" ,materialdecoration) |
edfbb1d2 RG |
528 | ("minizip" ,minizip) |
529 | ("nimf" ,nimf) | |
530 | ("openal" ,openal) | |
531 | ("openssl" ,openssl) | |
532 | ("opus" ,opus) | |
533 | ("pulseaudio" ,pulseaudio) | |
534 | ("qrcodegen" ,qrcodegen-cpp) | |
535 | ("qt" ,qtbase) | |
536 | ("qt5ct" ,qt5ct) | |
537 | ("qtimageformats" ,qtimageformats) | |
538 | ("qtwayland" ,qtwayland) | |
539 | ("range-v3" ,range-v3) | |
540 | ("rlottie" ,rlottie-for-telegram-desktop) | |
541 | ("tgcalls-source" | |
542 | ,(origin | |
543 | (method git-fetch) | |
544 | (uri | |
545 | (git-reference | |
546 | (url "https://github.com/TelegramMessenger/tgcalls.git") | |
b7f75432 | 547 | (commit "71addf5b41cb6bb6844f75e977edae0020938930"))) |
edfbb1d2 RG |
548 | (file-name |
549 | (git-file-name "tgcalls-for-telegram-desktop" version)) | |
550 | (sha256 | |
b7f75432 | 551 | (base32 "1zrjxf03n3ad8b95gwjarmq4gj5i5cwhlg93qcjv2232kksh29iy")))) |
edfbb1d2 RG |
552 | ("webrtc" ,webrtc-for-telegram-desktop) |
553 | ("x11" ,libx11) | |
554 | ("xcb" ,libxcb) | |
555 | ("xcb-keysyms" ,xcb-util-keysyms) | |
556 | ("xxhash" ,xxhash) | |
557 | ("zlib" ,zlib))) | |
558 | (propagated-inputs | |
559 | `(("dconf" ,dconf))) | |
560 | (synopsis "Telegram Desktop") | |
561 | (description "Telegram desktop is the official desktop version of the | |
562 | Telegram instant messager.") | |
563 | (home-page "https://desktop.telegram.org/") | |
564 | (license | |
565 | (list | |
566 | ;; ThirdParty | |
567 | license:lgpl2.1+ | |
568 | ;; Others | |
569 | license:gpl3+)))) | |
8b4e8933 RG |
570 | |
571 | (define-public tl-parser | |
572 | (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06") | |
573 | (revision "21")) | |
574 | (package | |
575 | (name "tl-parser") | |
576 | (version | |
577 | (git-version "0" revision commit)) | |
578 | (source | |
579 | (origin | |
580 | (method git-fetch) | |
581 | (uri | |
582 | (git-reference | |
583 | (url "https://github.com/vysheng/tl-parser.git") | |
584 | (commit commit))) | |
585 | (file-name | |
586 | (git-file-name name version)) | |
587 | (sha256 | |
588 | (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq")))) | |
589 | (build-system cmake-build-system) | |
590 | (arguments | |
591 | `(#:tests? #f ; No target | |
592 | #:imported-modules | |
593 | ((guix build copy-build-system) | |
594 | ,@%cmake-build-system-modules) | |
595 | #:modules | |
596 | (((guix build copy-build-system) | |
597 | #:prefix copy:) | |
598 | (guix build cmake-build-system) | |
599 | (guix build utils)) | |
600 | #:phases | |
601 | (modify-phases %standard-phases | |
602 | (replace 'install | |
603 | (lambda args | |
604 | (apply (assoc-ref copy:%standard-phases 'install) | |
605 | #:install-plan | |
606 | '(("." "bin" | |
607 | #:include ("tl-parser")) | |
608 | ("../source" "include/tl-parser" | |
609 | #:include-regexp ("\\.h$"))) | |
610 | args)))))) | |
611 | (synopsis "Parse tl scheme to tlo") | |
612 | (description "TL-Parser is a tl scheme to tlo file parser. It was formely | |
613 | a part of telegram-cli, but now being maintained separately.") | |
614 | (home-page "https://github.com/vysheng/tl-parser") | |
615 | (license license:gpl2+)))) | |
d1e7a01c RG |
616 | |
617 | (define-public tgl | |
618 | (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed") | |
619 | (revision "181")) | |
620 | (package | |
621 | (name "tgl") | |
622 | (version | |
623 | (git-version "2.0.1" revision commit)) | |
624 | (source | |
625 | (origin | |
626 | (method git-fetch) | |
627 | (uri | |
628 | (git-reference | |
629 | (url "https://github.com/vysheng/tgl.git") | |
630 | (commit commit))) | |
631 | (file-name | |
632 | (git-file-name name version)) | |
633 | (sha256 | |
634 | (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9")))) | |
635 | (build-system gnu-build-system) | |
636 | (arguments | |
637 | `(#:tests? #f ; No target | |
638 | #:imported-modules | |
639 | ((guix build copy-build-system) | |
640 | ,@%gnu-build-system-modules) | |
641 | #:modules | |
642 | (((guix build copy-build-system) | |
643 | #:prefix copy:) | |
644 | (guix build gnu-build-system) | |
645 | (guix build utils)) | |
646 | #:configure-flags | |
647 | (list | |
648 | ;; Use gcrypt instead of openssl. | |
649 | "--disable-openssl" | |
650 | ;; Enable extended queries system. | |
651 | "--enable-extf" | |
652 | ;; Include libevent-based net and timers. | |
653 | "--enable-libevent") | |
654 | #:phases | |
655 | (modify-phases %standard-phases | |
656 | (add-after 'unpack 'trigger-bootstrap | |
657 | (lambda _ | |
658 | (delete-file "configure") | |
659 | #t)) | |
660 | (add-after 'trigger-bootstrap 'patch-tl-parser | |
661 | (lambda _ | |
662 | (delete-file "Makefile.tl-parser") | |
663 | (substitute* "Makefile.in" | |
664 | (("include \\$\\{srcdir\\}/Makefile\\.tl-parser") | |
665 | "") | |
666 | (("\\$\\{EXE\\}/tl-parser") | |
667 | "tl-parser")) | |
668 | #t)) | |
669 | (replace 'install | |
670 | (lambda args | |
671 | (apply (assoc-ref copy:%standard-phases 'install) | |
672 | #:install-plan | |
673 | '(("bin" "bin") | |
674 | ("." "include/tgl" | |
675 | #:include-regexp ("\\.h$")) | |
676 | ("libs" "lib/tgl")) | |
677 | args)))))) | |
678 | (native-inputs | |
679 | `(("autoconf" ,autoconf) | |
680 | ("automake" ,automake) | |
681 | ("libtool" ,libtool) | |
682 | ("pkg-config" ,pkg-config))) | |
683 | (inputs | |
684 | `(("libevent" ,libevent) | |
685 | ("libgcrypt" ,libgcrypt) | |
686 | ("tl-parser" ,tl-parser) | |
687 | ("zlib" ,zlib))) | |
688 | (synopsis "Telegram Library") | |
689 | (description "TGL is the telegram library for telegram-cli.") | |
690 | (home-page "https://github.com/vysheng/tgl") | |
691 | (license license:lgpl2.1+)))) | |
86f461d6 RG |
692 | |
693 | (define-public telegram-cli | |
694 | (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a") | |
695 | (revision "324")) | |
696 | (package | |
697 | (name "telegram-cli") | |
698 | (version | |
699 | (git-version "1.3.1" revision commit)) | |
700 | (source | |
701 | (origin | |
702 | (method git-fetch) | |
703 | (uri | |
704 | (git-reference | |
705 | (url "https://github.com/vysheng/tg.git") | |
706 | (commit commit))) | |
707 | (file-name | |
708 | (git-file-name name version)) | |
709 | (sha256 | |
710 | (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6")))) | |
711 | (build-system gnu-build-system) | |
712 | (arguments | |
713 | `(#:tests? #f ; No target | |
714 | #:imported-modules | |
715 | ((guix build copy-build-system) | |
716 | ,@%gnu-build-system-modules) | |
717 | #:modules | |
718 | (((guix build copy-build-system) | |
719 | #:prefix copy:) | |
720 | (guix build gnu-build-system) | |
721 | (guix build utils)) | |
722 | #:configure-flags | |
723 | (list | |
724 | ;; Use gcrypt instead of openssl. | |
725 | "--disable-openssl") | |
726 | #:phases | |
727 | (modify-phases %standard-phases | |
728 | (add-after 'unpack 'trigger-bootstrap | |
729 | (lambda _ | |
730 | (delete-file "configure") | |
731 | #t)) | |
732 | (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser | |
733 | (lambda* (#:key inputs #:allow-other-keys) | |
734 | (for-each delete-file | |
735 | (list | |
736 | "Makefile.tgl" | |
737 | "Makefile.tl-parser")) | |
738 | (substitute* "Makefile.in" | |
739 | (("include \\$\\{srcdir\\}/Makefile\\.tl-parser") | |
740 | "") | |
741 | (("include \\$\\{srcdir\\}/Makefile\\.tgl") | |
742 | "") | |
743 | (("-I\\$\\{srcdir\\}/tgl") | |
744 | (string-append "-I" (assoc-ref inputs "tgl") | |
745 | "/include/tgl")) | |
746 | (("AUTO=auto") | |
747 | (string-append "AUTO=" (assoc-ref inputs "tgl") | |
748 | "/include/tgl/auto")) | |
749 | (("LIB=libs") | |
750 | (string-append "LIB=" (assoc-ref inputs "tgl") | |
751 | "/lib/tgl"))) | |
752 | #t)) | |
753 | (replace 'install | |
754 | (lambda args | |
755 | (apply (assoc-ref copy:%standard-phases 'install) | |
756 | #:install-plan | |
757 | '(("bin" "bin") | |
758 | ("." "etc/telegram-cli" | |
759 | #:include-regexp ("\\.pub$") | |
760 | #:exclude ("tg-server.pub"))) | |
761 | args)))))) | |
762 | (native-inputs | |
763 | `(("autoconf" ,autoconf) | |
764 | ("automake" ,automake) | |
765 | ("libtool" ,libtool) | |
766 | ("pkg-config" ,pkg-config))) | |
767 | (inputs | |
768 | `(("jansson" ,jansson) | |
769 | ("libconfig" ,libconfig) | |
770 | ("libevent" ,libevent) | |
771 | ("libgcrypt" ,libgcrypt) | |
772 | ("lua" ,lua) | |
773 | ("openssl" ,openssl) | |
774 | ("perl" ,perl) | |
775 | ("python" ,python) | |
776 | ("readline" ,readline) | |
777 | ("tgl" ,tgl) | |
778 | ("tl-parser" ,tl-parser) | |
779 | ("zlib" ,zlib))) | |
780 | (synopsis "Telegram Messenger CLI") | |
781 | (description "TG is the command-line interface for Telegram Messenger.") | |
782 | (home-page "https://github.com/vysheng/tg") | |
783 | (license license:gpl2+)))) |