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 | |
72 | (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9") | |
73 | (revision "52")) | |
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 | |
89 | (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l")) | |
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) | |
161 | ("pulseaudio" ,pulseaudio))) | |
162 | (synopsis "WebRTC support for Telegram Desktop") | |
163 | (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by | |
164 | Telegram project, for its use in telegram desktop client.") | |
165 | (home-page "https://github.com/desktop-app/tg_owt") | |
166 | (license | |
167 | (list | |
168 | ;; Abseil-CPP | |
169 | license:asl2.0 | |
170 | ;; LibYuv | |
171 | (license:non-copyleft "file:///src/third_party/libyuv/LICENSE") | |
172 | ;; OpenH264 | |
173 | license:bsd-2 | |
174 | ;; PFFFT | |
175 | (license:non-copyleft "file:///src/third_party/pffft/LICENSE") | |
176 | ;; RnNoise | |
177 | license:gpl3 | |
178 | ;; LibSRTP, LibVPx, UsrSCTP and Others | |
179 | license:bsd-3)))))) | |
cda5fb48 RG |
180 | |
181 | (define-public rlottie-for-telegram-desktop | |
182 | (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b") | |
183 | (revision "671")) | |
184 | (hidden-package | |
185 | (package | |
186 | (inherit rlottie) | |
187 | (version | |
188 | (git-version "0.0.1" revision commit)) | |
189 | (source | |
190 | (origin | |
191 | (method git-fetch) | |
192 | (uri | |
193 | (git-reference | |
194 | (url "https://github.com/desktop-app/rlottie.git") | |
195 | (commit commit))) | |
196 | (file-name | |
197 | (git-file-name "rlottie-for-telegram-desktop" version)) | |
198 | (sha256 | |
199 | (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c")))) | |
200 | (arguments | |
201 | `(#:configure-flags | |
202 | (list | |
203 | "-Dlog=true" | |
204 | "-Ddumptree=true" | |
205 | "-Dtest=true") | |
206 | #:phases | |
207 | (modify-phases %standard-phases | |
208 | (add-after 'unpack 'patch-cxx-flags | |
209 | (lambda _ | |
210 | (substitute* "meson.build" | |
211 | (("werror=true") | |
212 | "werror=false")) | |
213 | #t))))))))) | |
27fa4844 RG |
214 | |
215 | (define-public libtgvoip-for-telegram-desktop | |
216 | (let ((commit "37d98e984fd6fa389262307db826d52ab86c8241") | |
217 | (revision "87")) | |
218 | (hidden-package | |
219 | (package | |
220 | (inherit libtgvoip) | |
221 | (version | |
222 | (git-version "2.4.4" revision commit)) | |
223 | (source | |
224 | (origin | |
225 | (method git-fetch) | |
226 | (uri | |
227 | (git-reference | |
228 | (url "https://github.com/telegramdesktop/libtgvoip.git") | |
229 | (commit commit))) | |
230 | (file-name | |
231 | (git-file-name "libtgvoip-for-telegram-desktop" version)) | |
232 | (sha256 | |
233 | (base32 "13dzvyq8p20nlhjihv18aj6y97czk07qdl0k6v81vp6mbwcldg7h")))) | |
234 | (arguments | |
235 | `(#:configure-flags | |
236 | (list | |
237 | "--disable-static" | |
238 | "--disable-dsp" ; FIXME | |
239 | "--enable-audio-callback" | |
240 | "--with-alsa" | |
241 | "--with-pulse") | |
242 | #:phases | |
243 | (modify-phases %standard-phases | |
244 | (add-after 'unpack 'patch-linkers | |
245 | (lambda _ | |
246 | (substitute* "Makefile.am" | |
247 | (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)") | |
248 | "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)")) | |
249 | (substitute* "tgvoip.pc.in" | |
250 | (("libcrypto opus") | |
251 | "libcrypto opus alsa libpulse")) | |
252 | #t))))) | |
253 | (native-inputs | |
254 | `(("autoconf" ,autoconf) | |
255 | ("automake" ,automake) | |
256 | ("libtool" ,libtool) | |
257 | ("pkg-config" ,pkg-config))))))) | |
edfbb1d2 RG |
258 | |
259 | (define-public telegram-desktop | |
260 | (package | |
261 | (name "telegram-desktop") | |
262 | (version "2.5.1") | |
263 | (source | |
264 | (origin | |
265 | (method git-fetch) | |
266 | (uri | |
267 | (git-reference | |
268 | (url "https://github.com/telegramdesktop/tdesktop.git") | |
269 | (commit | |
270 | (string-append "v" version)))) | |
271 | (file-name | |
272 | (git-file-name name version)) | |
273 | (sha256 | |
274 | (base32 "0drirhkr9gnm1g03lcqmvap5ljlk859c29gbsm63hhsgv15dlw0y")) | |
275 | (modules '((guix build utils) | |
276 | (ice-9 ftw) | |
277 | (srfi srfi-1))) | |
278 | (snippet | |
279 | `(begin | |
280 | (let ((keep | |
281 | '( ;; Not available in Guix. | |
282 | "SPMediaKeyTap" "statusnotifieritem" "tgcalls"))) | |
283 | (with-directory-excursion "Telegram/ThirdParty" | |
284 | (for-each delete-file-recursively | |
285 | (lset-difference string=? | |
286 | (scandir ".") | |
287 | (cons* "." ".." keep)))) | |
288 | #t))))) | |
289 | (build-system qt-build-system) | |
290 | (arguments | |
291 | `(#:tests? #f ; No target | |
292 | #:imported-modules | |
293 | (,@%qt-build-system-modules | |
294 | (guix build glib-or-gtk-build-system)) | |
295 | #:modules | |
296 | ((guix build qt-build-system) | |
297 | ((guix build glib-or-gtk-build-system) | |
298 | #:prefix glib-or-gtk:) | |
299 | (guix build utils) | |
300 | (ice-9 match)) | |
301 | #:configure-flags | |
302 | (list | |
303 | ;; Client applications must provide their own API-ID and API-HASH, | |
304 | ;; see also <https://core.telegram.org/api/obtaining_api_id>. | |
305 | ;; In case, that the credentials below fail to work, contact | |
306 | ;; Raghav Gururajan <rg@raghavgururajan.name> | |
307 | "-DTDESKTOP_API_ID=2791056" | |
308 | "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2" | |
309 | ;; Use bundled fonts as fallback. | |
310 | "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF") | |
311 | #:phases | |
312 | (modify-phases %standard-phases | |
313 | (add-after 'unpack 'make-writable | |
314 | (lambda _ | |
315 | (for-each make-file-writable (find-files ".")) | |
316 | #t)) | |
317 | (add-after 'make-writable 'copy-inputs | |
318 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
319 | (for-each | |
320 | (match-lambda | |
321 | ((dst src) | |
322 | (copy-recursively src dst) | |
323 | (for-each make-file-writable (find-files dst)))) | |
324 | `(("cmake" ,(assoc-ref inputs "cmake-helpers")) | |
325 | ("Telegram/codegen" ,(assoc-ref inputs "codegen-source")) | |
326 | ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source")) | |
327 | ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source")) | |
328 | ("Telegram/lib_lottie" | |
329 | ,(assoc-ref inputs "lib-lottie-source")) | |
330 | ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source")) | |
331 | ("Telegram/lib_rlottie" | |
332 | ,(assoc-ref inputs "lib-rlottie-source")) | |
333 | ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source")) | |
334 | ("Telegram/lib_spellcheck" | |
335 | ,(assoc-ref inputs "lib-spellcheck-source")) | |
336 | ("Telegram/lib_storage" | |
337 | ,(assoc-ref inputs "lib-storage-source")) | |
338 | ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source")) | |
339 | ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source")) | |
340 | ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source")) | |
341 | ("Telegram/ThirdParty/tgcalls" | |
342 | ,(assoc-ref inputs "tgcalls-source")))) | |
343 | #t)) | |
344 | (add-before 'configure 'patch-cxx-flags | |
345 | (lambda _ | |
346 | (substitute* "cmake/options_linux.cmake" | |
347 | (("class-memaccess") "all")) | |
348 | #t)) | |
349 | (add-after 'install 'glib-or-gtk-compile-schemas | |
350 | (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas)) | |
351 | (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap | |
352 | (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))))) | |
353 | (native-inputs | |
354 | `(("cmake-helpers" | |
355 | ,(origin | |
356 | (method git-fetch) | |
357 | (uri | |
358 | (git-reference | |
359 | (url "https://github.com/desktop-app/cmake_helpers.git") | |
360 | (commit "a81345a28d407fb5acd5267ec6afa1864f4e8d5b"))) | |
361 | (file-name | |
362 | (git-file-name "cmake-helpers-for-telegram-desktop" version)) | |
363 | (sha256 | |
364 | (base32 "0s5hxip68dmkaspjq6j30wx1r5v4prnrjza79hdbznz6i57a2248")))) | |
365 | ("cmake-shared" ,cmake-shared) | |
366 | ("extra-cmake-modules" ,extra-cmake-modules) | |
367 | ("gcc" ,gcc-9) | |
368 | ("glib:bin" ,glib "bin") | |
369 | ("gobject-introspection" ,gobject-introspection) | |
370 | ("gtk+:bin" ,gtk+ "bin") | |
371 | ("pkg-config" ,pkg-config) | |
372 | ("python" ,python-wrapper) | |
373 | ("qttools" ,qttools))) | |
374 | (inputs | |
375 | `(("alsa" ,alsa-lib) | |
376 | ("c++-gsl" ,c++-gsl) | |
377 | ("catch" ,catch-framework2) | |
378 | ("codegen-source" | |
379 | ,(origin | |
380 | (method git-fetch) | |
381 | (uri | |
382 | (git-reference | |
383 | (url "https://github.com/desktop-app/codegen.git") | |
384 | (commit "127968de8129e8ccfa6ac50721c70415a5a087c3"))) | |
385 | (file-name | |
386 | (git-file-name "codegen" version)) | |
387 | (sha256 | |
388 | (base32 "036hzjrsk134ky62192nra43rsln5kh5gz20q1920s922661zky2")))) | |
389 | ("expected" ,libexpected) | |
390 | ("fcitx-qt5" ,fcitx-qt5) | |
391 | ("fcitx5-qt" ,fcitx5-qt) | |
392 | ("ffmpeg" ,ffmpeg) | |
393 | ("glib" ,glib) | |
394 | ("gtk+" ,gtk+) | |
395 | ("hime" ,hime) | |
396 | ("hunspell" ,hunspell) | |
397 | ("iconv" ,libiconv) | |
398 | ("lib-base-source" | |
399 | ,(origin | |
400 | (method git-fetch) | |
401 | (uri | |
402 | (git-reference | |
403 | (url "https://github.com/desktop-app/lib_base.git") | |
404 | (commit "81df0d0b7842be2b6c88f93dfa136b8efea4c9ad"))) | |
405 | (file-name | |
406 | (git-file-name "lib-base-for-telegram-desktop" version)) | |
407 | (sha256 | |
408 | (base32 "0ikddprjnjvg0ic8jr2886xq0f18syp587q6z2kci9xmdnvjl217")))) | |
409 | ("lib-crl-source" | |
410 | ,(origin | |
411 | (method git-fetch) | |
412 | (uri | |
413 | (git-reference | |
414 | (url "https://github.com/desktop-app/lib_crl.git") | |
415 | (commit "16150bf71d79382738114b913f137ec1a1a7630c"))) | |
416 | (file-name | |
417 | (git-file-name "lib-crl-for-telegram-desktop" version)) | |
418 | (sha256 | |
419 | (base32 "0qhagdr26aqb9w7wnchcmk1j7ln28x3wbkkkm06b8h0mybksbj7q")))) | |
420 | ("lib-lottie-source" | |
421 | ,(origin | |
422 | (method git-fetch) | |
423 | (uri | |
424 | (git-reference | |
425 | (url "https://github.com/desktop-app/lib_lottie.git") | |
426 | (commit "fb40f379d82ffa1fc7506e9a8dddcf48847715ae"))) | |
427 | (file-name | |
428 | (git-file-name "lib-lottie-for-telegram-desktop" version)) | |
429 | (sha256 | |
430 | (base32 "1vq0mqxcrrv7akcqk9cl4mm61zw6dcfmy8adl0pcp49kynm64saw")))) | |
431 | ("lib-qr-source" | |
432 | ,(origin | |
433 | (method git-fetch) | |
434 | (uri | |
435 | (git-reference | |
436 | (url "https://github.com/desktop-app/lib_qr.git") | |
437 | (commit "92ce41a690a463eb462089a4eb1e51e019308018"))) | |
438 | (file-name | |
439 | (git-file-name "lib-qr-for-telegram-desktop" version)) | |
440 | (sha256 | |
441 | (base32 "182939nv7xs9b3bgah3gl5y9hx5r59mabd2jw3z6717vc96qi2pj")))) | |
442 | ("lib-rlottie-source" | |
443 | ,(origin | |
444 | (method git-fetch) | |
445 | (uri | |
446 | (git-reference | |
447 | (url "https://github.com/desktop-app/lib_rlottie.git") | |
448 | (commit "0671bf70547381effcf442ec9618e04502a8adbc"))) | |
449 | (file-name | |
450 | (git-file-name "lib-rlottie-for-telegram-desktop" version)) | |
451 | (sha256 | |
452 | (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv")))) | |
453 | ("lib-rpl-source" | |
454 | ,(origin | |
455 | (method git-fetch) | |
456 | (uri | |
457 | (git-reference | |
458 | (url "https://github.com/desktop-app/lib_rpl.git") | |
459 | (commit "e1b96399d9031c4ef0354631e6bb375029d29d9f"))) | |
460 | (file-name | |
461 | (git-file-name "lib-rpl-for-telegram-desktop" version)) | |
462 | (sha256 | |
463 | (base32 "1wvqazljd2kq1fxlj250jhjrig529499bym9p81dx33kh1l9dgss")))) | |
464 | ("lib-spellcheck-source" | |
465 | ,(origin | |
466 | (method git-fetch) | |
467 | (uri | |
468 | (git-reference | |
469 | (url "https://github.com/desktop-app/lib_spellcheck.git") | |
470 | (commit "1b540b38ed78e9a3cba93e9ba4ce4525ab692277"))) | |
471 | (file-name | |
472 | (git-file-name "lib-spellcheck-for-telegram-desktop" version)) | |
473 | (sha256 | |
474 | (base32 "0a7042h5zrdvgs7v153ral2dh1zj84di5yjcmgcry5k4s1im9di7")))) | |
475 | ("lib-storage-source" | |
476 | ,(origin | |
477 | (method git-fetch) | |
478 | (uri | |
479 | (git-reference | |
480 | (url "https://github.com/desktop-app/lib_storage.git") | |
481 | (commit "cbe51722b73cfa9ff27bd59294b08aa5ee33c936"))) | |
482 | (file-name | |
483 | (git-file-name "lib-storage-for-telegram-desktop" version)) | |
484 | (sha256 | |
485 | (base32 "045l5xsyagyz17gbhmmvl2miss4nb92p0dmza7yfs9pkg9gs0f87")))) | |
486 | ("lib-tl-source" | |
487 | ,(origin | |
488 | (method git-fetch) | |
489 | (uri | |
490 | (git-reference | |
491 | (url "https://github.com/desktop-app/lib_tl.git") | |
492 | (commit "404c83d77e5edb8a39f8e9f56a6340960fe5070e"))) | |
493 | (file-name | |
494 | (git-file-name "lib-tl-for-telegram-desktop" version)) | |
495 | (sha256 | |
496 | (base32 "1k34nkvvcjqw5q81n1qmklid60cvzjk4lmn9qjimk437m6wbii7f")))) | |
497 | ("lib-ui-source" | |
498 | ,(origin | |
499 | (method git-fetch) | |
500 | (uri | |
501 | (git-reference | |
502 | (url "https://github.com/desktop-app/lib_ui.git") | |
503 | (commit "1e2799245cf2720a329ecb5cf5644fded669cce6"))) | |
504 | (file-name | |
505 | (git-file-name "lib-ui-for-telegram-desktop" version)) | |
506 | (sha256 | |
507 | (base32 "0kd4njcvic2700f00qn25vn3b80vsd2flsm3pi2synnldkiy8lcw")))) | |
508 | ("lib-webrtc-source" | |
509 | ,(origin | |
510 | (method git-fetch) | |
511 | (uri | |
512 | (git-reference | |
513 | (url "https://github.com/desktop-app/lib_webrtc.git") | |
514 | (commit "4bc51d6f6d5740159fdb51cb1593e80ce149ed4e"))) | |
515 | (file-name | |
516 | (git-file-name "lib-webrtc-for-telegram-desktop" version)) | |
517 | (sha256 | |
518 | (base32 "06hpyq4qglrj3cb1xg8ghlmzm9ra8f5n6vm7hcy67n2wk8sy4cal")))) | |
519 | ("libdbusmenu-qt" ,libdbusmenu-qt) | |
520 | ("libjpeg" ,libjpeg-turbo) | |
521 | ("libtgvoip" ,libtgvoip-for-telegram-desktop) | |
522 | ("lz4" ,lz4) | |
5da7b2d0 OP |
523 | ;; TODO: Uncomment materialdecoration if build successfully. |
524 | ;; ("materialdecoration" ,materialdecoration) | |
edfbb1d2 RG |
525 | ("minizip" ,minizip) |
526 | ("nimf" ,nimf) | |
527 | ("openal" ,openal) | |
528 | ("openssl" ,openssl) | |
529 | ("opus" ,opus) | |
530 | ("pulseaudio" ,pulseaudio) | |
531 | ("qrcodegen" ,qrcodegen-cpp) | |
532 | ("qt" ,qtbase) | |
533 | ("qt5ct" ,qt5ct) | |
534 | ("qtimageformats" ,qtimageformats) | |
535 | ("qtwayland" ,qtwayland) | |
536 | ("range-v3" ,range-v3) | |
537 | ("rlottie" ,rlottie-for-telegram-desktop) | |
538 | ("tgcalls-source" | |
539 | ,(origin | |
540 | (method git-fetch) | |
541 | (uri | |
542 | (git-reference | |
543 | (url "https://github.com/TelegramMessenger/tgcalls.git") | |
544 | (commit "178983f72312ca8bd422bc73810fd63f1a89bd9d"))) | |
545 | (file-name | |
546 | (git-file-name "tgcalls-for-telegram-desktop" version)) | |
547 | (sha256 | |
548 | (base32 "1xad65c9m6mj6zdj08flafvh8xjkd7xi9r1agcyc64y69lr427d0")))) | |
549 | ("webrtc" ,webrtc-for-telegram-desktop) | |
550 | ("x11" ,libx11) | |
551 | ("xcb" ,libxcb) | |
552 | ("xcb-keysyms" ,xcb-util-keysyms) | |
553 | ("xxhash" ,xxhash) | |
554 | ("zlib" ,zlib))) | |
555 | (propagated-inputs | |
556 | `(("dconf" ,dconf))) | |
557 | (synopsis "Telegram Desktop") | |
558 | (description "Telegram desktop is the official desktop version of the | |
559 | Telegram instant messager.") | |
560 | (home-page "https://desktop.telegram.org/") | |
561 | (license | |
562 | (list | |
563 | ;; ThirdParty | |
564 | license:lgpl2.1+ | |
565 | ;; Others | |
566 | license:gpl3+)))) | |
8b4e8933 RG |
567 | |
568 | (define-public tl-parser | |
569 | (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06") | |
570 | (revision "21")) | |
571 | (package | |
572 | (name "tl-parser") | |
573 | (version | |
574 | (git-version "0" revision commit)) | |
575 | (source | |
576 | (origin | |
577 | (method git-fetch) | |
578 | (uri | |
579 | (git-reference | |
580 | (url "https://github.com/vysheng/tl-parser.git") | |
581 | (commit commit))) | |
582 | (file-name | |
583 | (git-file-name name version)) | |
584 | (sha256 | |
585 | (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq")))) | |
586 | (build-system cmake-build-system) | |
587 | (arguments | |
588 | `(#:tests? #f ; No target | |
589 | #:imported-modules | |
590 | ((guix build copy-build-system) | |
591 | ,@%cmake-build-system-modules) | |
592 | #:modules | |
593 | (((guix build copy-build-system) | |
594 | #:prefix copy:) | |
595 | (guix build cmake-build-system) | |
596 | (guix build utils)) | |
597 | #:phases | |
598 | (modify-phases %standard-phases | |
599 | (replace 'install | |
600 | (lambda args | |
601 | (apply (assoc-ref copy:%standard-phases 'install) | |
602 | #:install-plan | |
603 | '(("." "bin" | |
604 | #:include ("tl-parser")) | |
605 | ("../source" "include/tl-parser" | |
606 | #:include-regexp ("\\.h$"))) | |
607 | args)))))) | |
608 | (synopsis "Parse tl scheme to tlo") | |
609 | (description "TL-Parser is a tl scheme to tlo file parser. It was formely | |
610 | a part of telegram-cli, but now being maintained separately.") | |
611 | (home-page "https://github.com/vysheng/tl-parser") | |
612 | (license license:gpl2+)))) | |
d1e7a01c RG |
613 | |
614 | (define-public tgl | |
615 | (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed") | |
616 | (revision "181")) | |
617 | (package | |
618 | (name "tgl") | |
619 | (version | |
620 | (git-version "2.0.1" revision commit)) | |
621 | (source | |
622 | (origin | |
623 | (method git-fetch) | |
624 | (uri | |
625 | (git-reference | |
626 | (url "https://github.com/vysheng/tgl.git") | |
627 | (commit commit))) | |
628 | (file-name | |
629 | (git-file-name name version)) | |
630 | (sha256 | |
631 | (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9")))) | |
632 | (build-system gnu-build-system) | |
633 | (arguments | |
634 | `(#:tests? #f ; No target | |
635 | #:imported-modules | |
636 | ((guix build copy-build-system) | |
637 | ,@%gnu-build-system-modules) | |
638 | #:modules | |
639 | (((guix build copy-build-system) | |
640 | #:prefix copy:) | |
641 | (guix build gnu-build-system) | |
642 | (guix build utils)) | |
643 | #:configure-flags | |
644 | (list | |
645 | ;; Use gcrypt instead of openssl. | |
646 | "--disable-openssl" | |
647 | ;; Enable extended queries system. | |
648 | "--enable-extf" | |
649 | ;; Include libevent-based net and timers. | |
650 | "--enable-libevent") | |
651 | #:phases | |
652 | (modify-phases %standard-phases | |
653 | (add-after 'unpack 'trigger-bootstrap | |
654 | (lambda _ | |
655 | (delete-file "configure") | |
656 | #t)) | |
657 | (add-after 'trigger-bootstrap 'patch-tl-parser | |
658 | (lambda _ | |
659 | (delete-file "Makefile.tl-parser") | |
660 | (substitute* "Makefile.in" | |
661 | (("include \\$\\{srcdir\\}/Makefile\\.tl-parser") | |
662 | "") | |
663 | (("\\$\\{EXE\\}/tl-parser") | |
664 | "tl-parser")) | |
665 | #t)) | |
666 | (replace 'install | |
667 | (lambda args | |
668 | (apply (assoc-ref copy:%standard-phases 'install) | |
669 | #:install-plan | |
670 | '(("bin" "bin") | |
671 | ("." "include/tgl" | |
672 | #:include-regexp ("\\.h$")) | |
673 | ("libs" "lib/tgl")) | |
674 | args)))))) | |
675 | (native-inputs | |
676 | `(("autoconf" ,autoconf) | |
677 | ("automake" ,automake) | |
678 | ("libtool" ,libtool) | |
679 | ("pkg-config" ,pkg-config))) | |
680 | (inputs | |
681 | `(("libevent" ,libevent) | |
682 | ("libgcrypt" ,libgcrypt) | |
683 | ("tl-parser" ,tl-parser) | |
684 | ("zlib" ,zlib))) | |
685 | (synopsis "Telegram Library") | |
686 | (description "TGL is the telegram library for telegram-cli.") | |
687 | (home-page "https://github.com/vysheng/tgl") | |
688 | (license license:lgpl2.1+)))) | |
86f461d6 RG |
689 | |
690 | (define-public telegram-cli | |
691 | (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a") | |
692 | (revision "324")) | |
693 | (package | |
694 | (name "telegram-cli") | |
695 | (version | |
696 | (git-version "1.3.1" revision commit)) | |
697 | (source | |
698 | (origin | |
699 | (method git-fetch) | |
700 | (uri | |
701 | (git-reference | |
702 | (url "https://github.com/vysheng/tg.git") | |
703 | (commit commit))) | |
704 | (file-name | |
705 | (git-file-name name version)) | |
706 | (sha256 | |
707 | (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6")))) | |
708 | (build-system gnu-build-system) | |
709 | (arguments | |
710 | `(#:tests? #f ; No target | |
711 | #:imported-modules | |
712 | ((guix build copy-build-system) | |
713 | ,@%gnu-build-system-modules) | |
714 | #:modules | |
715 | (((guix build copy-build-system) | |
716 | #:prefix copy:) | |
717 | (guix build gnu-build-system) | |
718 | (guix build utils)) | |
719 | #:configure-flags | |
720 | (list | |
721 | ;; Use gcrypt instead of openssl. | |
722 | "--disable-openssl") | |
723 | #:phases | |
724 | (modify-phases %standard-phases | |
725 | (add-after 'unpack 'trigger-bootstrap | |
726 | (lambda _ | |
727 | (delete-file "configure") | |
728 | #t)) | |
729 | (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser | |
730 | (lambda* (#:key inputs #:allow-other-keys) | |
731 | (for-each delete-file | |
732 | (list | |
733 | "Makefile.tgl" | |
734 | "Makefile.tl-parser")) | |
735 | (substitute* "Makefile.in" | |
736 | (("include \\$\\{srcdir\\}/Makefile\\.tl-parser") | |
737 | "") | |
738 | (("include \\$\\{srcdir\\}/Makefile\\.tgl") | |
739 | "") | |
740 | (("-I\\$\\{srcdir\\}/tgl") | |
741 | (string-append "-I" (assoc-ref inputs "tgl") | |
742 | "/include/tgl")) | |
743 | (("AUTO=auto") | |
744 | (string-append "AUTO=" (assoc-ref inputs "tgl") | |
745 | "/include/tgl/auto")) | |
746 | (("LIB=libs") | |
747 | (string-append "LIB=" (assoc-ref inputs "tgl") | |
748 | "/lib/tgl"))) | |
749 | #t)) | |
750 | (replace 'install | |
751 | (lambda args | |
752 | (apply (assoc-ref copy:%standard-phases 'install) | |
753 | #:install-plan | |
754 | '(("bin" "bin") | |
755 | ("." "etc/telegram-cli" | |
756 | #:include-regexp ("\\.pub$") | |
757 | #:exclude ("tg-server.pub"))) | |
758 | args)))))) | |
759 | (native-inputs | |
760 | `(("autoconf" ,autoconf) | |
761 | ("automake" ,automake) | |
762 | ("libtool" ,libtool) | |
763 | ("pkg-config" ,pkg-config))) | |
764 | (inputs | |
765 | `(("jansson" ,jansson) | |
766 | ("libconfig" ,libconfig) | |
767 | ("libevent" ,libevent) | |
768 | ("libgcrypt" ,libgcrypt) | |
769 | ("lua" ,lua) | |
770 | ("openssl" ,openssl) | |
771 | ("perl" ,perl) | |
772 | ("python" ,python) | |
773 | ("readline" ,readline) | |
774 | ("tgl" ,tgl) | |
775 | ("tl-parser" ,tl-parser) | |
776 | ("zlib" ,zlib))) | |
777 | (synopsis "Telegram Messenger CLI") | |
778 | (description "TG is the command-line interface for Telegram Messenger.") | |
779 | (home-page "https://github.com/vysheng/tg") | |
780 | (license license:gpl2+)))) |