gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / telegram.scm
CommitLineData
a84399ed
RG
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
08abd3e5 3;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
a84399ed
RG
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages telegram)
21 #:use-module (gnu packages)
edfbb1d2 22 #:use-module (gnu packages aidc)
cda5fb48 23 #:use-module (gnu packages animation)
a84399ed 24 #:use-module (gnu packages assembly)
edfbb1d2 25 #:use-module (gnu packages audio)
27fa4844 26 #:use-module (gnu packages autotools)
cda5fb48 27 #:use-module (gnu packages check)
edfbb1d2
RG
28 #:use-module (gnu packages cmake)
29 #:use-module (gnu packages compression)
08abd3e5 30 #:use-module (gnu packages c)
edfbb1d2
RG
31 #:use-module (gnu packages cpp)
32 #:use-module (gnu packages digest)
33 #:use-module (gnu packages fcitx)
34 #:use-module (gnu packages fcitx5)
adc3b7d3
HC
35 #:use-module (gnu packages freedesktop)
36 #:use-module (gnu packages gl)
edfbb1d2
RG
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gnome)
d1e7a01c 39 #:use-module (gnu packages gnupg)
edfbb1d2 40 #:use-module (gnu packages gtk)
a84399ed 41 #:use-module (gnu packages image)
43b9419b 42 #:use-module (gnu packages jemalloc)
edfbb1d2
RG
43 #:use-module (gnu packages kde-frameworks)
44 #:use-module (gnu packages language)
d1e7a01c 45 #:use-module (gnu packages libevent)
edfbb1d2 46 #:use-module (gnu packages libreoffice)
a84399ed 47 #:use-module (gnu packages linux)
08abd3e5 48 #:use-module (gnu packages llvm)
edfbb1d2 49 #:use-module (gnu packages lxqt)
86f461d6
RG
50 #:use-module (gnu packages lua)
51 #:use-module (gnu packages perl)
a84399ed
RG
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages protobuf)
54 #:use-module (gnu packages pulseaudio)
55 #:use-module (gnu packages python)
49d8f954
RG
56 #:use-module (gnu packages python-check)
57 #:use-module (gnu packages python-web)
58 #:use-module (gnu packages python-xyz)
edfbb1d2 59 #:use-module (gnu packages qt)
86f461d6
RG
60 #:use-module (gnu packages readline)
61 #:use-module (gnu packages textutils)
27fa4844 62 #:use-module (gnu packages telephony)
a84399ed
RG
63 #:use-module (gnu packages tls)
64 #:use-module (gnu packages video)
86f461d6 65 #:use-module (gnu packages web)
08abd3e5 66 #:use-module (gnu packages webkit)
adc3b7d3 67 #:use-module (gnu packages xdisorg)
a84399ed 68 #:use-module (gnu packages xiph)
edfbb1d2 69 #:use-module (gnu packages xorg)
a84399ed
RG
70 #:use-module ((guix licenses) #:prefix license:)
71 #:use-module (guix packages)
e76c93a5 72 #:use-module (guix gexp)
a84399ed 73 #:use-module (guix git-download)
cda5fb48 74 #:use-module (guix build-system cmake)
8b4e8933 75 #:use-module (guix build-system copy)
edfbb1d2 76 #:use-module (guix build-system glib-or-gtk)
27fa4844 77 #:use-module (guix build-system gnu)
edfbb1d2 78 #:use-module (guix build-system meson)
49d8f954 79 #:use-module (guix build-system python)
edfbb1d2 80 #:use-module (guix build-system qt))
a84399ed 81
08abd3e5 82(define %telegram-version "4.2.2")
a7164abc 83
e76c93a5
HC
84(define libyuv-for-telegram-desktop
85 (let ((commit "ad890067f661dc747a975bc55ba3767fe30d4452")
86 (revision "2211"))
87 (origin
88 (method git-fetch)
89 (uri (git-reference
90 (url "https://chromium.googlesource.com/libyuv/libyuv")
91 (commit commit)))
92 (file-name (git-file-name
93 "libyuv-for-telegram-desktop"
94 (git-version "0" revision commit)))
95 (sha256
96 (base32
97 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))))
98
a7164abc
HC
99(define cmake-helpers-for-telegram-desktop
100 (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url "https://github.com/desktop-app/cmake_helpers.git")
08abd3e5 104 (commit "f49e254d8c5287752b5ed7b86bd84073f584768e")))
a7164abc
HC
105 (file-name
106 (git-file-name "cmake-helpers-for-telegram-desktop" %telegram-version))
107 (sha256
108 (base32
08abd3e5 109 "0yqib2ndhpaj69z603knpcfga0ni978janb5i8rvhslqddvbzfjv"))))
a7164abc
HC
110
111(define codegen-for-telegram-desktop
112 (origin
113 (method git-fetch)
114 (uri (git-reference
115 (url "https://github.com/desktop-app/codegen.git")
08abd3e5 116 (commit "8815d7aec9b901191d08445f29e2edd0aeba7b2c")))
a7164abc
HC
117 (file-name
118 (git-file-name "codegen-for-telegram-desktop" %telegram-version))
119 (sha256
120 (base32
08abd3e5 121 "1ly958mjk25kfcpa174kvg134p9r751ixi275afj5kr57by9mbq2"))))
a7164abc
HC
122
123(define lib-base-for-telegram-desktop
124 (origin
125 (method git-fetch)
126 (uri (git-reference
127 (url "https://github.com/desktop-app/lib_base.git")
08abd3e5 128 (commit "d932f5048317b05dd414116741d995c82a528542")))
a7164abc
HC
129 (file-name
130 (git-file-name "lib-base-for-telegram-desktop" %telegram-version))
131 (sha256
132 (base32
08abd3e5 133 "1fnirqxj4qq1gzx52rydrc5r6clw3316bh51dfg652jr8hj6wkp2"))))
a7164abc
HC
134
135(define lib-crl-for-telegram-desktop
136 (origin
137 (method git-fetch)
138 (uri (git-reference
139 (url "https://github.com/desktop-app/lib_crl.git")
08abd3e5 140 (commit "4e620bc383d032aadea8e6af02661f8c76695cec")))
a7164abc
HC
141 (file-name
142 (git-file-name "lib-crl-for-telegram-desktop" %telegram-version))
143 (sha256
144 (base32
08abd3e5 145 "17bngj247qwq0dg4h37xdi5v1mk22y4yp7sp6ph3irmnz4awah0x"))))
a7164abc
HC
146
147(define lib-lottie-for-telegram-desktop
148 (origin
149 (method git-fetch)
150 (uri (git-reference
151 (url "https://github.com/desktop-app/lib_lottie.git")
08abd3e5 152 (commit "6ed1c22ed60692d2f288c9222fafd7d5cd62f904")))
a7164abc
HC
153 (file-name
154 (git-file-name "lib-lottie-for-telegram-desktop" %telegram-version))
155 (sha256
156 (base32
08abd3e5 157 "0l57ibfij9xm4ww4s9cc63q1x8xzpc6ablwaji1krrn3xxksqdd4"))))
a7164abc
HC
158
159(define lib-qr-for-telegram-desktop
160 (origin
161 (method git-fetch)
162 (uri (git-reference
163 (url "https://github.com/desktop-app/lib_qr.git")
08abd3e5 164 (commit "501f4c3502fd872ab4d777df8911bdac32de7c48")))
a7164abc
HC
165 (file-name
166 (git-file-name "lib-qr-for-telegram-desktop" %telegram-version))
167 (sha256
168 (base32
08abd3e5 169 "0hmwqj7a9vcy8wq7pd1qprl68im3zl5f1wzcn2zzk2wvi0389k9f"))))
a7164abc 170
a7164abc
HC
171(define lib-rpl-for-telegram-desktop
172 (origin
173 (method git-fetch)
174 (uri (git-reference
175 (url "https://github.com/desktop-app/lib_rpl.git")
08abd3e5 176 (commit "fd31f5bf382d2679eccdb1abaf8240a56c6a7abe")))
a7164abc
HC
177 (file-name
178 (git-file-name "lib-rpl-for-telegram-desktop" %telegram-version))
179 (sha256
180 (base32
08abd3e5 181 "1fpq8nyh8wx6zkb3sjjrx9ydqzyhw4483bdk1i9blp0ijn9xxdxf"))))
a7164abc
HC
182
183(define lib-spellcheck-for-telegram-desktop
184 (origin
185 (method git-fetch)
186 (uri (git-reference
187 (url "https://github.com/desktop-app/lib_spellcheck.git")
08abd3e5 188 (commit "0e386e22cb6ba8a114b569840a635e096dcb645e")))
a7164abc
HC
189 (file-name
190 (git-file-name "lib-spellcheck-for-telegram-desktop" %telegram-version))
191 (sha256
192 (base32
08abd3e5 193 "06js7ccv6z3nbd4v2p4hp2prrlmz5ww46y3yb922pp7gm317dwyw"))))
a7164abc
HC
194
195(define lib-storage-for-telegram-desktop
196 (origin
197 (method git-fetch)
198 (uri (git-reference
199 (url "https://github.com/desktop-app/lib_storage.git")
08abd3e5 200 (commit "839609369d04615475cb1518636de3619106a917")))
a7164abc
HC
201 (file-name
202 (git-file-name "lib-storage-for-telegram-desktop" %telegram-version))
203 (sha256
204 (base32
08abd3e5 205 "1l26h2fmqp9dcpr6pfvdd5sjb68j7yh0ms2lnr8na7jf5xqmkwwm"))))
a7164abc
HC
206
207(define lib-tl-for-telegram-desktop
208 (origin
209 (method git-fetch)
210 (uri (git-reference
211 (url "https://github.com/desktop-app/lib_tl.git")
08abd3e5 212 (commit "36fb95c4de1339d2c8921ad6b2911858c3d0e0fa")))
a7164abc
HC
213 (file-name
214 (git-file-name "lib-tl-for-telegram-desktop" %telegram-version))
215 (sha256
216 (base32
08abd3e5 217 "03rngnssnqwr7ad05qn64mwgji5fb0r3fp5ybkf951p8phr1jvzk"))))
a7164abc
HC
218
219(define lib-ui-for-telegram-desktop
220 (origin
221 (method git-fetch)
222 (uri (git-reference
223 (url "https://github.com/desktop-app/lib_ui.git")
08abd3e5 224 (commit "1ceaa0bbcfccb83dbf7f51d7f80a733ff2aa8c22")))
a7164abc
HC
225 (file-name
226 (git-file-name "lib-ui-for-telegram-desktop" %telegram-version))
227 (sha256
228 (base32
08abd3e5 229 "0kyrgxi202xwy14mnx62h1kny0434f5fxqns1ydp24q2c2cr1cxn"))))
a7164abc 230
a7164abc
HC
231(define lib-webrtc-for-telegram-desktop
232 (origin
233 (method git-fetch)
234 (uri (git-reference
235 (url "https://github.com/desktop-app/lib_webrtc.git")
08abd3e5 236 (commit "9b11599c3c56047cfa4c68b69f1fcc93b602c33a")))
a7164abc
HC
237 (file-name
238 (git-file-name "lib-webrtc-for-telegram-desktop" %telegram-version))
239 (sha256
240 (base32
08abd3e5 241 "0158jx8hj4fv6qpw5pgcr2mdlihj0dxs060dg3iy61zz6q68z5dq"))))
a7164abc
HC
242
243(define lib-webview-for-telegram-desktop
244 (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url "https://github.com/desktop-app/lib_webview.git")
08abd3e5 248 (commit "546df65eb2424550ed84ce14fc9c5d1bb3586f35")))
a7164abc
HC
249 (file-name
250 (git-file-name "lib-webview-for-telegram-desktop" %telegram-version))
251 (sha256
252 (base32
08abd3e5 253 "0zzjwyw82bggncmmsw969lnjl04pklmqjqm77jjzadinivl52z0l"))))
a7164abc
HC
254
255(define tgcalls-for-telegram-desktop
256 (origin
257 (method git-fetch)
258 (uri (git-reference
259 (url "https://github.com/TelegramMessenger/tgcalls.git")
08abd3e5 260 (commit "82c4921045c440b727c38e464f3a0539708423ff")))
a7164abc
HC
261 (file-name
262 (git-file-name "tgcalls-for-telegram-desktop" %telegram-version))
263 (sha256
264 (base32
08abd3e5 265 "1109r17abh66yz91b65fn2g4ryfybnsr5g6075sjhbah1gccv9mk"))))
a7164abc 266
a84399ed 267(define-public webrtc-for-telegram-desktop
adc3b7d3
HC
268 (let ((commit "621f3da55331733bf0d1b223786b96b68c03dca1")
269 (revision "327"))
a84399ed
RG
270 (hidden-package
271 (package
272 (name "webrtc-for-telegram-desktop")
273 (version
274 (git-version "0" revision commit))
275 (source
276 (origin
277 (method git-fetch)
278 (uri
279 (git-reference
280 (url "https://github.com/desktop-app/tg_owt.git")
281 (commit commit)))
282 (file-name
283 (git-file-name name version))
284 (sha256
adc3b7d3
HC
285 (base32 "1ks1572k1jj7pmzwm79p2gdgi31dd4bs761bphnx32zyq4c6skxk"))
286 (patches
287 (search-patches
288 ;; https://github.com/desktop-app/tg_owt/pull/101
289 "webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch"))
a84399ed
RG
290 (modules '((guix build utils)
291 (ice-9 ftw)
292 (srfi srfi-1)))
293 (snippet
e76c93a5
HC
294 #~(begin
295 (let ((keep
adc3b7d3 296 '("abseil-cpp" "libsrtp" "rnnoise"
e76c93a5 297 ;; Not available in Guix.
adc3b7d3 298 "pffft")))
e76c93a5
HC
299 (with-directory-excursion "src/third_party"
300 (for-each delete-file-recursively
301 (lset-difference string=?
302 (scandir ".")
adc3b7d3
HC
303 (cons* "." ".." keep)))))
304 ;; Unbundle openh264.
305 (substitute* "CMakeLists.txt"
306 (("\\include\\(cmake\\/libopenh264\\.cmake\\)")""))))))
a84399ed
RG
307 (build-system cmake-build-system)
308 (arguments
e76c93a5
HC
309 (list
310 #:tests? #f ; No target
e76c93a5
HC
311 #:phases
312 #~(modify-phases %standard-phases
adc3b7d3 313 (add-after 'unpack 'unpack-additional-sources
e76c93a5
HC
314 (lambda _
315 (let* ((third-party (string-append (getcwd) "/src/third_party"))
adc3b7d3 316 (crc32c-to (string-append third-party "/crc32c/src"))
e76c93a5 317 (libyuv-to (string-append third-party "/libyuv")))
adc3b7d3 318 (copy-recursively #$(package-source crc32c) crc32c-to)
e76c93a5
HC
319 (copy-recursively #$libyuv-for-telegram-desktop
320 libyuv-to)))))))
adc3b7d3 321 (native-inputs (list pkg-config python-wrapper yasm))
a84399ed 322 (inputs
adc3b7d3 323 (list abseil-cpp-cxxstd17
e76c93a5 324 ffmpeg
e76c93a5 325 glib
adc3b7d3
HC
326 libdrm
327 libglvnd
4531a6c3 328 libjpeg-turbo
adc3b7d3 329 libvpx
e76c93a5
HC
330 libxcomposite
331 libxdamage
4531a6c3 332 libxext
adc3b7d3 333 libxfixes
4531a6c3
HC
334 libxrandr
335 libxrender
336 libxtst
adc3b7d3
HC
337 mesa
338 openh264
e76c93a5
HC
339 openssl
340 opus
adc3b7d3 341 pipewire-0.3
4531a6c3 342 protobuf))
a84399ed
RG
343 (synopsis "WebRTC support for Telegram Desktop")
344 (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
345Telegram project, for its use in telegram desktop client.")
346 (home-page "https://github.com/desktop-app/tg_owt")
347 (license
348 (list
349 ;; Abseil-CPP
350 license:asl2.0
351 ;; LibYuv
352 (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
a84399ed
RG
353 ;; PFFFT
354 (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
355 ;; RnNoise
356 license:gpl3
adc3b7d3 357 ;; LibSRTP, Crc32c and Others
a84399ed 358 license:bsd-3))))))
cda5fb48
RG
359
360(define-public rlottie-for-telegram-desktop
08abd3e5
HC
361 (let ((commit "8c69fc20cf2e150db304311f1233a4b55a8892d7")
362 (revision "678"))
cda5fb48
RG
363 (hidden-package
364 (package
365 (inherit rlottie)
366 (version
367 (git-version "0.0.1" revision commit))
368 (source
369 (origin
370 (method git-fetch)
371 (uri
372 (git-reference
373 (url "https://github.com/desktop-app/rlottie.git")
374 (commit commit)))
375 (file-name
376 (git-file-name "rlottie-for-telegram-desktop" version))
377 (sha256
08abd3e5
HC
378 (base32 "14gwg3sn6xdx9ymnx5r0vfm4pk8dwk92s10a1wdvfbjpyrxll64i"))
379 (modules '((guix build utils)))
380 (snippet
381 #~(begin
382 (substitute* "meson.build"
383 (("werror=true") "werror=false"))))))))))
27fa4844 384
edfbb1d2
RG
385(define-public telegram-desktop
386 (package
387 (name "telegram-desktop")
a7164abc 388 (version %telegram-version)
edfbb1d2
RG
389 (source
390 (origin
391 (method git-fetch)
392 (uri
393 (git-reference
394 (url "https://github.com/telegramdesktop/tdesktop.git")
395 (commit
396 (string-append "v" version))))
397 (file-name
398 (git-file-name name version))
399 (sha256
08abd3e5
HC
400 (base32 "16mcx4gwkl8s70a8gppxczmjsww1a3vmdrz3snfh986nvid64mq7"))
401 (patches
402 (search-patches
403 ;; https://github.com/telegramdesktop/tdesktop/pull/24126
404 "telegram-desktop-allow-disable-libtgvoip.patch"))
edfbb1d2
RG
405 (modules '((guix build utils)
406 (ice-9 ftw)
407 (srfi srfi-1)))
408 (snippet
a7164abc
HC
409 #~(begin
410 (let ((keep
08abd3e5
HC
411 '(;; Not available in Guix.
412 "tgcalls")))
a7164abc
HC
413 (with-directory-excursion "Telegram/ThirdParty"
414 (for-each delete-file-recursively
415 (lset-difference string=?
416 (scandir ".")
417 (cons* "." ".." keep)))))))))
edfbb1d2
RG
418 (build-system qt-build-system)
419 (arguments
a7164abc
HC
420 (list #:tests? #f ; No target
421 #:imported-modules
422 `(,@%qt-build-system-modules
423 (guix build glib-or-gtk-build-system))
424 #:modules
425 '((guix build qt-build-system)
426 ((guix build glib-or-gtk-build-system)
427 #:prefix glib-or-gtk:)
428 (guix build utils)
429 (ice-9 match))
430 #:configure-flags
431 #~(list
432 ;; Client applications must provide their own API-ID and API-HASH,
433 ;; see also <https://core.telegram.org/api/obtaining_api_id>.
34440547
HC
434 ;; Here, we snarf the keys from the official Snaps, which are
435 ;; also stored in <#$source/snap/snapcraft.yaml>.
436 "-DTDESKTOP_API_ID=611335"
437 "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
08abd3e5
HC
438 "-DTDESKTOP_DISABLE_LEGACY_TGVOIP=ON"
439 "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
440 "-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON"
441 "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON")
a7164abc
HC
442 #:phases
443 #~(modify-phases %standard-phases
08abd3e5 444 (add-after 'unpack 'unpack-additional-sources
a7164abc 445 (lambda _
08abd3e5 446 (for-each make-file-writable (find-files "."))
a7164abc
HC
447 (for-each
448 (match-lambda
449 ((dst src)
450 (copy-recursively src dst)
451 (for-each make-file-writable (find-files dst))))
452 '(("cmake" #$cmake-helpers-for-telegram-desktop)
453 ("Telegram/codegen" #$codegen-for-telegram-desktop)
454 ("Telegram/lib_base" #$lib-base-for-telegram-desktop)
455 ("Telegram/lib_crl" #$lib-crl-for-telegram-desktop)
456 ("Telegram/lib_lottie" #$lib-lottie-for-telegram-desktop)
457 ("Telegram/lib_qr" #$lib-qr-for-telegram-desktop)
a7164abc
HC
458 ("Telegram/lib_rpl" #$lib-rpl-for-telegram-desktop)
459 ("Telegram/lib_spellcheck" #$lib-spellcheck-for-telegram-desktop)
460 ("Telegram/lib_storage" #$lib-storage-for-telegram-desktop)
461 ("Telegram/lib_tl" #$lib-tl-for-telegram-desktop)
462 ("Telegram/lib_ui" #$lib-ui-for-telegram-desktop)
a7164abc
HC
463 ("Telegram/lib_webrtc" #$lib-webrtc-for-telegram-desktop)
464 ("Telegram/lib_webview" #$lib-webview-for-telegram-desktop)
465 ("Telegram/ThirdParty/tgcalls" #$tgcalls-for-telegram-desktop)))))
a7164abc
HC
466 (add-after 'install 'glib-or-gtk-compile-schemas
467 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
468 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
469 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
edfbb1d2 470 (native-inputs
08abd3e5 471 (list `(,glib "bin")
a7164abc
HC
472 `(,gtk+ "bin")
473 pkg-config
08abd3e5 474 python-wrapper))
edfbb1d2 475 (inputs
b906aa6a
HC
476 (list abseil-cpp-cxxstd17
477 alsa-lib
a7164abc 478 c++-gsl
a7164abc
HC
479 fcitx-qt5
480 fcitx5-qt
481 ffmpeg
482 glib
483 glibmm-2.64
484 gtk+
485 hime
486 hunspell
487 jemalloc
08abd3e5
HC
488 kcoreaddons
489 libdispatch
b906aa6a 490 libexpected
a7164abc 491 libjpeg-turbo
08abd3e5 492 libvpx
b906aa6a 493 libxcb
a7164abc 494 lz4
a7164abc
HC
495 minizip
496 nimf
497 openal
498 openssl
499 opus
500 pulseaudio
501 qrcodegen-cpp
502 qtbase-5
a7164abc 503 qtimageformats
b906aa6a 504 qtsvg-5
034f68ba 505 qtwayland-5
a7164abc
HC
506 range-v3
507 rlottie-for-telegram-desktop
508 rnnoise
08abd3e5
HC
509 wayland
510 webkitgtk
a7164abc 511 webrtc-for-telegram-desktop
a7164abc
HC
512 xcb-util-keysyms
513 xxhash
514 zlib))
edfbb1d2
RG
515 (synopsis "Telegram Desktop")
516 (description "Telegram desktop is the official desktop version of the
46fdee4f 517Telegram instant messenger.")
edfbb1d2
RG
518 (home-page "https://desktop.telegram.org/")
519 (license
520 (list
521 ;; ThirdParty
08abd3e5 522 license:lgpl3
edfbb1d2
RG
523 ;; Others
524 license:gpl3+))))
8b4e8933
RG
525
526(define-public tl-parser
527 (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
528 (revision "21"))
529 (package
530 (name "tl-parser")
531 (version
532 (git-version "0" revision commit))
533 (source
534 (origin
535 (method git-fetch)
536 (uri
537 (git-reference
538 (url "https://github.com/vysheng/tl-parser.git")
539 (commit commit)))
540 (file-name
541 (git-file-name name version))
542 (sha256
543 (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
544 (build-system cmake-build-system)
545 (arguments
546 `(#:tests? #f ; No target
547 #:imported-modules
548 ((guix build copy-build-system)
549 ,@%cmake-build-system-modules)
550 #:modules
551 (((guix build copy-build-system)
552 #:prefix copy:)
553 (guix build cmake-build-system)
554 (guix build utils))
555 #:phases
556 (modify-phases %standard-phases
557 (replace 'install
558 (lambda args
559 (apply (assoc-ref copy:%standard-phases 'install)
560 #:install-plan
561 '(("." "bin"
562 #:include ("tl-parser"))
563 ("../source" "include/tl-parser"
564 #:include-regexp ("\\.h$")))
565 args))))))
566 (synopsis "Parse tl scheme to tlo")
eb975174
TGR
567 (description "TL-Parser is a tl scheme to tlo file parser. It was
568formerly a part of telegram-cli, but now being maintained separately.")
8b4e8933
RG
569 (home-page "https://github.com/vysheng/tl-parser")
570 (license license:gpl2+))))
d1e7a01c
RG
571
572(define-public tgl
573 (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed")
574 (revision "181"))
575 (package
576 (name "tgl")
577 (version
578 (git-version "2.0.1" revision commit))
579 (source
580 (origin
581 (method git-fetch)
582 (uri
583 (git-reference
584 (url "https://github.com/vysheng/tgl.git")
585 (commit commit)))
586 (file-name
587 (git-file-name name version))
588 (sha256
589 (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
590 (build-system gnu-build-system)
591 (arguments
592 `(#:tests? #f ; No target
593 #:imported-modules
594 ((guix build copy-build-system)
595 ,@%gnu-build-system-modules)
596 #:modules
597 (((guix build copy-build-system)
598 #:prefix copy:)
599 (guix build gnu-build-system)
600 (guix build utils))
601 #:configure-flags
602 (list
603 ;; Use gcrypt instead of openssl.
604 "--disable-openssl"
605 ;; Enable extended queries system.
606 "--enable-extf"
607 ;; Include libevent-based net and timers.
608 "--enable-libevent")
609 #:phases
610 (modify-phases %standard-phases
611 (add-after 'unpack 'trigger-bootstrap
612 (lambda _
613 (delete-file "configure")
614 #t))
615 (add-after 'trigger-bootstrap 'patch-tl-parser
616 (lambda _
617 (delete-file "Makefile.tl-parser")
618 (substitute* "Makefile.in"
619 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
620 "")
621 (("\\$\\{EXE\\}/tl-parser")
622 "tl-parser"))
623 #t))
624 (replace 'install
625 (lambda args
626 (apply (assoc-ref copy:%standard-phases 'install)
627 #:install-plan
628 '(("bin" "bin")
629 ("." "include/tgl"
630 #:include-regexp ("\\.h$"))
631 ("libs" "lib/tgl"))
632 args))))))
633 (native-inputs
8394619b 634 (list autoconf automake libtool pkg-config))
d1e7a01c 635 (inputs
8394619b 636 (list libevent libgcrypt tl-parser zlib))
d1e7a01c
RG
637 (synopsis "Telegram Library")
638 (description "TGL is the telegram library for telegram-cli.")
639 (home-page "https://github.com/vysheng/tgl")
640 (license license:lgpl2.1+))))
86f461d6
RG
641
642(define-public telegram-cli
643 (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a")
644 (revision "324"))
645 (package
646 (name "telegram-cli")
647 (version
648 (git-version "1.3.1" revision commit))
649 (source
650 (origin
651 (method git-fetch)
652 (uri
653 (git-reference
654 (url "https://github.com/vysheng/tg.git")
655 (commit commit)))
656 (file-name
657 (git-file-name name version))
658 (sha256
659 (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
660 (build-system gnu-build-system)
661 (arguments
662 `(#:tests? #f ; No target
663 #:imported-modules
664 ((guix build copy-build-system)
665 ,@%gnu-build-system-modules)
666 #:modules
667 (((guix build copy-build-system)
668 #:prefix copy:)
669 (guix build gnu-build-system)
670 (guix build utils))
671 #:configure-flags
672 (list
673 ;; Use gcrypt instead of openssl.
674 "--disable-openssl")
675 #:phases
676 (modify-phases %standard-phases
677 (add-after 'unpack 'trigger-bootstrap
678 (lambda _
679 (delete-file "configure")
680 #t))
681 (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
682 (lambda* (#:key inputs #:allow-other-keys)
683 (for-each delete-file
684 (list
685 "Makefile.tgl"
686 "Makefile.tl-parser"))
687 (substitute* "Makefile.in"
688 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
689 "")
690 (("include \\$\\{srcdir\\}/Makefile\\.tgl")
691 "")
692 (("-I\\$\\{srcdir\\}/tgl")
693 (string-append "-I" (assoc-ref inputs "tgl")
694 "/include/tgl"))
695 (("AUTO=auto")
696 (string-append "AUTO=" (assoc-ref inputs "tgl")
697 "/include/tgl/auto"))
698 (("LIB=libs")
699 (string-append "LIB=" (assoc-ref inputs "tgl")
700 "/lib/tgl")))
701 #t))
702 (replace 'install
703 (lambda args
704 (apply (assoc-ref copy:%standard-phases 'install)
705 #:install-plan
706 '(("bin" "bin")
707 ("." "etc/telegram-cli"
708 #:include-regexp ("\\.pub$")
709 #:exclude ("tg-server.pub")))
710 args))))))
711 (native-inputs
8394619b 712 (list autoconf automake libtool pkg-config))
86f461d6 713 (inputs
8394619b
LC
714 (list jansson
715 libconfig
716 libevent
717 libgcrypt
718 lua
719 openssl
720 perl
721 python
722 readline
723 tgl
724 tl-parser
725 zlib))
86f461d6
RG
726 (synopsis "Telegram Messenger CLI")
727 (description "TG is the command-line interface for Telegram Messenger.")
728 (home-page "https://github.com/vysheng/tg")
729 (license license:gpl2+))))
49d8f954
RG
730
731(define-public tgcli
732 (package
733 (name "tgcli")
734 (version "0.3.1")
735 (source
736 (origin
737 (method git-fetch)
738 (uri
739 (git-reference
740 (url "https://github.com/erayerdin/tgcli")
741 (commit (string-append "v" version))))
742 (file-name
743 (git-file-name name version))
744 (sha256
745 (base32 "082zim7rh4r8qyscqimjh2sz7998vv9j1i2y2wwz2rgrlhkhly5r"))))
746 (build-system python-build-system)
747 (arguments
748 `(#:phases
749 (modify-phases %standard-phases
750 ;; Test requirements referes to specific versions of packages,
751 ;; which are too old. So we patch them to refer to any later versions.
752 (add-after 'unpack 'patch-test-requirements
753 (lambda _
754 (substitute* "dev.requirements.txt"
755 (("==") ">="))))
756 (replace 'check
757 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
758 (when tests?
759 (add-installed-pythonpath inputs outputs)
760 (invoke "pytest" "tests")))))))
761 (native-inputs
762 `(("coveralls" ,python-coveralls)
763 ("pytest" ,python-pytest)
764 ("pytest-click" ,python-pytest-click)
765 ("pytest-cov" ,python-pytest-cov)
766 ("mkdocs" ,python-mkdocs)
767 ("mkdocs-material" ,python-mkdocs-material)
768 ("requests-mock" ,python-requests-mock)))
769 (propagated-inputs
770 `(("click" ,python-click)
771 ("colorful" ,python-colorful)
772 ("requests" ,python-requests)
773 ("yaspin" ,python-yaspin)))
774 (home-page "https://tgcli.readthedocs.io")
775 (synopsis "Telegram Terminal Application")
776 (description "TgCli is a telegram client to automate repetitive tasks.")
777 (license license:asl2.0)))