1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
| | ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;;
;;; 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 <http://www.gnu.org/licenses/>.
(define-module (gnu packages telegram)
#:use-module (gnu packages)
#:use-module (gnu packages aidc)
#:use-module (gnu packages audio)
#:use-module (gnu packages base)
#: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 fcitx)
#:use-module (gnu packages fcitx5)
#:use-module (gnu packages gcc)
#:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
#:use-module (gnu packages image)
#:use-module (gnu packages kde-frameworks)
#:use-module (gnu packages language)
#:use-module (gnu packages libreoffice)
#:use-module (gnu packages linux)
#:use-module (gnu packages lxqt)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages python)
#:use-module (gnu packages qt)
#:use-module (gnu packages telephony)
#:use-module (gnu packages tls)
#:use-module (gnu packages video)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xorg)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix git-download)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system qt))
(define-public tdesktop
(package
(name "tdesktop")
(version "2.5.1")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/telegramdesktop/tdesktop.git")
(commit
(string-append "v" version))
(recursive? #t)))
(file-name
(git-file-name name version))
(sha256
(base32 "1qw9vaa482dbz97mzwjzmy3fw72s5bk3hyacyz98ms652xgld6js"))))
(build-system qt-build-system)
(arguments
`(#: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))
#:configure-flags
(list
"-DCMAKE_C_FLAGS=-fPIC"
"-DCMAKE_CXX_FLAGS=-fPIC"
"-DTDESKTOP_API_ID=17349"
"-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'make-writable
(lambda _
(for-each make-file-writable
(find-files "."))
#t))
(add-after 'make-writable 'remove-thirdparty
(lambda _
(with-directory-excursion "Telegram/ThirdParty"
(for-each delete-file-recursively
(list
"Catch"
"GSL"
"QR"
"expected"
"fcitx-qt5"
"fcitx5-qt"
"hime"
"hunspell"
"libdbusmenu-qt"
;; "libtgvoip"
"lz4"
"materialdecoration"
"minizip"
"nimf"
"qt5ct"
"range-v3"
;; "rlottie"
"xxHash")))
#t))
(add-before 'configure 'patch-cxx-flags
(lambda _
(substitute* "cmake/options_linux.cmake"
(("class-memaccess")
"all"))
#t))
(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
`(("cmake-shared" ,cmake-shared)
("extra-cmake-modules" ,extra-cmake-modules)
("gcc" ,gcc-9)
("glib:bin" ,glib "bin")
("gobject-introspection" ,gobject-introspection)
("gtk+:bin" ,gtk+ "bin")
("pkg-config" ,pkg-config)
("python" ,python-wrapper)
("qttools" ,qttools)))
(inputs
`(("alsa" ,alsa-lib)
("catch" ,catch-framework2)
("expected" ,libexpected)
("fcitx-qt5" ,fcitx-qt5)
("fcitx5-qt" ,fcitx5-qt)
("ffmpeg" ,ffmpeg)
("glib" ,glib)
("gsl" ,gsl)
("gtk+" ,gtk+)
("hime" ,hime)
("hunspell" ,hunspell)
("iconv" ,libiconv)
("libdbusmenu-qt" ,libdbusmenu-qt)
("libjpeg" ,libjpeg-turbo)
;; ("libtgvoip" ,libtgvoip)
("lz4" ,lz4)
("materialdecoration" ,materialdecoration)
("minizip" ,minizip)
("nimf" ,nimf)
("openal" ,openal)
("openssl" ,openssl)
("opus" ,opus)
("pulseaudio" ,pulseaudio)
("qrcodegen" ,qrcodegen-cpp)
("qt" ,qtbase)
("qt5ct" ,qt5ct)
("qtwayland" ,qtwayland)
("range-v3" ,range-v3)
;; ("rlottie" ,rlottie)
("tg_owt" ,tg_owt)
("x11" ,libx11)
("xcb" ,libxcb)
("xcb-keysyms" ,xcb-util-keysyms)
("xxhash" ,xxhash)
("zlib" ,zlib)))
(synopsis "Telegram Desktop")
(description "Tdesktop is the official desktop application for telegram
messenger.")
(home-page "https://desktop.telegram.org/")
(license license:gpl3+)))
|