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/
Date: Mon, 26 Oct 2020 08:03:44
Message-Id: 1603699288.4364658df0ff6f92297648a32dbd28efac732e80.gyakovlev@gentoo
1 commit: 4364658df0ff6f92297648a32dbd28efac732e80
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 26 08:00:00 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 26 08:01:28 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4364658d
7
8 net-im/telegram-desktop: bump to 2.4.4
9
10 webrtc is imposibble to turn off for now, unfortunately.
11 webrtc alsa and pulseaudio will be forced on for now.
12 add system-rlottie useflag.
13
14 for now tg_owt bundles the following:
15 openh264
16 abseil-cpp
17 libsrtp
18 libvpx
19 libyuv
20 pffft
21 rnnoise
22 usrsctp
23
24 Bug: https://bugs.gentoo.org/736774
25 Bug: https://bugs.gentoo.org/749288
26 Closes: https://bugs.gentoo.org/739466
27 Closes: https://bugs.gentoo.org/707272
28 Package-Manager: Portage-3.0.8, Repoman-3.0.2
29 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
30
31 net-im/telegram-desktop/Manifest | 2 +
32 net-im/telegram-desktop/metadata.xml | 2 +
33 .../telegram-desktop/telegram-desktop-2.4.4.ebuild | 184 +++++++++++++++++++++
34 3 files changed, 188 insertions(+)
35
36 diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest
37 index 23c15929c96..21d78ca38a6 100644
38 --- a/net-im/telegram-desktop/Manifest
39 +++ b/net-im/telegram-desktop/Manifest
40 @@ -1,2 +1,4 @@
41 DIST tdesktop-2.1.13-full.tar.gz 36549505 BLAKE2B 48514be8add4ad4491c8e81a868f140228787ee489de7cd90faf31dbee959b0fb87cf2c844bf98c5b62fd6de8e32f504a6d19b071c56e6a4c0cd489d7b283818 SHA512 f28ae7c8c9a9eb8094fc52784742b470235234a3df7487902152858bc7c297b2dcfe5c8b939cdb9653a356b3835609e7289f53cdf7d5fb3f009823d3dbeb1bd8
42 DIST tdesktop-2.2.0-full.tar.gz 36612169 BLAKE2B dcc9d81da5d99552bea3139d595c7f1aca75464a19be34c880a93d27ddd8a58a01510efe8fde31104b13d50e34e944b05406e21bc96995e85cb95283ff8de08a SHA512 2aeca83be7bc385bd7537d56ecf66996facedd0af588e743fedbb08c3158fc76436d6cf3b1fb5dd7c8d37b4471f739872ca54ba300aa1d0e0202e87c005703fd
43 +DIST tdesktop-2.4.4-full.tar.gz 36220573 BLAKE2B 2c339e576cdc8877fee7966c34b3ea0119c547422c67af3252102a52de95b9b03c2ecee48a0e937cb1cac43262338aca9d90921012dec17dc4f9b6a9154c63c1 SHA512 db212cc9aef7de21e4e4fa30fdabb88224cda5ab164935de118cab507af730f5773602f8cd7acd83a53daa5bf35fe28fdb18fb192c01e2e484069a9ac69c7c57
44 +DIST tg_owt-c73a4718cbff7048373a63db32068482e5fd11ef.tar.gz 18389536 BLAKE2B 467bc980c3fe924b8753153052126c209984884b43d2257b0a9ead4abd9b27c96c9b6f93b1e1345abde5a23feef8b40d05f75eb95fb215783ec8d775dbcc14eb SHA512 b022e77bc3ebce0a42bd40f781b5ff2b8222f44c9ebacb8f6d5581fe04fa7bbb6faf29ee9a090da3aee322bc581feeab375b2ab6dd9aab084627327b191c1d7a
45
46 diff --git a/net-im/telegram-desktop/metadata.xml b/net-im/telegram-desktop/metadata.xml
47 index 5eb4b12ceaa..487d6100c6b 100644
48 --- a/net-im/telegram-desktop/metadata.xml
49 +++ b/net-im/telegram-desktop/metadata.xml
50 @@ -8,5 +8,7 @@
51 <use>
52 <flag name="enchant">Enable the app-text/aspell spell-checking backend</flag>
53 <flag name="hunspell">Enable the app-text/hunspell spell-checking backend</flag>
54 + <flag name="system-rlottie">Use system version of <pkg>media-libs/rlottie</pkg> ( may alter sticker color )</flag>
55 + <flag name="webrtc">WebRTC based video call support</flag>
56 </use>
57 </pkgmetadata>
58
59 diff --git a/net-im/telegram-desktop/telegram-desktop-2.4.4.ebuild b/net-im/telegram-desktop/telegram-desktop-2.4.4.ebuild
60 new file mode 100644
61 index 00000000000..6f411ab81e1
62 --- /dev/null
63 +++ b/net-im/telegram-desktop/telegram-desktop-2.4.4.ebuild
64 @@ -0,0 +1,184 @@
65 +# Copyright 2020 Gentoo Authors
66 +# Distributed under the terms of the GNU General Public License v2
67 +
68 +EAPI=7
69 +
70 +CMAKE_MAKEFILE_GENERATOR="ninja"
71 +PYTHON_COMPAT=( python3_{7,8,9} )
72 +
73 +inherit cmake desktop flag-o-matic ninja-utils python-any-r1 xdg-utils
74 +
75 +MY_P="tdesktop-${PV}-full"
76 +TG_OWT_COMMIT="c73a4718cbff7048373a63db32068482e5fd11ef"
77 +
78 +DESCRIPTION="Official desktop client for Telegram"
79 +HOMEPAGE="https://desktop.telegram.org"
80 +SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz
81 + webrtc? (
82 + https://github.com/desktop-app/tg_owt/archive/c73a4718cbff7048373a63db32068482e5fd11ef.tar.gz -> tg_owt-${TG_OWT_COMMIT}.tar.gz
83 + )
84 +"
85 +
86 +LICENSE="GPL-3-with-openssl-exception LGPL-2+
87 + !system-rlottie? ( BSD FTL JSON MIT )
88 + webrtc? ( BSD )
89 +"
90 +SLOT="0"
91 +KEYWORDS="~amd64 ~ppc64"
92 +IUSE="+alsa +dbus enchant +gtk +hunspell libressl +pulseaudio +spell system-rlottie +webrtc +X"
93 +
94 +RDEPEND="
95 + !net-im/telegram-desktop-bin
96 + app-arch/lz4:=
97 + app-arch/xz-utils
98 + !libressl? ( dev-libs/openssl:0= )
99 + libressl? ( dev-libs/libressl:0= )
100 + dev-libs/xxhash
101 + dev-qt/qtcore:5
102 + dev-qt/qtgui:5[dbus?,jpeg,png,wayland,X(-)?]
103 + dev-qt/qtimageformats:5
104 + dev-qt/qtnetwork:5
105 + dev-qt/qtsvg:5
106 + dev-qt/qtwidgets:5[png,X(-)?]
107 + media-fonts/open-sans
108 + media-libs/fontconfig:=
109 + ~media-libs/libtgvoip-2.4.4_p20200818[alsa?,pulseaudio?]
110 + media-libs/openal[alsa?,pulseaudio?]
111 + media-libs/opus:=
112 + media-video/ffmpeg:=[alsa?,opus,pulseaudio?]
113 + sys-libs/zlib[minizip]
114 + virtual/libiconv
115 + x11-libs/libxcb:=
116 + dbus? (
117 + dev-qt/qtdbus:5
118 + dev-libs/libdbusmenu-qt[qt5(+)]
119 + )
120 + enchant? ( app-text/enchant:= )
121 + gtk? (
122 + dev-libs/glib:2
123 + x11-libs/gdk-pixbuf:2[jpeg,X?]
124 + x11-libs/gtk+:3[X?]
125 + x11-libs/libX11
126 + )
127 + hunspell? ( >=app-text/hunspell-1.7:= )
128 + pulseaudio? ( media-sound/pulseaudio )
129 + webrtc? ( media-libs/libjpeg-turbo:= )
130 + system-rlottie? ( media-libs/rlottie:= )
131 +"
132 +
133 +DEPEND="
134 + ${PYTHON_DEPS}
135 + ${RDEPEND}
136 + dev-cpp/range-v3
137 + =dev-cpp/ms-gsl-3*
138 +"
139 +
140 +BDEPEND="
141 + >=dev-util/cmake-3.16
142 + virtual/pkgconfig
143 + webrtc? ( amd64? ( dev-lang/yasm ) )
144 +"
145 +
146 +REQUIRED_USE="
147 + || ( alsa pulseaudio )
148 + spell? (
149 + ^^ ( enchant hunspell )
150 + )
151 + webrtc? ( alsa pulseaudio )
152 +"
153 +
154 +S="${WORKDIR}/${MY_P}"
155 +
156 +pkg_pretend() {
157 + if has ccache ${FEATURES}; then
158 + ewarn
159 + ewarn "ccache does not work with ${PN} out of the box"
160 + ewarn "due to usage of precompiled headers"
161 + ewarn "check bug https://bugs.gentoo.org/715114 for more info"
162 + ewarn
163 + fi
164 +}
165 +
166 +src_unpack() {
167 + default
168 + use webrtc && mv -v "${WORKDIR}/tg_owt-${TG_OWT_COMMIT}" "${WORKDIR}/tg_owt"
169 +}
170 +
171 +build_tg_owt() {
172 + einfo "Building tg_owt / webrtc"
173 + mkdir -v "${WORKDIR}/tg_owt_build" || die
174 + pushd "${WORKDIR}/tg_owt_build" > /dev/null || die
175 + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DTG_OWT_PACKAGED_BUILD=ON ../tg_owt || die
176 + eninja
177 + popd > /dev/null || die
178 +}
179 +
180 +src_configure() {
181 + local mycxxflags=(
182 + -Wno-deprecated-declarations
183 + -Wno-error=deprecated-declarations
184 + -Wno-switch
185 + )
186 +
187 + append-cxxflags "${mycxxflags[@]}"
188 +
189 + # we have to build tg_owt now before running telegram's cmake
190 + use webrtc && build_tg_owt
191 +
192 + # TODO: unbundle header-only libs, ofc telegram uses git versions...
193 + # it fals with tl-expected-1.0.0, so we use bundled for now to avoid git rev snapshots
194 + # EXPECTED VARIANT
195 + # gtk is really needed for image copy-paste due to https://bugreports.qt.io/browse/QTBUG-56595
196 + local mycmakeargs=(
197 + -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON
198 + -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF
199 + -DDESKTOP_APP_USE_PACKAGED=ON
200 + -DDESKTOP_APP_USE_PACKAGED_FONTS=ON
201 + -DDESKTOP_APP_LOTTIE_USE_CACHE=$(usex system-rlottie OFF ON) # we disable cache with system rlottie
202 + -DTDESKTOP_DISABLE_GTK_INTEGRATION="$(usex gtk OFF ON)"
203 + -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
204 + -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION="$(usex dbus OFF ON)"
205 + -DDESKTOP_APP_DISABLE_SPELLCHECK="$(usex spell OFF ON)" # enables hunspell (recommended)
206 + -DDESKTOP_APP_DISABLE_WEBRTC_INTEGRATION="$(usex webrtc OFF ON)" # requires pulse AND alsa
207 + -DDESKTOP_APP_USE_ENCHANT="$(usex enchant ON OFF)" # enables enchant and disables hunspell
208 + $(usex webrtc "-Dtg_owt_DIR=${WORKDIR}/tg_owt_build" '')
209 + )
210 +
211 + if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
212 + einfo "Found custom API credentials"
213 + mycmakeargs+=(
214 + -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
215 + -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
216 + )
217 + else
218 + # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
219 + # Building with snapcraft API credentials by default
220 + # Custom API credentials can be obtained here:
221 + # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
222 + # After getting credentials you can export variables:
223 + # export MY_TDESKTOP_API_ID="17349""
224 + # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
225 + # and restart the build"
226 + # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
227 + # portage will use custom variable every build automatically
228 + mycmakeargs+=(
229 + -DTDESKTOP_API_ID="611335"
230 + -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
231 + )
232 + fi
233 +
234 + cmake_src_configure
235 +}
236 +
237 +pkg_postinst() {
238 + xdg_desktop_database_update
239 + xdg_icon_cache_update
240 + xdg_mimeinfo_database_update
241 + use gtk || einfo "enable 'gtk' useflag if you have image copy-paste problems"
242 +}
243 +
244 +pkg_postrm() {
245 + xdg_desktop_database_update
246 + xdg_icon_cache_update
247 + xdg_mimeinfo_database_update
248 +}