From 752d6256e5204b958b0ef7905675a940b5e9172f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 May 2022 16:42:50 +0300 Subject: gentoo resync : 12.05.2022 --- net-im/telegram-desktop/Manifest | 3 +- .../files/tdesktop-3.6.1-fix-use-after-free.patch | 44 ++++++ .../telegram-desktop-3.6.1-r1.ebuild | 165 +++++++++++++++++++++ .../telegram-desktop/telegram-desktop-3.6.1.ebuild | 164 -------------------- 4 files changed, 211 insertions(+), 165 deletions(-) create mode 100644 net-im/telegram-desktop/files/tdesktop-3.6.1-fix-use-after-free.patch create mode 100644 net-im/telegram-desktop/telegram-desktop-3.6.1-r1.ebuild delete mode 100644 net-im/telegram-desktop/telegram-desktop-3.6.1.ebuild (limited to 'net-im/telegram-desktop') diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest index 85da54cbaf81..9d264a6d50fb 100644 --- a/net-im/telegram-desktop/Manifest +++ b/net-im/telegram-desktop/Manifest @@ -5,8 +5,9 @@ AUX tdesktop-3.5.2-musl.patch 890 BLAKE2B e65419eac920eb7c6929559229e50458fca0e9 AUX tdesktop-3.6.0-jemalloc-only-telegram.patch 1343 BLAKE2B bc257ee3bc3577b05a73b74c6394592b4636e605eb06c25a6749a38f2742104e1d214234524cbd5191bb397b22a4af4ba28c25c01520973a4f10e08bf3ba3bd2 SHA512 00067d388bd75adfcf7f2f460d99c283dd0110d33be5124585665b2566ef5c2b15100e8f86685bde2216083131609918861d7db845f4813ec303a13d8c423ae7 AUX tdesktop-3.6.0-support-ffmpeg5.patch 3142 BLAKE2B f05816a8b26c3061c88b8814adc2402981836ab7853be1dad9c4eb74b621e1084a2167ad5ea86d500c98d627317ffd48288bcb4df897f5ca6858516ecf86c8f0 SHA512 811f42f8372102910be20ac92030b98ad98704cb1378a90d17a01b15dc4a9aa8e9b6bb179a9dc4d09687ad7b60030f0f7367f8058674244b080748bf2c913044 AUX tdesktop-3.6.1-fix-kwayland-5.93.patch 1835 BLAKE2B dbc414e1543be96faff179288eb4bcc4acdfbe280ae51da11d254054adcc00f4c1387cdc9a24e026e06612d55765a1689b4bfc6381349b75053c4156a0cff71f SHA512 82855396f367f3669a34246a031626bba158d5361ec39e728c2d33f0d5b9ff5196c38a33551614848b5d439e25bbe45eb3795eaf7ca7442f5f27ab0bdeb0e72e +AUX tdesktop-3.6.1-fix-use-after-free.patch 1627 BLAKE2B 867dde2d1d8d6535e2305f841fe97477bd08c37e96684196563f9ce6dbfb12c7b2941ddc3e00182126e24ec08e1692ec201006d2c46548fcbf2f9bae09dca532 SHA512 e52369b6aee6c772bef56b73cf4656813614694af714eb83432ffbe7a2234dde4be9888e927c1304350c5c31a0a9cf37a53ea41df2e9b47a00de6dc4433a1c1b DIST tdesktop-3.5.2-full.tar.gz 41216346 BLAKE2B 5f2570073e02c5aadbf5f9b6251f9b71e9a608d97763bd3a792d3c4836b68245410142face3446660b68e519bd7e71df0319cb1ff1ea1fed24327ac8db0e8d0b SHA512 adb95fb37fedba6344107e4dd789b88563e24e6a01c7b944d9e5365ceccff60d774eb31a2c1e39cd200ef6de83317fe654956cfecaa1e13c7b2fdbf4c38f057e DIST tdesktop-3.6.1-full.tar.gz 41226549 BLAKE2B 6922ae015e36f86597aaedf1212ed951d6313a8f5f76a8838ab7ef9e02afe0cbc428acd991488190bafdf28faf2a69a09a5a1e963b2aa6ed27ef941602e15d88 SHA512 dd216c720ea3b1c72669805bb31319746a7ddfe746d188bf2ae0c5cdf0a10b379fc2e888a26fe755d77381fc5d9aa638cedc76b2dce1f1126a9c1ef9c02da2ba EBUILD telegram-desktop-3.5.2-r1.ebuild 4944 BLAKE2B 7a9ab13b3120d9ee38c20bd36594f6a1baa5eab19ce8f4191823520b693745fdffaa64d153e72216c02f9272bf0ee461d9ef664f8878323856fe3c812301f04e SHA512 0d48d09e1ebb41c480df1ba0f101b7233c17950430bb15b64a249ff25400b31422f6799c00d6e1191616279b7738e1120caab94f43fb2bc97a8e55459ebc0c3c -EBUILD telegram-desktop-3.6.1.ebuild 4954 BLAKE2B d411d55e4968cac40b000a372949ba7dca6afbcec68a771d417f6fde6ed8498bb9b24551d58ca23c93854879b8f54b3db69509d3e880e842104b0f0809f50d2f SHA512 bede5762e1a5352c01794b5fba1715bb3eab8ebe68e328a17e7302a7db3397e37f133a2b8f93fcba404570eb8ceddd02931ace32979617f9b31b0e793e8e8f48 +EBUILD telegram-desktop-3.6.1-r1.ebuild 5008 BLAKE2B 9353cb74512081bfdc765d0c922b337cd84414115335c7955251688ecf49cf60cf61860ab4f3a7bdc2c67f97df6c387a7398ebe8b49a810567f61437cdb87c89 SHA512 20ccf714e586516970020f6a57138edde91edefed62499f254ff8533e5bb5a4bd48679e145667356f6a0989764dfe6b0f8fff21e66f8bdf3a1eca37fe5c1d652 MISC metadata.xml 709 BLAKE2B 02eee6916528198d1b28ebf883f84a94cb979f507d559d74e1b9a4e4f7b8b82930fd19a30c2f86a3e71ec2b6aa93e7836faf64ab23e23c59850b5b5260b305e8 SHA512 3c26cde38da1cb3e6700b52a50bb91d1b41230b89f7603d19d25156a1ae53603906cbf94b3257e189c6d24b5cd5627729b652ed412d9c3ac94dedbde5a721f5e diff --git a/net-im/telegram-desktop/files/tdesktop-3.6.1-fix-use-after-free.patch b/net-im/telegram-desktop/files/tdesktop-3.6.1-fix-use-after-free.patch new file mode 100644 index 000000000000..5a8e6ceedd66 --- /dev/null +++ b/net-im/telegram-desktop/files/tdesktop-3.6.1-fix-use-after-free.patch @@ -0,0 +1,44 @@ +Description: Do not capture buttons in AccountsList that belong to inner VerticalLayout widget + This fixes a use-after-free error (double destruction) in the main menu right after account switching. +Bug-Debian: https://bugs.debian.org/1008156 +Bug-Ubuntu: https://launchpad.net/bugs/1967673 +Forwarded: https://github.com/telegramdesktop/tdesktop/pull/24301 +Author: Nicholas Guriev +Last-Update: Sat, 09 Apr 2022 13:47:55 +0300 + +--- tdesktop-3.6.1-full.orig/Telegram/SourceFiles/settings/settings_information.cpp ++++ tdesktop-3.6.1-full/Telegram/SourceFiles/settings/settings_information.cpp +@@ -78,9 +78,7 @@ + int _outerIndex = 0; + + Ui::SlideWrap *_addAccount = nullptr; +- base::flat_map< +- not_null, +- base::unique_qptr> _watched; ++ base::flat_map, Ui::SettingsButton*> _watched; + + base::unique_qptr _contextMenu; + std::unique_ptr _reorder; +@@ -730,7 +728,7 @@ + order.reserve(inner->count()); + for (auto i = 0; i < inner->count(); i++) { + for (const auto &[account, button] : _watched) { +- if (button.get() == inner->widgetAt(i)) { ++ if (button == inner->widgetAt(i)) { + order.push_back(account->session().uniqueId()); + } + } +@@ -769,11 +767,11 @@ + account, + std::move(activate)); + }; +- button.reset(inner->add(MakeAccountButton( ++ button = inner->add(MakeAccountButton( + inner, + _controller, + account, +- std::move(callback)))); ++ std::move(callback))); + } + } + inner->resizeToWidth(_outer->width()); diff --git a/net-im/telegram-desktop/telegram-desktop-3.6.1-r1.ebuild b/net-im/telegram-desktop/telegram-desktop-3.6.1-r1.ebuild new file mode 100644 index 000000000000..e17ba415be1e --- /dev/null +++ b/net-im/telegram-desktop/telegram-desktop-3.6.1-r1.ebuild @@ -0,0 +1,165 @@ +# Copyright 2020-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit xdg cmake python-any-r1 optfeature + +DESCRIPTION="Official desktop client for Telegram" +HOMEPAGE="https://desktop.telegram.org" + +MY_P="tdesktop-${PV}-full" +SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}" + +LICENSE="BSD GPL-3-with-openssl-exception LGPL-2+" +SLOT="0" +KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv" +IUSE="+dbus enchant +hunspell +jemalloc screencast +spell wayland +X" +REQUIRED_USE=" + spell? ( + ^^ ( enchant hunspell ) + ) +" + +RDEPEND=" + !net-im/telegram-desktop-bin + app-arch/lz4:= + dev-cpp/abseil-cpp:= + dev-libs/libdispatch + dev-libs/openssl:= + dev-libs/xxhash + >=dev-qt/qtcore-5.15:5 + >=dev-qt/qtgui-5.15:5[dbus?,jpeg,png,wayland?,X?] + >=dev-qt/qtimageformats-5.15:5 + >=dev-qt/qtnetwork-5.15:5[ssl] + >=dev-qt/qtsvg-5.15:5 + >=dev-qt/qtwidgets-5.15:5[png,X?] + media-fonts/open-sans + media-libs/fontconfig:= + ~media-libs/libtgvoip-2.4.4_p20220117 + media-libs/openal + media-libs/opus:= + media-libs/rnnoise + ~media-libs/tg_owt-0_pre20220209[screencast=,X=] + media-video/ffmpeg:=[opus] + sys-libs/zlib:=[minizip] + dbus? ( + dev-cpp/glibmm:2 + dev-qt/qtdbus:5 + dev-libs/libdbusmenu-qt[qt5(+)] + ) + enchant? ( app-text/enchant:= ) + hunspell? ( >=app-text/hunspell-1.7:= ) + jemalloc? ( dev-libs/jemalloc:=[-lazy-lock] ) + wayland? ( + dev-qt/qtwayland:= + kde-frameworks/kwayland:= + ) + X? ( x11-libs/libxcb:= ) +" +DEPEND="${RDEPEND} + dev-cpp/range-v3 + =dev-cpp/ms-gsl-3* +" +BDEPEND=" + ${PYTHON_DEPS} + >=dev-util/cmake-3.16 + virtual/pkgconfig +" +# dev-libs/jemalloc:=[-lazy-lock] -> https://bugs.gentoo.org/803233 + +PATCHES=( + "${FILESDIR}/tdesktop-3.6.0-jemalloc-only-telegram.patch" + "${FILESDIR}/tdesktop-3.3.0-fix-enchant.patch" + "${FILESDIR}/tdesktop-3.5.2-musl.patch" + "${FILESDIR}/tdesktop-3.6.0-support-ffmpeg5.patch" + "${FILESDIR}/tdesktop-3.6.1-fix-kwayland-5.93.patch" + "${FILESDIR}/tdesktop-3.6.1-fix-use-after-free.patch" +) + +# Current desktop-file-utils-0.26 does not understand Version=1.5 +QA_DESKTOP_FILE="usr/share/applications/${PN}.desktop" + +pkg_pretend() { + if has ccache ${FEATURES}; then + ewarn + ewarn "ccache does not work with ${PN} out of the box" + ewarn "due to usage of precompiled headers" + ewarn "check bug https://bugs.gentoo.org/715114 for more info" + ewarn + fi +} + +src_prepare() { + # no explicit toggle, doesn't build with the system one #752417 + sed -i 's/DESKTOP_APP_USE_PACKAGED/NO_ONE_WILL_EVER_SET_THIS/' \ + cmake/external/rlottie/CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DTDESKTOP_LAUNCHER_BASENAME="${PN}" + -DCMAKE_DISABLE_FIND_PACKAGE_tl-expected=ON # header only lib, some git version. prevents warnings. + -DDESKTOP_APP_QT6=OFF + + -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex !dbus) + -DDESKTOP_APP_DISABLE_X11_INTEGRATION=$(usex !X) + -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=$(usex !wayland) + -DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex !spell) # enables hunspell (recommended) + -DDESKTOP_APP_USE_ENCHANT=$(usex enchant) # enables enchant and disables hunspell + + # This option is heavily discouraged by upstream. + # See files/tdesktop-*-jemalloc-optional.patch + -DDESKTOP_APP_DISABLE_JEMALLOC=$(usex !jemalloc) + ) + + if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then + einfo "Found custom API credentials" + mycmakeargs+=( + -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}" + -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}" + ) + else + # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml + # Building with snapcraft API credentials by default + # Custom API credentials can be obtained here: + # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md + # After getting credentials you can export variables: + # export MY_TDESKTOP_API_ID="17349"" + # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb" + # and restart the build" + # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop + # portage will use custom variable every build automatically + mycmakeargs+=( + -DTDESKTOP_API_ID="611335" + -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c" + ) + fi + + cmake_src_configure +} + +pkg_postinst() { + xdg_pkg_postinst + if ! use X && ! use screencast; then + elog "both the 'X' and 'screencast' useflags are disabled, screen sharing won't work!" + elog + fi + if has_version ' https://bugs.gentoo.org/803233 - -PATCHES=( - "${FILESDIR}/tdesktop-3.6.0-jemalloc-only-telegram.patch" - "${FILESDIR}/tdesktop-3.3.0-fix-enchant.patch" - "${FILESDIR}/tdesktop-3.5.2-musl.patch" - "${FILESDIR}/tdesktop-3.6.0-support-ffmpeg5.patch" - "${FILESDIR}/tdesktop-3.6.1-fix-kwayland-5.93.patch" -) - -# Current desktop-file-utils-0.26 does not understand Version=1.5 -QA_DESKTOP_FILE="usr/share/applications/${PN}.desktop" - -pkg_pretend() { - if has ccache ${FEATURES}; then - ewarn - ewarn "ccache does not work with ${PN} out of the box" - ewarn "due to usage of precompiled headers" - ewarn "check bug https://bugs.gentoo.org/715114 for more info" - ewarn - fi -} - -src_prepare() { - # no explicit toggle, doesn't build with the system one #752417 - sed -i 's/DESKTOP_APP_USE_PACKAGED/NO_ONE_WILL_EVER_SET_THIS/' \ - cmake/external/rlottie/CMakeLists.txt || die - - cmake_src_prepare -} - -src_configure() { - local mycmakeargs=( - -DTDESKTOP_LAUNCHER_BASENAME="${PN}" - -DCMAKE_DISABLE_FIND_PACKAGE_tl-expected=ON # header only lib, some git version. prevents warnings. - -DDESKTOP_APP_QT6=OFF - - -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex !dbus) - -DDESKTOP_APP_DISABLE_X11_INTEGRATION=$(usex !X) - -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=$(usex !wayland) - -DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex !spell) # enables hunspell (recommended) - -DDESKTOP_APP_USE_ENCHANT=$(usex enchant) # enables enchant and disables hunspell - - # This option is heavily discouraged by upstream. - # See files/tdesktop-*-jemalloc-optional.patch - -DDESKTOP_APP_DISABLE_JEMALLOC=$(usex !jemalloc) - ) - - if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then - einfo "Found custom API credentials" - mycmakeargs+=( - -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}" - -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}" - ) - else - # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml - # Building with snapcraft API credentials by default - # Custom API credentials can be obtained here: - # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md - # After getting credentials you can export variables: - # export MY_TDESKTOP_API_ID="17349"" - # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb" - # and restart the build" - # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop - # portage will use custom variable every build automatically - mycmakeargs+=( - -DTDESKTOP_API_ID="611335" - -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c" - ) - fi - - cmake_src_configure -} - -pkg_postinst() { - xdg_pkg_postinst - if ! use X && ! use screencast; then - elog "both the 'X' and 'screencast' useflags are disabled, screen sharing won't work!" - elog - fi - if has_version '