;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2022 Hilton Chain ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages telegram) #:use-module (gnu packages) #:use-module (gnu packages aidc) #:use-module (gnu packages animation) #:use-module (gnu packages assembly) #:use-module (gnu packages audio) #:use-module (gnu packages autotools) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) #:use-module (gnu packages digest) #:use-module (gnu packages enchant) #:use-module (gnu packages fcitx) #:use-module (gnu packages fcitx5) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) #:use-module (gnu packages gtk) #:use-module (gnu packages image) #:use-module (gnu packages jemalloc) #:use-module (gnu packages kde-frameworks) #:use-module (gnu packages language) #:use-module (gnu packages libevent) #:use-module (gnu packages libreoffice) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages lxqt) #:use-module (gnu packages lua) #:use-module (gnu packages ninja) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) #:use-module (gnu packages python-check) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages readline) #:use-module (gnu packages textutils) #:use-module (gnu packages telephony) #:use-module (gnu packages tls) #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages webkit) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xiph) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system python) #:use-module (guix build-system qt)) (define-public abseil-cpp-for-webrtc-for-telegram-desktop (let ((base abseil-cpp)) ;; This package fixs a linking issue of Telegram Desktop. ;; Remove once abseil-cpp had required C++17 as minimun. (hidden-package (package/inherit base (arguments (substitute-keyword-arguments (package-arguments base) ((#:configure-flags flags) `(cons* "-DCMAKE_CXX_STANDARD=17" ,flags)))))))) ;; NOTE: Here's Telegram Desktop's official build guide. ;; https://github.com/telegramdesktop/tdesktop/wiki/The-Packaged-Building-Mode (define-public webrtc-for-telegram-desktop (let ((abseil-cpp abseil-cpp-for-webrtc-for-telegram-desktop) (commit "a5fbc9123e056e611e69acf0ceb4252ddd838adb") (revision "167")) (hidden-package (package (name "webrtc-for-telegram-desktop") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/tg_owt") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "12qirihhabv46vn27dpw7dz0smlngb7wqjpypa9fm6k2zvf5py32")) (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1))) (patches (search-patches ;; https://github.com/desktop-app/tg_owt/pull/101 "webrtc-for-telegram-desktop-add-missing-cstdint.patch" ;; Picked from Gentoo's repository. ;; TODO: There's also a patch for using standalone crc32c, we can ;; grab that patch once crc32c's been packaged. "webrtc-for-telegram-desktop-allow-disabling-X11.patch")) (snippet `(begin (let ((keep '(;; Custom forks which are incompatible with the ones in Guix. "abseil-cpp" "libsrtp" "rnnoise" ;; Not available in Guix. "pffft"))) (with-directory-excursion "src/third_party" (for-each delete-file-recursively (lset-difference string=? (scandir ".") (cons* "." ".." keep))))) ;; Force using standalone openh264. (substitute* "CMakeLists.txt" (("\\include\\(cmake\\/libopenh264\\.cmake\\)")"")))))) (build-system cmake-build-system) (arguments (list #:tests? #f ; No target ;; NOTE: Options commented are default values. ;; See also: comments in inputs. ;; #:configure-flags ;; #~'("-DTG_OWT_USE_PIPEWIRE=ON" ;; "-DTG_OWT_USE_X11=ON" ;; "-DTG_OWT_USE_PROTOBUF=ON") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'copy-inputs (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((libyuv-from (assoc-ref inputs "libyuv")) (crc32c-from (assoc-ref inputs "crc32c")) (libyuv-to (string-append (getcwd) "/src/third_party/libyuv")) (crc32c-to (string-append (getcwd) "/src/third_party/crc32c/src"))) (copy-recursively libyuv-from libyuv-to) (copy-recursively crc32c-from crc32c-to)))) (replace 'build (lambda* (#:key (make-flags '()) (parallel-build? #t) #:allow-other-keys) (apply invoke "cmake" "--build" "." `(,@(if parallel-build? `("-j" ,(number->string (parallel-job-count))) '()) ,@make-flags)))) (replace 'install (lambda* (#:key (make-flags '()) #:allow-other-keys) (apply invoke "cmake" "--install" "." make-flags)))))) (inputs (let ((external-sources `(("libyuv" ,(origin (method git-fetch) (uri (git-reference (url "https://chromium.googlesource.com/libyuv/libyuv") (commit "ad890067f661dc747a975bc55ba3767fe30d4452"))) (file-name (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version)) (sha256 (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))) ("crc32c" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/google/crc32c") (commit "21fc8ef30415a635e7351ffa0e5d5367943d4a94"))) (file-name (git-file-name "crc32c-for-webrtc-for-telegram-desktop" version)) (sha256 (base32 "0cddf8z7v33gfb2k60lkzwa97g20m1v81cnvllm3q9ylpnx8g6f4"))))))) (modify-inputs external-sources (prepend openh264 ;Required protobuf ;TG_OWT_USE_PROTOBUF glib ;TG_OWT_USE_PIPEWIRE libdrm libglvnd mesa pipewire-0.3 libxcomposite ;TG_OWT_USE_X11 libxdamage libxext libxfixes libxrandr libxrender libxtst)))) (native-inputs (list ninja python-wrapper pkg-config yasm)) (propagated-inputs (list abseil-cpp ffmpeg libjpeg-turbo libvpx openssl opus)) (synopsis "WebRTC support for Telegram Desktop") (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by Telegram project, for its use in telegram desktop client.") (home-page "https://github.com/desktop-app/tg_owt") (license (list ;; Abseil-CPP license:asl2.0 ;; LibYuv (license:non-copyleft "file:///src/third_party/libyuv/LICENSE") ;; PFFFT (license:non-copyleft "file:///src/third_party/pffft/LICENSE") ;; RnNoise license:gpl3 ;; LibSRTP, Crc32c and Others license:bsd-3)))))) (define-public telegram-desktop (package (name "telegram-desktop") (version "4.1.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/telegramdesktop/tdesktop") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0zhwaql1fk0nqr1x2lchcswz61x7sb2297qdxiysgqamr0fk9ppn")) (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1))) (snippet #~(begin (let ((keep '(;; Custom fork "rlottie" "libtgvoip" ;; Not available in Guix. "dispatch" "tgcalls"))) (with-directory-excursion "Telegram/ThirdParty" (for-each delete-file-recursively (lset-difference string=? (scandir ".") (cons* "." ".." keep))))))))) (build-system qt-build-system) (arguments (list #:tests? #f ;No target #:imported-modules `(,@%qt-build-system-modules (guix build glib-or-gtk-build-system)) #:modules '((guix build qt-build-system) ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) (guix build utils) (ice-9 match)) #:configure-flags #~`(;; https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml ;; see also . "-DTDESKTOP_API_ID=611335" "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c" ,(string-append "-DTDESKTOP_LAUTCHER_BASENAME=" #$name) ;; NOTE: Options commented are default values. ;; See also: comments in inputs. ;; "-DDESKTOP_APP_USE_PACKAGED=ON" ;; "-DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=OFF" ;; "-DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=OFF" ;; "-DDESKTOP_APP_DISABLE_X11_INTEGRATION=OFF" ;; "-DDESKTOP_APP_DISABLE_SPELLCHECK=OFF" ;; "-DDESKTOP_APP_USE_ENCHANT=OFF" ;; "-DDESKTOP_APP_LOTTIE_USE_CACHE=ON" ;; "-DLIBTGVOIP_DISABLE_ALSA=OFF" ;; "-DLIBTGVOIP_DISABLE_PULSEAUDIO=OFF" ;; Build all the available detected features in the build ;; environment. "-DDESKTOP_APP_USE_PACKAGED_LAZY=ON") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'make-writable (lambda _ (for-each make-file-writable (find-files ".")))) (add-after 'make-writable 'copy-inputs (lambda* (#:key inputs outputs #:allow-other-keys) (for-each (match-lambda ((dst src) (copy-recursively src dst) (for-each make-file-writable (find-files dst)))) `(("cmake" ,(assoc-ref inputs "cmake-helpers")) ("Telegram/codegen" ,(assoc-ref inputs "codegen-source")) ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source")) ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source")) ("Telegram/lib_lottie" ,(assoc-ref inputs "lib-lottie-source")) ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source")) ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source")) ("Telegram/lib_spellcheck" ,(assoc-ref inputs "lib-spellcheck-source")) ("Telegram/lib_storage" ,(assoc-ref inputs "lib-storage-source")) ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source")) ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source")) ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source")) ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source")) ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source")) ("Telegram/ThirdParty/dispatch" ,(assoc-ref inputs "dispatch-source")) ("Telegram/ThirdParty/fcitx-qt5" ,(assoc-ref inputs "fcitx-qt5-source")) ("Telegram/ThirdParty/fcitx5-qt" ,(assoc-ref inputs "fcitx5-qt-source")) ("Telegram/ThirdParty/hime" ,(assoc-ref inputs "hime-source")) ("Telegram/ThirdParty/nimf" ,(assoc-ref inputs "nimf-source")) ("Telegram/ThirdParty/rlottie" ,(assoc-ref inputs "rlottie-source")) ("Telegram/ThirdParty/tgcalls" ,(assoc-ref inputs "tgcalls-source")) ("Telegram/ThirdParty/libtgvoip" ,(assoc-ref inputs "libtgvoip-source")))))) (replace 'build (lambda* (#:key (make-flags '()) (parallel-build? #t) #:allow-other-keys) (apply invoke "cmake" "--build" "." `(,@(if parallel-build? `("-j" ,(number->string (parallel-job-count))) '()) ,@make-flags)))) (replace 'install (lambda* (#:key (make-flags '()) #:allow-other-keys) (apply invoke "cmake" "--install" "." make-flags))) (add-after 'install 'glib-or-gtk-compile-schemas (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas)) (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))))) (native-inputs (let ((external-sources `(("cmake-helpers" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/cmake_helpers") (commit "0702ef4cdd8ab888fdadaa4f5b2eb0c9d5844b69"))) (file-name (git-file-name "cmake-helpers-for-telegram-desktop" version)) (sha256 (base32 "16lsm3pb8md4ksr2ps3bnkvr0jygdamkxyirxgz214n6wa281zk1"))))))) (modify-inputs external-sources (append clang-toolchain ninja pkg-config python-wrapper)))) (inputs (let ((external-sources `(("codegen-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/codegen") (commit "8815d7aec9b901191d08445f29e2edd0aeba7b2c"))) (file-name (git-file-name "codegen" version)) (sha256 (base32 "1ly958mjk25kfcpa174kvg134p9r751ixi275afj5kr57by9mbq2")))) ("lib-base-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_base") (commit "37fab6b4da32c91bc5d049baad2e9ad51cfcd195"))) (file-name (git-file-name "lib-base-for-telegram-desktop" version)) (sha256 (base32 "1b2zc0ag5w46vwjz2240yj9aniyv09yjyrwif32994drfq6l10k5")) (patches (search-patches "lib-base-for-telegram-desktop-support-musl.patch")))) ("lib-crl-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_crl") (commit "4e620bc383d032aadea8e6af02661f8c76695cec"))) (file-name (git-file-name "lib-crl-for-telegram-desktop" version)) (sha256 (base32 "17bngj247qwq0dg4h37xdi5v1mk22y4yp7sp6ph3irmnz4awah0x")))) ("lib-lottie-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_lottie") (commit "f3563bc6b0e042095d4d667d013f62cb8ae62b65"))) (file-name (git-file-name "lib-lottie-for-telegram-desktop" version)) (sha256 (base32 "0i0w6lcrmqln7axnlazcqkaj4z0lzn0gl3z59hng40ard76cgvsg")))) ("lib-qr-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_qr") (commit "501f4c3502fd872ab4d777df8911bdac32de7c48"))) (file-name (git-file-name "lib-qr-for-telegram-desktop" version)) (sha256 (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0")))) ("lib-rpl-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_rpl") (commit "fd31f5bf382d2679eccdb1abaf8240a56c6a7abe"))) (file-name (git-file-name "lib-rpl-for-telegram-desktop" version)) (sha256 (base32 "1fpq8nyh8wx6zkb3sjjrx9ydqzyhw4483bdk1i9blp0ijn9xxdxf")))) ("lib-spellcheck-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_spellcheck") (commit "b2f2b7b6bce60bc1c6429a6b5ec4bc5891baa060"))) (file-name (git-file-name "lib-spellcheck-for-telegram-desktop" version)) (sha256 (base32 "1v8xdbwza457wmjkfmpys46g5g1aw7yabjab6knxd4p4vhyjhbwh")))) ("lib-storage-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_storage") (commit "839609369d04615475cb1518636de3619106a917"))) (file-name (git-file-name "lib-storage-for-telegram-desktop" version)) (sha256 (base32 "1l26h2fmqp9dcpr6pfvdd5sjb68j7yh0ms2lnr8na7jf5xqmkwwm")))) ("lib-tl-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_tl") (commit "0d234b5aabf43d598e0cb0867566ee570d9e2755"))) (file-name (git-file-name "lib-tl-for-telegram-desktop" version)) (sha256 (base32 "1wc8d94h4ga36yl9g8h67j914xwpwv7rmkrrvvslgbgxb7sxcd96")))) ("lib-ui-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_ui") (commit "2f5d5e0e79bf52ab04047bc93a4b624d6d33d46a"))) (file-name (git-file-name "lib-ui-for-telegram-desktop" version)) (sha256 (base32 "09kmc1igh37wafngwk6raqx2wrlxg10lf9p72j84sxs05hbybfcn")))) ("lib-waylandshells-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_waylandshells") (commit "271290b93c65b6fb634cb9c69bff97f51b74f3a7"))) (file-name (git-file-name "lib-waylandshells-for-telegram-desktop" version)) (sha256 (base32 "02d966kbpqf029wwma17vicmc8n5iaksibaq6d81jmh770p2vsc9")))) ("lib-webrtc-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_webrtc") (commit "9b11599c3c56047cfa4c68b69f1fcc93b602c33a"))) (file-name (git-file-name "lib-webrtc-for-telegram-desktop" version)) (sha256 (base32 "0158jx8hj4fv6qpw5pgcr2mdlihj0dxs060dg3iy61zz6q68z5dq")))) ("lib-webview-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/lib_webview") (commit "546df65eb2424550ed84ce14fc9c5d1bb3586f35"))) (file-name (git-file-name "lib-webview-for-telegram-desktop" version)) (sha256 (base32 "0zzjwyw82bggncmmsw969lnjl04pklmqjqm77jjzadinivl52z0l")))) ("tgcalls-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/TelegramMessenger/tgcalls") (commit "82c4921045c440b727c38e464f3a0539708423ff"))) (file-name (git-file-name "tgcalls-for-telegram-desktop" version)) (sha256 (base32 "1109r17abh66yz91b65fn2g4ryfybnsr5g6075sjhbah1gccv9mk")))) ("libtgvoip-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/telegramdesktop/libtgvoip") (commit "78a8e22bedb0d06004da8bafeba88b7474cb89a4"))) (file-name (git-file-name "libtgvoip-for-telegram-desktop" version)) (sha256 (base32 "1y1jvm4i0i4fkl6c0bgcv2cpzziyyn1pywxqz726q008hwki941h")))) ("dispatch-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/apple/swift-corelibs-libdispatch") (commit "ecc678d79f38cf63d24b6d16e18f69a9117d8d73"))) (file-name (git-file-name "dispatch-for-telegram-desktop" version)) (sha256 (base32 "0hy4q6x3bgphazmpl3v62995abc9fpi8y7yg9aiblzsqkxmgjmqn")))) ("fcitx-qt5-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/fcitx/fcitx-qt5") (commit "c2feea444ab79e6a8d6d205d4c7b13ab1db353c9"))) (file-name (git-file-name "fcitx-qt5-for-telegram-desktop" version)) (sha256 (base32 "1y10n2l0rbzpvsryw0mikyv9hic8wxd8gwr0ax37niwjbkil2zv8")))) ("fcitx5-qt-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/fcitx/fcitx5-qt") (commit "fd06094f48e8281b6dc3fd4aaadfcd216c426a5a"))) (file-name (git-file-name "fcitx5-qt-for-telegram-desktop" version)) (sha256 (base32 "15mhcv3m39fi375ccd05hr8va4js9lkj0vllypnq90v43fcvawr1")))) ("hime-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/hime-ime/hime") (commit "9b3e6f9ab59d1fe4d9de73d3bf0fed7789f921c5"))) (file-name (git-file-name "hime-for-telegram-desktop" version)) (sha256 (base32 "1b98ql30ihbqz1zwlm0c3c1qmxp3gdz96wsic3h6ypqcr3xyj28f")))) ("nimf-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/hamonikr/nimf") (commit "181f9467fc1883c228fc272330ab2f000bfae163"))) (file-name (git-file-name "nimf-for-telegram-desktop" version)) (sha256 (base32 "0kk430bx3w9n8c1d42ng5gicx44gi9bsjd60n2927wdpm6jxm2yl")))) ("rlottie-source" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/desktop-app/rlottie") (commit "8c69fc20cf2e150db304311f1233a4b55a8892d7"))) (file-name (git-file-name "rlottie-for-telegram-desktop" version)) (sha256 (base32 "14gwg3sn6xdx9ymnx5r0vfm4pk8dwk92s10a1wdvfbjpyrxll64i"))))))) (modify-inputs external-sources (append c++-gsl ;Required jemalloc libexpected minizip openal qrcodegen-cpp qt5compat qtbase qtimageformats qtsvg-5 range-v3 rnnoise webrtc-for-telegram-desktop xxhash zlib ;; Has options fcitx-qt5 ;DESKTOP_APP_USE_PACKAGED_LAZY fcitx5-qt hime nimf glibmm-2.64 ;DESKTOP_APP_DISABLE_DBUS_INTEGRATION enchant ;DESKTOP_APP_USE_ENCHANT hunspell ;DESKTOP_APP_DISABLE_SPELLCHECK lz4 ;DESKTOP_APP_LOTTIE_USE_CACHE alsa-lib ;LIBTGVOIP_DISABLE_ALSA pulseaudio ;LIBTGVOIP_DISABLE_PULSEAUDIO qtwayland ;DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION wayland libxcb ;DESKTOP_APP_DISABLE_X11_INTEGRATION xcb-util-keysyms ;; Optional webkitgtk)))) (synopsis "Telegram Desktop") (description "Telegram desktop is the official desktop version of the Telegram instant messenger.") (home-page "https://desktop.telegram.org/") (license (list ;; Telegram/ThirdParty/dispatch license:asl2.0 ;; Telegram/ThirdParty/fcitx-qt5 (platform input context plugin) ;; Telegram/ThirdParty/fcitx5-qt (Fcitx5Qt4DBusAddons library ;; and input context plugin, Fcitx5Qt5DBusAddons library and Qt5 ;; platform input context plugin) license:bsd-3 ;; Telegram/ThirdParty/rlottie/src/vector/pixman ;; Telegram/ThirdParty/rlottie/src/vector/stb ;; Telegram/ThirdParty/rlottie/src/vector/rapidjson license:expat ;; Telegram/ThirdParty/rlottie/src/vector/freetype license:freetype ;; Telegram/ThirdParty/hime (files not mentioned below) license:lgpl2.1 ;; Telegram/ThirdParty/fcitx5-qt (files not mentioned above) ;; Telegram/ThirdParty/rlottie ;; Telegram/ThirdParty/rlottie/src/vector license:lgpl2.1+ ;; Telegram/ThirdParty/nimf ;; Telegram/ThirdParty/tgcalls license:lgpl3 ;; Telegram/ThirdParty/fcitx-qt5 (files not mentioned above) ;; Telegram/ThirdParty/hime (Qt immodules) license:gpl2 ;; Others license:gpl3+)))) (define-public tl-parser (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06") (revision "21")) (package (name "tl-parser") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/vysheng/tl-parser.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; No target #:imported-modules ((guix build copy-build-system) ,@%cmake-build-system-modules) #:modules (((guix build copy-build-system) #:prefix copy:) (guix build cmake-build-system) (guix build utils)) #:phases (modify-phases %standard-phases (replace 'install (lambda args (apply (assoc-ref copy:%standard-phases 'install) #:install-plan '(("." "bin" #:include ("tl-parser")) ("../source" "include/tl-parser" #:include-regexp ("\\.h$"))) args)))))) (synopsis "Parse tl scheme to tlo") (description "TL-Parser is a tl scheme to tlo file parser. It was formerly a part of telegram-cli, but now being maintained separately.") (home-page "https://github.com/vysheng/tl-parser") (license license:gpl2+)))) (define-public tgl (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed") (revision "181")) (package (name "tgl") (version (git-version "2.0.1" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/vysheng/tgl.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; No target #:imported-modules ((guix build copy-build-system) ,@%gnu-build-system-modules) #:modules (((guix build copy-build-system) #:prefix copy:) (guix build gnu-build-system) (guix build utils)) #:configure-flags (list ;; Use gcrypt instead of openssl. "--disable-openssl" ;; Enable extended queries system. "--enable-extf" ;; Include libevent-based net and timers. "--enable-libevent") #:phases (modify-phases %standard-phases (add-after 'unpack 'trigger-bootstrap (lambda _ (delete-file "configure") #t)) (add-after 'trigger-bootstrap 'patch-tl-parser (lambda _ (delete-file "Makefile.tl-parser") (substitute* "Makefile.in" (("include \\$\\{srcdir\\}/Makefile\\.tl-parser") "") (("\\$\\{EXE\\}/tl-parser") "tl-parser")) #t)) (replace 'install (lambda args (apply (assoc-ref copy:%standard-phases 'install) #:install-plan '(("bin" "bin") ("." "include/tgl" #:include-regexp ("\\.h$")) ("libs" "lib/tgl")) args)))))) (native-inputs (list autoconf automake libtool pkg-config)) (inputs (list libevent libgcrypt tl-parser zlib)) (synopsis "Telegram Library") (description "TGL is the telegram library for telegram-cli.") (home-page "https://github.com/vysheng/tgl") (license license:lgpl2.1+)))) (define-public telegram-cli (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a") (revision "324")) (package (name "telegram-cli") (version (git-version "1.3.1" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/vysheng/tg.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; No target #:imported-modules ((guix build copy-build-system) ,@%gnu-build-system-modules) #:modules (((guix build copy-build-system) #:prefix copy:) (guix build gnu-build-system) (guix build utils)) #:configure-flags (list ;; Use gcrypt instead of openssl. "--disable-openssl") #:phases (modify-phases %standard-phases (add-after 'unpack 'trigger-bootstrap (lambda _ (delete-file "configure") #t)) (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser (lambda* (#:key inputs #:allow-other-keys) (for-each delete-file (list "Makefile.tgl" "Makefile.tl-parser")) (substitute* "Makefile.in" (("include \\$\\{srcdir\\}/Makefile\\.tl-parser") "") (("include \\$\\{srcdir\\}/Makefile\\.tgl") "") (("-I\\$\\{srcdir\\}/tgl") (string-append "-I" (assoc-ref inputs "tgl") "/include/tgl")) (("AUTO=auto") (string-append "AUTO=" (assoc-ref inputs "tgl") "/include/tgl/auto")) (("LIB=libs") (string-append "LIB=" (assoc-ref inputs "tgl") "/lib/tgl"))) #t)) (replace 'install (lambda args (apply (assoc-ref copy:%standard-phases 'install) #:install-plan '(("bin" "bin") ("." "etc/telegram-cli" #:include-regexp ("\\.pub$") #:exclude ("tg-server.pub"))) args)))))) (native-inputs (list autoconf automake libtool pkg-config)) (inputs (list jansson libconfig libevent libgcrypt lua openssl perl python readline tgl tl-parser zlib)) (synopsis "Telegram Messenger CLI") (description "TG is the command-line interface for Telegram Messenger.") (home-page "https://github.com/vysheng/tg") (license license:gpl2+)))) (define-public tgcli (package (name "tgcli") (version "0.3.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/erayerdin/tgcli") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "082zim7rh4r8qyscqimjh2sz7998vv9j1i2y2wwz2rgrlhkhly5r")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases ;; Test requirements referes to specific versions of packages, ;; which are too old. So we patch them to refer to any later versions. (add-after 'unpack 'patch-test-requirements (lambda _ (substitute* "dev.requirements.txt" (("==") ">=")))) (replace 'check (lambda* (#:key inputs outputs tests? #:allow-other-keys) (when tests? (add-installed-pythonpath inputs outputs) (invoke "pytest" "tests"))))))) (native-inputs `(("coveralls" ,python-coveralls) ("pytest" ,python-pytest) ("pytest-click" ,python-pytest-click) ("pytest-cov" ,python-pytest-cov) ("mkdocs" ,python-mkdocs) ("mkdocs-material" ,python-mkdocs-material) ("requests-mock" ,python-requests-mock))) (propagated-inputs `(("click" ,python-click) ("colorful" ,python-colorful) ("requests" ,python-requests) ("yaspin" ,python-yaspin))) (home-page "https://tgcli.readthedocs.io") (synopsis "Telegram Terminal Application") (description "TgCli is a telegram client to automate repetitive tasks.") (license license:asl2.0)))