Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/telegram-desktop/files/, net-im/telegram-desktop/
Date: Sat, 17 Jul 2021 00:06:06
Message-Id: 1626480352.7fc1afa3705d7c107e17f9a1e9402aeece0acd56.gyakovlev@gentoo
1 commit: 7fc1afa3705d7c107e17f9a1e9402aeece0acd56
2 Author: Esteve Varela Colominas <esteve.varela <AT> gmail <DOT> com>
3 AuthorDate: Fri Jul 16 15:00:57 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 17 00:05:52 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fc1afa3
7
8 net-im/telegram-desktop: Bump to 2.8.10
9
10 Closes: https://github.com/gentoo/gentoo/pull/21674
11 Signed-off-by: Esteve Varela Colominas <esteve.varela <AT> gmail.com>
12 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
13
14 net-im/telegram-desktop/Manifest | 1 +
15 ...desktop-2.8.9-disable-jemalloc-separately.patch | 100 ++++++++++++++
16 .../tdesktop-2.8.9-disable-webkit-separately.patch | 122 +++++++++++++++++
17 .../files/tdesktop-2.8.9-webview-fix-glib.patch | 31 +++++
18 .../telegram-desktop-2.8.10.ebuild | 147 +++++++++++++++++++++
19 5 files changed, 401 insertions(+)
20
21 diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest
22 index 96744242fc0..e246987bf0e 100644
23 --- a/net-im/telegram-desktop/Manifest
24 +++ b/net-im/telegram-desktop/Manifest
25 @@ -1,2 +1,3 @@
26 DIST tdesktop-2.7.4-full.tar.gz 36894673 BLAKE2B e04749fb0168f8bae69a9ad85c5bff315faf0b355ff5f3a85a34ee36e3305c6b550553284d5179aff9283bbd1a94f9ec3c41e293d0ad8c86e4d08283189e42b3 SHA512 0a796d7a8c5e5982bc60f19c41da53996a609bf794fad224e7beea5fc3816b5cf35f16b0ec2cc7279085c69996063a44085f48e1596dfe746d260a2e8f1b2d14
27 DIST tdesktop-2.8.1-full.tar.gz 37129127 BLAKE2B 06f2a3050f0e0f321c766c54e19faf3ea172c41088e2ffdbb5928a41ba01de1fc845a84addded17d113316857c68f265642a8ab32feb79a87beef548c739b56c SHA512 df35cc00dc47a8c65b32b62c139cc3a49333f573aa88fb70cc65197524f9b9b4756c58752866c843704ea4df5d6224eb4cba5b32953dd9a4d721b0ee0e1efc69
28 +DIST tdesktop-2.8.10-full.tar.gz 37105631 BLAKE2B 71a08e0d2fda90898e711dd285478e565ddf7f6bd71db8910688c7f0bb550f04136cb3ccec101d5e89860471ffdd7a868dd90a6317924e96c8ad558d4e3079f2 SHA512 910e34718a061d643937393fa105f2236549059eaecc56aab1203a0efa3a7538f7a2d9b432c8b0a9269118ef3bff56dc1edf856476629efe666d16851e68932f
29
30 diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch
31 new file mode 100644
32 index 00000000000..dff2455d4e3
33 --- /dev/null
34 +++ b/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch
35 @@ -0,0 +1,100 @@
36 +Allow controlling the use of jemalloc
37 +
38 +Jemalloc is often controlled through USE=jemalloc in Gentoo. Removing or
39 +replacing it is trivial, and I'm not aware of any particular advantages that
40 +come with using this allocator, especially for an IM client. Benchmarks
41 +regarding this allocator provide a huge variety of results depending on the
42 +workload and system, so it's hard to establish when this allocator provides any
43 +tangible advantage.
44 +
45 +Considering things like Hardened Gentoo, the user might prefer to use a more
46 +exploit-resistant allocator, like GrapheneOS/hardened_malloc, and I've heard
47 +Musl is hardening their allocator as well.
48 +
49 +I trust the user can better judge if they need this in their particular setup.
50 +
51 +If a telegram dev is reading this, feel free to drop me a message (metadata.xml
52 +contains the maintainer's address), if you believe it should be forced due to
53 +usability concerns, or if you can provide me with some context I might be
54 +missing. Jemalloc is currently enabled by default.
55 +
56 +--- tdesktop-2.8.9-full.orig/Telegram/SourceFiles/platform/linux/specific_linux.cpp
57 ++++ tdesktop-2.8.9-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp
58 +@@ -48,7 +48,10 @@
59 + #include <gio/gio.h>
60 + #include <glibmm.h>
61 + #include <giomm.h>
62 ++
63 ++#ifndef DESKTOP_APP_DISABLE_JEMALLOC
64 + #include <jemalloc/jemalloc.h>
65 ++#endif // !DESKTOP_APP_DISABLE_JEMALLOC
66 +
67 + #include <sys/stat.h>
68 + #include <sys/types.h>
69 +@@ -727,8 +730,10 @@
70 + namespace Platform {
71 +
72 + void start() {
73 ++#ifndef DESKTOP_APP_DISABLE_JEMALLOC
74 + auto backgroundThread = true;
75 + mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool));
76 ++#endif // !DESKTOP_APP_DISABLE_JEMALLOC
77 +
78 + LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));
79 +
80 +--- tdesktop-2.8.9-full.orig/cmake/external/CMakeLists.txt
81 ++++ tdesktop-2.8.9-full/cmake/external/CMakeLists.txt
82 +@@ -37,7 +37,7 @@
83 + add_checked_subdirectory(hunspell)
84 + endif()
85 + add_checked_subdirectory(iconv)
86 +-if (LINUX)
87 ++if (LINUX AND NOT DESKTOP_APP_DISABLE_JEMALLOC)
88 + add_checked_subdirectory(jemalloc)
89 + endif()
90 + add_checked_subdirectory(jpeg)
91 +--- tdesktop-2.8.9-full.orig/cmake/options.cmake
92 ++++ tdesktop-2.8.9-full/cmake/options.cmake
93 +@@ -56,6 +56,13 @@
94 + )
95 + endif()
96 +
97 ++if (DESKTOP_APP_DISABLE_JEMALLOC)
98 ++ target_compile_definitions(common_options
99 ++ INTERFACE
100 ++ DESKTOP_APP_DISABLE_JEMALLOC
101 ++ )
102 ++endif()
103 ++
104 + if (DESKTOP_APP_USE_PACKAGED)
105 + target_compile_definitions(common_options
106 + INTERFACE
107 +--- tdesktop-2.8.9-full.orig/cmake/options_linux.cmake
108 ++++ tdesktop-2.8.9-full/cmake/options_linux.cmake
109 +@@ -58,10 +58,12 @@
110 + endif()
111 + endif()
112 +
113 +-target_link_libraries(common_options
114 +-INTERFACE
115 +- desktop-app::external_jemalloc
116 +-)
117 ++if (NOT DESKTOP_APP_DISABLE_JEMALLOC)
118 ++ target_link_libraries(common_options
119 ++ INTERFACE
120 ++ desktop-app::external_jemalloc
121 ++ )
122 ++endif()
123 +
124 + if (DESKTOP_APP_USE_PACKAGED)
125 + find_library(ATOMIC_LIBRARY atomic)
126 +--- tdesktop-2.8.9-full.orig/cmake/variables.cmake
127 ++++ tdesktop-2.8.9-full/cmake/variables.cmake
128 +@@ -38,6 +38,7 @@
129 + option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF)
130 + option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target})
131 + option(DESKTOP_APP_DISABLE_WEBKIT "Disable WebkitGTK library (Linux only)." OFF)
132 ++option(DESKTOP_APP_DISABLE_JEMALLOC "Disable use of the jemalloc allocator (Linux only)." OFF)
133 + option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target})
134 + option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})
135 + option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF)
136
137 diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-webkit-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-webkit-separately.patch
138 new file mode 100644
139 index 00000000000..388e09fa58d
140 --- /dev/null
141 +++ b/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-webkit-separately.patch
142 @@ -0,0 +1,122 @@
143 +Allow controlling the use of webkit-gtk
144 +
145 +WebKitGTK is used to display payment pages when buying things in Telegram
146 +shops. This library can be disabled properly alongside the GTK integration with
147 +its flag. However, I reckon *most* users want the GTK integration (fixes
148 +pasting big images, amongst other things), but hardly anyone actually buys
149 +things through Telegram. Controlling these two things separately is trivial, and
150 +the user gets a nice dialog telling them WebKitGTK isn't available in the event
151 +they *do* attempt to use the related features.
152 +
153 +NOTE: GTK integration *must* be enabled for WebKitGTK to work.
154 +
155 +--- tdesktop-2.8.9-full.orig/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
156 ++++ tdesktop-2.8.9-full/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp
157 +@@ -587,9 +587,11 @@
158 + if (const auto integration = BaseGtkIntegration::Instance()) {
159 + return integration->exec(parentDBusName);
160 + }
161 ++#ifndef DESKTOP_APP_DISABLE_WEBKIT
162 + } else if (type == Type::Webview) {
163 + Webview::WebKit2Gtk::SetServiceName(serviceName.toStdString());
164 + return Webview::WebKit2Gtk::Exec(parentDBusName.toStdString());
165 ++#endif
166 + } else if (type == Type::TDesktop) {
167 + ServiceName = serviceName.toStdString();
168 + if (const auto integration = Instance()) {
169 +@@ -602,7 +604,9 @@
170 +
171 + void GtkIntegration::Start(Type type) {
172 + if (type != Type::Base
173 ++#ifndef DESKTOP_APP_DISABLE_WEBKIT
174 + && type != Type::Webview
175 ++#endif
176 + && type != Type::TDesktop) {
177 + return;
178 + }
179 +@@ -613,11 +617,13 @@
180 +
181 + if (type == Type::Base) {
182 + BaseGtkIntegration::SetServiceName(kBaseService.utf16().arg(h));
183 ++#ifndef DESKTOP_APP_DISABLE_WEBKIT
184 + } else if (type == Type::Webview) {
185 + Webview::WebKit2Gtk::SetServiceName(
186 + kWebviewService.utf16().arg(h).arg("%1").toStdString());
187 +
188 + return;
189 ++#endif
190 + } else {
191 + ServiceName = kService.utf16().arg(h).toStdString();
192 + }
193 +--- tdesktop-2.8.9-full.orig/Telegram/lib_webview/CMakeLists.txt
194 ++++ tdesktop-2.8.9-full/Telegram/lib_webview/CMakeLists.txt
195 +@@ -48,7 +48,7 @@
196 + nuget_add_webview(lib_webview)
197 + nuget_add_winrt(lib_webview)
198 + elseif (LINUX)
199 +- if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
200 ++ if (NOT DESKTOP_APP_DISABLE_WEBKIT)
201 + find_package(PkgConfig REQUIRED)
202 +
203 + if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
204 +--- tdesktop-2.8.9-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
205 ++++ tdesktop-2.8.9-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
206 +@@ -11,14 +11,14 @@
207 + namespace Webview {
208 +
209 + Available Availability() {
210 +-#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
211 ++#ifndef DESKTOP_APP_DISABLE_WEBKIT
212 + return WebKit2Gtk::Availability();
213 +-#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
214 ++#else // !DESKTOP_APP_DISABLE_WEBKIT
215 + return Available{
216 + .error = Available::Error::NoGtkOrWebkit2Gtk,
217 + .details = "This feature was disabled at build time.",
218 + };
219 +-#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
220 ++#endif // DESKTOP_APP_DISABLE_WEBKIT
221 + }
222 +
223 + bool SupportsEmbedAfterCreate() {
224 +@@ -26,11 +26,11 @@
225 + }
226 +
227 + std::unique_ptr<Interface> CreateInstance(Config config) {
228 +-#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
229 ++#ifndef DESKTOP_APP_DISABLE_WEBKIT
230 + return WebKit2Gtk::CreateInstance(std::move(config));
231 +-#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
232 ++#else // !DESKTOP_APP_DISABLE_WEBKIT
233 + return nullptr;
234 +-#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
235 ++#endif // DESKTOP_APP_DISABLE_WEBKIT
236 + }
237 +
238 + } // namespace Webview
239 +--- tdesktop-2.8.9-full.orig/cmake/options.cmake
240 ++++ tdesktop-2.8.9-full/cmake/options.cmake
241 +@@ -49,6 +49,13 @@
242 + )
243 + endif()
244 +
245 ++if (DESKTOP_APP_DISABLE_WEBKIT)
246 ++ target_compile_definitions(common_options
247 ++ INTERFACE
248 ++ DESKTOP_APP_DISABLE_WEBKIT
249 ++ )
250 ++endif()
251 ++
252 + if (DESKTOP_APP_USE_PACKAGED)
253 + target_compile_definitions(common_options
254 + INTERFACE
255 +--- tdesktop-2.8.9-full.orig/cmake/variables.cmake
256 ++++ tdesktop-2.8.9-full/cmake/variables.cmake
257 +@@ -37,6 +37,7 @@
258 + option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF)
259 + option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF)
260 + option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target})
261 ++option(DESKTOP_APP_DISABLE_WEBKIT "Disable WebkitGTK library (Linux only)." OFF)
262 + option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target})
263 + option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})
264 + option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF)
265
266 diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.9-webview-fix-glib.patch b/net-im/telegram-desktop/files/tdesktop-2.8.9-webview-fix-glib.patch
267 new file mode 100644
268 index 00000000000..02c96d28b2c
269 --- /dev/null
270 +++ b/net-im/telegram-desktop/files/tdesktop-2.8.9-webview-fix-glib.patch
271 @@ -0,0 +1,31 @@
272 +Fixes an issue with glib headers including a C++ header inside extern "C"
273 +
274 +This patch is a hacky workaround, proper solution doesn't seem trivial.
275 +
276 +In file included from /usr/include/glib-2.0/glib/gatomic.h:31,
277 + from /usr/include/glib-2.0/glib/gthread.h:32,
278 + from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
279 + from /usr/include/glib-2.0/glib.h:32,
280 + from /usr/include/gtk-3.0/gdk/gdkconfig.h:13,
281 + from /usr/include/gtk-3.0/gdk/gdk.h:30,
282 + from /usr/include/gtk-3.0/gtk/gtk.h:30,
283 + from /var/tmp/portage/net-im/telegram-desktop-2.8.9/work/tdesktop-2.8.9-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h:11,
284 + from /var/tmp/portage/net-im/telegram-desktop-2.8.9/work/tdesktop-2.8.9-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp:7:
285 +/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/type_traits:56:3: error: template with C linkage
286 + 56 | template<typename _Tp, _Tp __v>
287 + | ^~~~~~~~
288 +In file included from /var/tmp/portage/net-im/telegram-desktop-2.8.9/work/tdesktop-2.8.9-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp:7:
289 +/var/tmp/portage/net-im/telegram-desktop-2.8.9/work/tdesktop-2.8.9-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h:9:1: note: extern "C" linkage started here
290 + 9 | extern "C" {
291 + | ^~~~~~~~~~
292 +
293 +--- tdesktop-2.8.9-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
294 ++++ tdesktop-2.8.9-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
295 +@@ -6,6 +6,7 @@
296 + //
297 + #pragma once
298 +
299 ++#include <type_traits> // Required for glib/gatomic.h
300 + extern "C" {
301 + #include <JavaScriptCore/JavaScript.h>
302 + #include <gtk/gtk.h>
303
304 diff --git a/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild b/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild
305 new file mode 100644
306 index 00000000000..375320d4583
307 --- /dev/null
308 +++ b/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild
309 @@ -0,0 +1,147 @@
310 +# Copyright 2020-2021 Gentoo Authors
311 +# Distributed under the terms of the GNU General Public License v2
312 +
313 +EAPI=7
314 +
315 +PYTHON_COMPAT=( python3_{7..10} )
316 +
317 +inherit xdg cmake python-any-r1 flag-o-matic
318 +
319 +DESCRIPTION="Official desktop client for Telegram"
320 +HOMEPAGE="https://desktop.telegram.org"
321 +
322 +MY_P="tdesktop-${PV}-full"
323 +SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz"
324 +
325 +LICENSE="BSD GPL-3-with-openssl-exception LGPL-2+"
326 +SLOT="0"
327 +KEYWORDS="~amd64"
328 +IUSE="+dbus enchant +gtk +hunspell +jemalloc +spell wayland webkit +X"
329 +REQUIRED_USE="
330 + spell? (
331 + ^^ ( enchant hunspell )
332 + )
333 + webkit? ( gtk )
334 + gtk? ( dbus )
335 +"
336 +
337 +RDEPEND="
338 + !net-im/telegram-desktop-bin
339 + app-arch/lz4:=
340 + dev-cpp/glibmm:2
341 + dev-libs/xxhash
342 + >=dev-qt/qtcore-5.15:5
343 + >=dev-qt/qtgui-5.15:5[dbus?,jpeg,png,wayland?,X(-)?]
344 + >=dev-qt/qtimageformats-5.15:5
345 + >=dev-qt/qtnetwork-5.15:5[ssl]
346 + >=dev-qt/qtsvg-5.15:5
347 + >=dev-qt/qtwidgets-5.15:5[png,X(-)?]
348 + media-fonts/open-sans
349 + media-libs/fontconfig:=
350 + ~media-libs/libtgvoip-2.4.4_p20210302
351 + >=media-libs/libtgvoip-2.4.4_p20210302-r2
352 + media-libs/openal
353 + media-libs/opus:=
354 + media-libs/rnnoise
355 + ~media-libs/tg_owt-0_pre20210626
356 + media-video/ffmpeg:=[opus]
357 + sys-libs/zlib:=[minizip]
358 + dbus? (
359 + dev-qt/qtdbus:5
360 + dev-libs/libdbusmenu-qt[qt5(+)]
361 + )
362 + enchant? ( app-text/enchant:= )
363 + gtk? ( x11-libs/gtk+:3[X?,wayland?] )
364 + hunspell? ( >=app-text/hunspell-1.7:= )
365 + jemalloc? ( dev-libs/jemalloc:= )
366 + wayland? ( kde-frameworks/kwayland:= )
367 + webkit? ( net-libs/webkit-gtk:= )
368 + X? ( x11-libs/libxcb:= )
369 +"
370 +DEPEND="${RDEPEND}
371 + dev-cpp/range-v3
372 + =dev-cpp/ms-gsl-3*
373 +"
374 +BDEPEND="
375 + ${PYTHON_DEPS}
376 + >=dev-util/cmake-3.16
377 + virtual/pkgconfig
378 +"
379 +
380 +S="${WORKDIR}/${MY_P}"
381 +
382 +PATCHES=(
383 + # https://github.com/desktop-app/cmake_helpers/pull/91
384 + # https://github.com/desktop-app/lib_webview/pull/2
385 + "${FILESDIR}/tdesktop-2.8.9-disable-webkit-separately.patch"
386 + # Not going to attempt upstreaming this after the reaction to
387 + # "disable-webkit-separately"
388 + "${FILESDIR}/tdesktop-2.8.9-disable-jemalloc-separately.patch"
389 + # Not a proper fix, not upstreamed
390 + "${FILESDIR}/tdesktop-2.8.9-webview-fix-glib.patch"
391 +)
392 +
393 +pkg_pretend() {
394 + if has ccache ${FEATURES}; then
395 + ewarn
396 + ewarn "ccache does not work with ${PN} out of the box"
397 + ewarn "due to usage of precompiled headers"
398 + ewarn "check bug https://bugs.gentoo.org/715114 for more info"
399 + ewarn
400 + fi
401 +}
402 +
403 +src_prepare() {
404 + # no explicit toggle, doesn't build with the system one #752417
405 + sed -i 's/DESKTOP_APP_USE_PACKAGED/NO_ONE_WILL_EVER_SET_THIS/' \
406 + cmake/external/rlottie/CMakeLists.txt || die
407 +
408 + cmake_src_prepare
409 +}
410 +
411 +src_configure() {
412 + # gtk is really needed for image copy-paste due to https://bugreports.qt.io/browse/QTBUG-56595
413 + local mycmakeargs=(
414 + -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
415 + -DCMAKE_DISABLE_FIND_PACKAGE_tl-expected=ON # header only lib, some git version. prevents warnings.
416 +
417 + -DDESKTOP_APP_DISABLE_X11_INTEGRATION=$(usex X OFF ON)
418 + -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=$(usex wayland OFF ON)
419 + -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex dbus OFF ON)
420 + -DDESKTOP_APP_DISABLE_GTK_INTEGRATION=$(usex gtk OFF ON)
421 + -DDESKTOP_APP_DISABLE_WEBKIT=$(usex webkit OFF ON)
422 + -DDESKTOP_APP_DISABLE_JEMALLOC=$(usex jemalloc OFF ON)
423 + -DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex spell OFF ON) # enables hunspell (recommended)
424 + -DDESKTOP_APP_USE_ENCHANT=$(usex enchant ON OFF) # enables enchant and disables hunspell
425 + )
426 +
427 + if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
428 + einfo "Found custom API credentials"
429 + mycmakeargs+=(
430 + -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
431 + -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
432 + )
433 + else
434 + # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
435 + # Building with snapcraft API credentials by default
436 + # Custom API credentials can be obtained here:
437 + # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
438 + # After getting credentials you can export variables:
439 + # export MY_TDESKTOP_API_ID="17349""
440 + # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
441 + # and restart the build"
442 + # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
443 + # portage will use custom variable every build automatically
444 + mycmakeargs+=(
445 + -DTDESKTOP_API_ID="611335"
446 + -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
447 + )
448 + fi
449 +
450 + cmake_src_configure
451 +}
452 +
453 +pkg_postinst() {
454 + xdg_pkg_postinst
455 + use gtk || elog "enable 'gtk' useflag if you have image copy-paste problems"
456 +}