1 |
commit: bf3c82dd6095765570a18a2c39282c485d5dcf4a |
2 |
Author: Esteve Varela Colominas <esteve.varela <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Jul 29 11:17:33 2022 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 2 22:07:21 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf3c82dd |
7 |
|
8 |
net-im/telegram-desktop: Bump to 4.0.2 |
9 |
|
10 |
Turns out they never really dropped Qt5 support, only for some wayland |
11 |
integrations. I've tried to research what this means but I actually have |
12 |
no idea beyond some mentions of "xdg-shell". |
13 |
|
14 |
This is why I warn about it in the postinst, even if it may not be |
15 |
meaningful... |
16 |
|
17 |
Debian ships the package the same way. |
18 |
|
19 |
Signed-off-by: Esteve Varela Colominas <esteve.varela <AT> gmail.com> |
20 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
21 |
|
22 |
net-im/telegram-desktop/Manifest | 1 + |
23 |
net-im/telegram-desktop/metadata.xml | 1 + |
24 |
.../telegram-desktop/telegram-desktop-4.0.2.ebuild | 182 +++++++++++++++++++++ |
25 |
3 files changed, 184 insertions(+) |
26 |
|
27 |
diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest |
28 |
index 5e1ddfb6238b..480b5e46f4e2 100644 |
29 |
--- a/net-im/telegram-desktop/Manifest |
30 |
+++ b/net-im/telegram-desktop/Manifest |
31 |
@@ -1,2 +1,3 @@ |
32 |
DIST tdesktop-3.5.2-full.tar.gz 41216346 BLAKE2B 5f2570073e02c5aadbf5f9b6251f9b71e9a608d97763bd3a792d3c4836b68245410142face3446660b68e519bd7e71df0319cb1ff1ea1fed24327ac8db0e8d0b SHA512 adb95fb37fedba6344107e4dd789b88563e24e6a01c7b944d9e5365ceccff60d774eb31a2c1e39cd200ef6de83317fe654956cfecaa1e13c7b2fdbf4c38f057e |
33 |
DIST tdesktop-3.6.1-full.tar.gz 41226549 BLAKE2B 6922ae015e36f86597aaedf1212ed951d6313a8f5f76a8838ab7ef9e02afe0cbc428acd991488190bafdf28faf2a69a09a5a1e963b2aa6ed27ef941602e15d88 SHA512 dd216c720ea3b1c72669805bb31319746a7ddfe746d188bf2ae0c5cdf0a10b379fc2e888a26fe755d77381fc5d9aa638cedc76b2dce1f1126a9c1ef9c02da2ba |
34 |
+DIST tdesktop-4.0.2-full.tar.gz 41059443 BLAKE2B da4efb15c8a2d11719d3aa56c3a40b12f70c37577d2909c43e6029e10ca0bb1f8445ed68ed9acd532009c8e0a8f48fa13d2a51573a81f58a8a83b13427ffb631 SHA512 0078b627d06dd8e655bd2bcc222ecbb3b15b7d88f858810bccdca84793ad02a60f4a4bf3808838752d65d4f6cffa3ddb5f70c5afc8e94cb6edae52101362feeb |
35 |
|
36 |
diff --git a/net-im/telegram-desktop/metadata.xml b/net-im/telegram-desktop/metadata.xml |
37 |
index 3f9fa364ab61..102293a68d35 100644 |
38 |
--- a/net-im/telegram-desktop/metadata.xml |
39 |
+++ b/net-im/telegram-desktop/metadata.xml |
40 |
@@ -12,5 +12,6 @@ |
41 |
<use> |
42 |
<flag name="enchant">Enable the app-text/aspell spell-checking backend</flag> |
43 |
<flag name="hunspell">Enable the app-text/hunspell spell-checking backend</flag> |
44 |
+ <flag name="qt6">Build with Qt6 support</flag> |
45 |
</use> |
46 |
</pkgmetadata> |
47 |
|
48 |
diff --git a/net-im/telegram-desktop/telegram-desktop-4.0.2.ebuild b/net-im/telegram-desktop/telegram-desktop-4.0.2.ebuild |
49 |
new file mode 100644 |
50 |
index 000000000000..930d3d186fc3 |
51 |
--- /dev/null |
52 |
+++ b/net-im/telegram-desktop/telegram-desktop-4.0.2.ebuild |
53 |
@@ -0,0 +1,182 @@ |
54 |
+# Copyright 2020-2022 Gentoo Authors |
55 |
+# Distributed under the terms of the GNU General Public License v2 |
56 |
+ |
57 |
+EAPI=8 |
58 |
+ |
59 |
+PYTHON_COMPAT=( python3_{8..11} ) |
60 |
+ |
61 |
+inherit xdg cmake python-any-r1 optfeature |
62 |
+ |
63 |
+DESCRIPTION="Official desktop client for Telegram" |
64 |
+HOMEPAGE="https://desktop.telegram.org" |
65 |
+ |
66 |
+MY_P="tdesktop-${PV}-full" |
67 |
+SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz" |
68 |
+S="${WORKDIR}/${MY_P}" |
69 |
+ |
70 |
+LICENSE="BSD GPL-3-with-openssl-exception LGPL-2+" |
71 |
+SLOT="0" |
72 |
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv" |
73 |
+IUSE="+dbus enchant +hunspell +jemalloc screencast +spell qt6 wayland +X" |
74 |
+REQUIRED_USE=" |
75 |
+ spell? ( |
76 |
+ ^^ ( enchant hunspell ) |
77 |
+ ) |
78 |
+" |
79 |
+ |
80 |
+RDEPEND=" |
81 |
+ !net-im/telegram-desktop-bin |
82 |
+ app-arch/lz4:= |
83 |
+ dev-cpp/abseil-cpp:= |
84 |
+ dev-libs/libdispatch |
85 |
+ dev-libs/openssl:= |
86 |
+ dev-libs/xxhash |
87 |
+ media-fonts/open-sans |
88 |
+ media-libs/fontconfig:= |
89 |
+ ~media-libs/libtgvoip-2.4.4_p20220503 |
90 |
+ media-libs/openal |
91 |
+ media-libs/opus:= |
92 |
+ media-libs/rnnoise |
93 |
+ ~media-libs/tg_owt-0_pre20220507[screencast=,X=] |
94 |
+ media-video/ffmpeg:=[opus] |
95 |
+ sys-libs/zlib:=[minizip] |
96 |
+ dbus? ( dev-cpp/glibmm:2 ) |
97 |
+ enchant? ( app-text/enchant:= ) |
98 |
+ hunspell? ( >=app-text/hunspell-1.7:= ) |
99 |
+ jemalloc? ( dev-libs/jemalloc:=[-lazy-lock] ) |
100 |
+ !qt6? ( |
101 |
+ >=dev-qt/qtcore-5.15:5 |
102 |
+ >=dev-qt/qtgui-5.15:5[dbus?,jpeg,png,wayland?,X?] |
103 |
+ >=dev-qt/qtimageformats-5.15:5 |
104 |
+ >=dev-qt/qtnetwork-5.15:5[ssl] |
105 |
+ >=dev-qt/qtsvg-5.15:5 |
106 |
+ >=dev-qt/qtwidgets-5.15:5[png,X?] |
107 |
+ ) |
108 |
+ qt6? ( |
109 |
+ dev-qt/qtbase:6[dbus?,gui,network,opengl,widgets,X?] |
110 |
+ dev-qt/qtsvg:6 |
111 |
+ dev-qt/qt5compat:6 |
112 |
+ wayland? ( dev-qt/qtwayland:6 ) |
113 |
+ ) |
114 |
+ X? ( x11-libs/libxcb:= ) |
115 |
+" |
116 |
+DEPEND="${RDEPEND} |
117 |
+ dev-cpp/range-v3 |
118 |
+ =dev-cpp/ms-gsl-3* |
119 |
+" |
120 |
+BDEPEND=" |
121 |
+ ${PYTHON_DEPS} |
122 |
+ >=dev-util/cmake-3.16 |
123 |
+ virtual/pkgconfig |
124 |
+" |
125 |
+# dev-libs/jemalloc:=[-lazy-lock] -> https://bugs.gentoo.org/803233 |
126 |
+ |
127 |
+PATCHES=( |
128 |
+ "${FILESDIR}/tdesktop-3.6.0-jemalloc-only-telegram.patch" |
129 |
+ "${FILESDIR}/tdesktop-3.3.0-fix-enchant.patch" |
130 |
+ "${FILESDIR}/tdesktop-3.5.2-musl.patch" |
131 |
+) |
132 |
+ |
133 |
+# Current desktop-file-utils-0.26 does not understand Version=1.5 |
134 |
+QA_DESKTOP_FILE="usr/share/applications/${PN}.desktop" |
135 |
+ |
136 |
+pkg_pretend() { |
137 |
+ if has ccache ${FEATURES}; then |
138 |
+ ewarn "ccache does not work with ${PN} out of the box" |
139 |
+ ewarn "due to usage of precompiled headers" |
140 |
+ ewarn "check bug https://bugs.gentoo.org/715114 for more info" |
141 |
+ ewarn |
142 |
+ fi |
143 |
+ if use qt6; then |
144 |
+ ewarn "Qt6 support in gentoo is experimental." |
145 |
+ ewarn "Please report any issues you may find, but don't expect" |
146 |
+ ewarn "everything to work correctly as of yet." |
147 |
+ ewarn "Qt6 ebuilds are available in the ::qt overlay." |
148 |
+ ewarn |
149 |
+ fi |
150 |
+} |
151 |
+ |
152 |
+src_prepare() { |
153 |
+ # no explicit toggle, doesn't build with the system one #752417 |
154 |
+ sed -i 's/DESKTOP_APP_USE_PACKAGED/NO_ONE_WILL_EVER_SET_THIS/' \ |
155 |
+ cmake/external/rlottie/CMakeLists.txt || die |
156 |
+ |
157 |
+ cmake_src_prepare |
158 |
+} |
159 |
+ |
160 |
+src_configure() { |
161 |
+ # DESKTOP_APP_DISABLE_JEMALLOC is heavily discouraged by upstream, as the |
162 |
+ # glibc allocator results in high memory usage. |
163 |
+ # https://github.com/telegramdesktop/tdesktop/issues/16084 |
164 |
+ # https://github.com/desktop-app/cmake_helpers/pull/91#issuecomment-881788003 |
165 |
+ |
166 |
+ # DESKTOP_APP_QT6=OFF force-enables DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION |
167 |
+ # This means that REQUIRED_USE="wayland? ( qt6 )", but a lot of people |
168 |
+ # enable USE=wayland globally, so we instead silently disable it... |
169 |
+ |
170 |
+ local mycmakeargs=( |
171 |
+ -DTDESKTOP_LAUNCHER_BASENAME="${PN}" |
172 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_tl-expected=ON # header only lib, some git version. prevents warnings. |
173 |
+ -DDESKTOP_APP_QT6=$(usex qt6) |
174 |
+ |
175 |
+ -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex !dbus) |
176 |
+ -DDESKTOP_APP_DISABLE_X11_INTEGRATION=$(usex !X) |
177 |
+ -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=$(usex !wayland) |
178 |
+ -DDESKTOP_APP_DISABLE_JEMALLOC=$(usex !jemalloc) |
179 |
+ -DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex !spell) # enables hunspell (recommended) |
180 |
+ -DDESKTOP_APP_USE_ENCHANT=$(usex enchant) # enables enchant and disables hunspell |
181 |
+ ) |
182 |
+ |
183 |
+ if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then |
184 |
+ einfo "Found custom API credentials" |
185 |
+ mycmakeargs+=( |
186 |
+ -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}" |
187 |
+ -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}" |
188 |
+ ) |
189 |
+ else |
190 |
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml |
191 |
+ # Building with snapcraft API credentials by default |
192 |
+ # Custom API credentials can be obtained here: |
193 |
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md |
194 |
+ # After getting credentials you can export variables: |
195 |
+ # export MY_TDESKTOP_API_ID="17349"" |
196 |
+ # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb" |
197 |
+ # and restart the build" |
198 |
+ # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop |
199 |
+ # portage will use custom variable every build automatically |
200 |
+ mycmakeargs+=( |
201 |
+ -DTDESKTOP_API_ID="611335" |
202 |
+ -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c" |
203 |
+ ) |
204 |
+ fi |
205 |
+ |
206 |
+ cmake_src_configure |
207 |
+} |
208 |
+ |
209 |
+pkg_postinst() { |
210 |
+ xdg_pkg_postinst |
211 |
+ if ! use X && ! use screencast; then |
212 |
+ elog "both the 'X' and 'screencast' useflags are disabled, screen sharing won't work!" |
213 |
+ elog |
214 |
+ fi |
215 |
+ if has_version '<dev-qt/qtcore-5.15.2-r10'; then |
216 |
+ ewarn "Versions of dev-qt/qtcore lower than 5.15.2-r10 might cause telegram" |
217 |
+ ewarn "to crash when pasting big images from the clipboard." |
218 |
+ ewarn |
219 |
+ fi |
220 |
+ if ! use jemalloc && use elibc_glibc; then |
221 |
+ ewarn "Disabling USE=jemalloc on glibc systems may cause very high RAM usage!" |
222 |
+ ewarn "Do NOT report issues about RAM usage without enabling this flag first." |
223 |
+ ewarn |
224 |
+ fi |
225 |
+ if use wayland && ! use qt6; then |
226 |
+ ewarn "Wayland-specific integrations have been deprecated with Qt5." |
227 |
+ ewarn "The app will continue to function under wayland, but some" |
228 |
+ ewarn "functionality may be reduced." |
229 |
+ ewarn "These integrations are only supported when built with Qt6," |
230 |
+ ewarn "which isn't available in ::gentoo as of writing." |
231 |
+ ewarn |
232 |
+ fi |
233 |
+ optfeature_header |
234 |
+ optfeature "shop payment support (requires USE=dbus enabled)" net-libs/webkit-gtk |
235 |
+} |