Gentoo Archives: gentoo-commits

From: Sam James <sam@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: Tue, 23 Aug 2022 05:24:27
Message-Id: 1661232239.18cc6458425a80fa8cc090f4066add9c3319c8a2.sam@gentoo
1 commit: 18cc6458425a80fa8cc090f4066add9c3319c8a2
2 Author: Esteve Varela Colominas <esteve.varela <AT> gmail <DOT> com>
3 AuthorDate: Sat Aug 13 14:06:42 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 23 05:23:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18cc6458
7
8 net-im/telegram-desktop: Bump to 4.1.0
9
10 Signed-off-by: Esteve Varela Colominas <esteve.varela <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 net-im/telegram-desktop/Manifest | 1 +
14 .../files/tdesktop-3.3.0-fix-enchant.patch | 2 +
15 .../tdesktop-3.6.0-jemalloc-only-telegram.patch | 2 +
16 ...tdesktop-4.1.0-fix-unique_ptr-declaration.patch | 25 +++
17 .../telegram-desktop/telegram-desktop-4.1.0.ebuild | 182 +++++++++++++++++++++
18 5 files changed, 212 insertions(+)
19
20 diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest
21 index 5cc1ba90b246..fc3d53da412e 100644
22 --- a/net-im/telegram-desktop/Manifest
23 +++ b/net-im/telegram-desktop/Manifest
24 @@ -1,2 +1,3 @@
25 DIST tdesktop-3.6.1-full.tar.gz 41226549 BLAKE2B 6922ae015e36f86597aaedf1212ed951d6313a8f5f76a8838ab7ef9e02afe0cbc428acd991488190bafdf28faf2a69a09a5a1e963b2aa6ed27ef941602e15d88 SHA512 dd216c720ea3b1c72669805bb31319746a7ddfe746d188bf2ae0c5cdf0a10b379fc2e888a26fe755d77381fc5d9aa638cedc76b2dce1f1126a9c1ef9c02da2ba
26 DIST tdesktop-4.0.2-full.tar.gz 41059443 BLAKE2B da4efb15c8a2d11719d3aa56c3a40b12f70c37577d2909c43e6029e10ca0bb1f8445ed68ed9acd532009c8e0a8f48fa13d2a51573a81f58a8a83b13427ffb631 SHA512 0078b627d06dd8e655bd2bcc222ecbb3b15b7d88f858810bccdca84793ad02a60f4a4bf3808838752d65d4f6cffa3ddb5f70c5afc8e94cb6edae52101362feeb
27 +DIST tdesktop-4.1.0-full.tar.gz 41431524 BLAKE2B 041e3561a1666e60ccee8ca002a413cc773cd5aa7e42f8c1ca5878860eb9ed2d8175c78929b32c25530b511877751982c191dd3be182daf31808c439eedb2705 SHA512 d58ad4b3eaf72b4885612ecca0b29057a1f0e7efc7a539c4ed7cdfa9f6b8dd19e378f1e4b9f28a644d8c8559a5310a168e0b949aafac6902bd21155795db2574
28
29 diff --git a/net-im/telegram-desktop/files/tdesktop-3.3.0-fix-enchant.patch b/net-im/telegram-desktop/files/tdesktop-3.3.0-fix-enchant.patch
30 index 35781fda0ced..7550828ef59e 100644
31 --- a/net-im/telegram-desktop/files/tdesktop-3.3.0-fix-enchant.patch
32 +++ b/net-im/telegram-desktop/files/tdesktop-3.3.0-fix-enchant.patch
33 @@ -1,3 +1,5 @@
34 +https://bugs.gentoo.org/830180
35 +
36 --- tdesktop-3.3.0-full.orig/Telegram/lib_spellcheck/spellcheck/platform/linux/spellcheck_linux.cpp
37 +++ tdesktop-3.3.0-full/Telegram/lib_spellcheck/spellcheck/platform/linux/spellcheck_linux.cpp
38 @@ -34,7 +34,7 @@
39
40 diff --git a/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch b/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch
41 index 6836e6935049..18240ce522e2 100644
42 --- a/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch
43 +++ b/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch
44 @@ -5,6 +5,8 @@ jemalloc is linked for those, and they're ran under portage's sandbox. Since
45 this is only used during build-time, and jemalloc is merely necessary to
46 improve runtime memory use, it's unnecessary to use it for anything else.
47
48 +https://bugs.gentoo.org/802624
49 +
50 --- tdesktop-3.6.0-full.orig/Telegram/CMakeLists.txt
51 +++ tdesktop-3.6.0-full/Telegram/CMakeLists.txt
52 @@ -1376,6 +1376,14 @@
53
54 diff --git a/net-im/telegram-desktop/files/tdesktop-4.1.0-fix-unique_ptr-declaration.patch b/net-im/telegram-desktop/files/tdesktop-4.1.0-fix-unique_ptr-declaration.patch
55 new file mode 100644
56 index 000000000000..46d7afe1851e
57 --- /dev/null
58 +++ b/net-im/telegram-desktop/files/tdesktop-4.1.0-fix-unique_ptr-declaration.patch
59 @@ -0,0 +1,25 @@
60 +Fix declaration of std::unique_ptr
61 +
62 +I'm not sure if this is an inherent tdesktop issue or if it's related to any
63 +new version of a tool...
64 +
65 +--- tdesktop-4.1.0-full.orig/Telegram/SourceFiles/ffmpeg/ffmpeg_emoji.h
66 ++++ tdesktop-4.1.0-full/Telegram/SourceFiles/ffmpeg/ffmpeg_emoji.h
67 +@@ -9,6 +9,7 @@
68 +
69 + #include "ui/effects/frame_generator.h"
70 +
71 ++#include <memory>
72 + #include <QtGui/QImage>
73 +
74 + namespace FFmpeg {
75 +--- tdesktop-4.1.0-full.orig/Telegram/lib_lottie/lottie/lottie_emoji.h
76 ++++ tdesktop-4.1.0-full/Telegram/lib_lottie/lottie/lottie_emoji.h
77 +@@ -8,6 +8,7 @@
78 +
79 + #include "ui/effects/frame_generator.h"
80 +
81 ++#include <memory>
82 + #include <QtGui/QImage>
83 +
84 + namespace rlottie {
85
86 diff --git a/net-im/telegram-desktop/telegram-desktop-4.1.0.ebuild b/net-im/telegram-desktop/telegram-desktop-4.1.0.ebuild
87 new file mode 100644
88 index 000000000000..014988de2f0e
89 --- /dev/null
90 +++ b/net-im/telegram-desktop/telegram-desktop-4.1.0.ebuild
91 @@ -0,0 +1,182 @@
92 +# Copyright 2020-2022 Gentoo Authors
93 +# Distributed under the terms of the GNU General Public License v2
94 +
95 +EAPI=8
96 +
97 +PYTHON_COMPAT=( python3_{8..11} )
98 +
99 +inherit xdg cmake python-any-r1 optfeature
100 +
101 +DESCRIPTION="Official desktop client for Telegram"
102 +HOMEPAGE="https://desktop.telegram.org"
103 +
104 +MY_P="tdesktop-${PV}-full"
105 +SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz"
106 +S="${WORKDIR}/${MY_P}"
107 +
108 +LICENSE="BSD GPL-3-with-openssl-exception LGPL-2+"
109 +SLOT="0"
110 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv"
111 +IUSE="+dbus enchant +hunspell +jemalloc screencast +spell qt6 wayland +X"
112 +REQUIRED_USE="
113 + spell? (
114 + ^^ ( enchant hunspell )
115 + )
116 +"
117 +
118 +RDEPEND="
119 + !net-im/telegram-desktop-bin
120 + app-arch/lz4:=
121 + dev-cpp/abseil-cpp:=
122 + dev-libs/libdispatch
123 + dev-libs/openssl:=
124 + dev-libs/xxhash
125 + media-fonts/open-sans
126 + media-libs/fontconfig:=
127 + ~media-libs/libtgvoip-2.4.4_p20220503
128 + media-libs/openal
129 + media-libs/opus:=
130 + media-libs/rnnoise
131 + ~media-libs/tg_owt-0_pre20220507[screencast=,X=]
132 + media-video/ffmpeg:=[opus]
133 + sys-libs/zlib:=[minizip]
134 + dbus? ( dev-cpp/glibmm:2 )
135 + enchant? ( app-text/enchant:= )
136 + hunspell? ( >=app-text/hunspell-1.7:= )
137 + jemalloc? ( dev-libs/jemalloc:=[-lazy-lock] )
138 + !qt6? (
139 + >=dev-qt/qtcore-5.15:5
140 + >=dev-qt/qtgui-5.15:5[dbus?,jpeg,png,wayland?,X?]
141 + >=dev-qt/qtimageformats-5.15:5
142 + >=dev-qt/qtnetwork-5.15:5[ssl]
143 + >=dev-qt/qtsvg-5.15:5
144 + >=dev-qt/qtwidgets-5.15:5[png,X?]
145 + )
146 + qt6? (
147 + dev-qt/qtbase:6[dbus?,gui,network,opengl,widgets,X?]
148 + dev-qt/qtsvg:6
149 + dev-qt/qt5compat:6
150 + wayland? ( dev-qt/qtwayland:6 )
151 + )
152 + X? ( x11-libs/libxcb:= )
153 +"
154 +DEPEND="${RDEPEND}
155 + dev-cpp/range-v3
156 + =dev-cpp/ms-gsl-3*
157 +"
158 +BDEPEND="
159 + ${PYTHON_DEPS}
160 + >=dev-util/cmake-3.16
161 + virtual/pkgconfig
162 +"
163 +# dev-libs/jemalloc:=[-lazy-lock] -> https://bugs.gentoo.org/803233
164 +
165 +PATCHES=(
166 + "${FILESDIR}/tdesktop-3.6.0-jemalloc-only-telegram.patch"
167 + "${FILESDIR}/tdesktop-3.3.0-fix-enchant.patch"
168 + "${FILESDIR}/tdesktop-3.5.2-musl.patch"
169 + "${FILESDIR}/tdesktop-4.0.2-fix-gcc12-cstdint.patch"
170 + "${FILESDIR}/tdesktop-4.1.0-fix-unique_ptr-declaration.patch"
171 +)
172 +
173 +# Current desktop-file-utils-0.26 does not understand Version=1.5
174 +QA_DESKTOP_FILE="usr/share/applications/${PN}.desktop"
175 +
176 +pkg_pretend() {
177 + if has ccache ${FEATURES}; then
178 + ewarn "ccache does not work with ${PN} out of the box"
179 + ewarn "due to usage of precompiled headers"
180 + ewarn "check bug https://bugs.gentoo.org/715114 for more info"
181 + ewarn
182 + fi
183 + if use qt6; then
184 + ewarn "Qt6 support in gentoo is experimental."
185 + ewarn "Please report any issues you may find, but don't expect"
186 + ewarn "everything to work correctly as of yet."
187 + ewarn
188 + fi
189 +}
190 +
191 +src_prepare() {
192 + # no explicit toggle, doesn't build with the system one #752417
193 + sed -i 's/DESKTOP_APP_USE_PACKAGED/NO_ONE_WILL_EVER_SET_THIS/' \
194 + cmake/external/rlottie/CMakeLists.txt || die
195 +
196 + cmake_src_prepare
197 +}
198 +
199 +src_configure() {
200 + # DESKTOP_APP_DISABLE_JEMALLOC is heavily discouraged by upstream, as the
201 + # glibc allocator results in high memory usage.
202 + # https://github.com/telegramdesktop/tdesktop/issues/16084
203 + # https://github.com/desktop-app/cmake_helpers/pull/91#issuecomment-881788003
204 +
205 + # DESKTOP_APP_QT6=OFF force-enables DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
206 + # This means that REQUIRED_USE="wayland? ( qt6 )", but a lot of people
207 + # enable USE=wayland globally, so we instead silently disable it...
208 +
209 + local mycmakeargs=(
210 + -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
211 + -DCMAKE_DISABLE_FIND_PACKAGE_tl-expected=ON # header only lib, some git version. prevents warnings.
212 + -DDESKTOP_APP_QT6=$(usex qt6)
213 +
214 + -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex !dbus)
215 + -DDESKTOP_APP_DISABLE_X11_INTEGRATION=$(usex !X)
216 + -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=$(usex !wayland)
217 + -DDESKTOP_APP_DISABLE_JEMALLOC=$(usex !jemalloc)
218 + -DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex !spell) # enables hunspell (recommended)
219 + -DDESKTOP_APP_USE_ENCHANT=$(usex enchant) # enables enchant and disables hunspell
220 + )
221 +
222 + if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
223 + einfo "Found custom API credentials"
224 + mycmakeargs+=(
225 + -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
226 + -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
227 + )
228 + else
229 + # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
230 + # Building with snapcraft API credentials by default
231 + # Custom API credentials can be obtained here:
232 + # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
233 + # After getting credentials you can export variables:
234 + # export MY_TDESKTOP_API_ID="17349""
235 + # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
236 + # and restart the build"
237 + # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
238 + # portage will use custom variable every build automatically
239 + mycmakeargs+=(
240 + -DTDESKTOP_API_ID="611335"
241 + -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
242 + )
243 + fi
244 +
245 + cmake_src_configure
246 +}
247 +
248 +pkg_postinst() {
249 + xdg_pkg_postinst
250 + if ! use X && ! use screencast; then
251 + elog "both the 'X' and 'screencast' useflags are disabled, screen sharing won't work!"
252 + elog
253 + fi
254 + if has_version '<dev-qt/qtcore-5.15.2-r10'; then
255 + ewarn "Versions of dev-qt/qtcore lower than 5.15.2-r10 might cause telegram"
256 + ewarn "to crash when pasting big images from the clipboard."
257 + ewarn
258 + fi
259 + if ! use jemalloc && use elibc_glibc; then
260 + ewarn "Disabling USE=jemalloc on glibc systems may cause very high RAM usage!"
261 + ewarn "Do NOT report issues about RAM usage without enabling this flag first."
262 + ewarn
263 + fi
264 + if use wayland && ! use qt6; then
265 + ewarn "Wayland-specific integrations have been deprecated with Qt5."
266 + ewarn "The app will continue to function under wayland, but some"
267 + ewarn "functionality may be reduced."
268 + ewarn "These integrations are only supported when built with Qt6."
269 + ewarn
270 + fi
271 + optfeature_header
272 + optfeature "shop payment support (requires USE=dbus enabled)" net-libs/webkit-gtk
273 +}