From d0dd5fbd1317b6a5357b3291b10a90d87ae6c24d Mon Sep 17 00:00:00 2001 From: Vadim Misbakh-Soloviov Date: Sun, 15 Oct 2023 03:04:15 +0700 Subject: [PATCH] net-im/telegram-desktop: some fixes Signed-off-by: Vadim Misbakh-Soloviov --- ..._tdesktop-4.10.3-fix-clang-libstdcxx.patch | 13 ++++ .../0000_exploit_through_monospace.patch | 13 ++++ .../0000_exploit_through_monospace.patch | 0 .../telegram-desktop-4.10.3.ebuild | 69 +++++++++++-------- .../telegram-desktop-9999.ebuild | 69 +++++++++++-------- 5 files changed, 110 insertions(+), 54 deletions(-) create mode 100644 net-im/telegram-desktop/files/patches/4.10.3/0006_tdesktop-4.10.3-fix-clang-libstdcxx.patch create mode 100644 net-im/telegram-desktop/files/patches/4.10.3/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch rename net-im/telegram-desktop/files/patches/{0 => 9999}/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch (100%) diff --git a/net-im/telegram-desktop/files/patches/4.10.3/0006_tdesktop-4.10.3-fix-clang-libstdcxx.patch b/net-im/telegram-desktop/files/patches/4.10.3/0006_tdesktop-4.10.3-fix-clang-libstdcxx.patch new file mode 100644 index 00000000..290eb2a6 --- /dev/null +++ b/net-im/telegram-desktop/files/patches/4.10.3/0006_tdesktop-4.10.3-fix-clang-libstdcxx.patch @@ -0,0 +1,13 @@ +Fix compilation with Clang + libstdc++ + +--- tdesktop-4.10.3-full.orig/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp ++++ tdesktop-4.10.3-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +@@ -814,7 +814,7 @@ + + // A list of capabilities that offer feature parity + // with custom notifications +- return ranges::all_of(std::initializer_list{ ++ return ranges::all_of(std::array{ + // To show message content + "body", + // To have buttons on notifications diff --git a/net-im/telegram-desktop/files/patches/4.10.3/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch b/net-im/telegram-desktop/files/patches/4.10.3/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch new file mode 100644 index 00000000..d1545ba8 --- /dev/null +++ b/net-im/telegram-desktop/files/patches/4.10.3/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch @@ -0,0 +1,13 @@ +--- a/Telegram/lib_ui/ui/text/text.cpp 2021-03-03 03:13:31.095340596 +0700 ++++ b/Telegram/lib_ui/ui/text/text.cpp 2021-03-03 03:14:44.720811463 +0700 +@@ -2791,10 +2791,6 @@ int String::countMaxMonospaceWidth() con + _width = (b->f_width() - last_rBearing); + continue; + } +- if (!(b->flags() & (TextBlockFPre | TextBlockFCode)) +- && (b->type() != TextBlockTSkip)) { +- fullMonospace = false; +- } + auto b__f_rbearing = b->f_rbearing(); // cache + + // We need to accumulate max width after each block, because diff --git a/net-im/telegram-desktop/files/patches/0/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch b/net-im/telegram-desktop/files/patches/9999/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch similarity index 100% rename from net-im/telegram-desktop/files/patches/0/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch rename to net-im/telegram-desktop/files/patches/9999/conditional/tdesktop_patches_wide-baloons/0000_exploit_through_monospace.patch diff --git a/net-im/telegram-desktop/telegram-desktop-4.10.3.ebuild b/net-im/telegram-desktop/telegram-desktop-4.10.3.ebuild index fc30800f..9ad81dab 100644 --- a/net-im/telegram-desktop/telegram-desktop-4.10.3.ebuild +++ b/net-im/telegram-desktop/telegram-desktop-4.10.3.ebuild @@ -33,7 +33,7 @@ fi LICENSE="GPL-3-with-openssl-exception" SLOT="0" #IUSE="custom-api-id debug enchant +hunspell +jemalloc lto pipewire pulseaudio qt6 qt6-imageformats +screencast system-gsl +system-expected +system-libtgvoip system-rlottie test +wayland +X" -IUSE="custom-api-id debug enchant +hunspell +jemalloc lto pipewire pulseaudio qt6 qt6-imageformats +screencast +system-libtgvoip test +wayland +X" +IUSE="custom-api-id debug enchant +hunspell +jemalloc lto pipewire pulseaudio qt6 qt6-imageformats +screencast +system-libtgvoip test +wayland +webkit +X" REQUIRED_USE=" ^^ ( enchant hunspell ) @@ -63,27 +63,27 @@ KIMAGEFORMATS_RDEPEND=" COMMON_DEPEND=" !net-im/telegram-desktop-bin app-arch/lz4:= - >=dev-cpp/glibmm-2.77:2.68= - >=dev-libs/glib-2.77:= - >=dev-libs/gobject-introspection-1.77:= - dev-libs/openssl:= - dev-libs/xxhash:= + dev-cpp/abseil-cpp:= + >=dev-cpp/glibmm-2.77:2.68 + >=dev-libs/glib-2.77:2 + >=dev-libs/gobject-introspection-1.77 dev-libs/libdispatch - dev-libs/libsigc++:2 - dev-libs/libfmt:= - media-fonts/open-sans - media-libs/fontconfig:= - media-libs/rnnoise:= - media-libs/libyuv:= + dev-libs/openssl:= + dev-libs/protobuf + dev-libs/xxhash + media-libs/libjpeg-turbo:= + system-libtgvoip? ( >media-libs/libtgvoip-2.4.4:=[pulseaudio(-)=,pipewire(-)=] ) media-libs/openal:=[pipewire=] media-libs/opus:= + media-libs/rnnoise:= media-video/ffmpeg:=[opus,vpx] sys-libs/zlib:=[minizip] + virtual/opengl + enchant? ( app-text/enchant:= ) + hunspell? ( >=app-text/hunspell-1.7:= ) jemalloc? ( dev-libs/jemalloc:=[-lazy-lock] ) !qt6? ( >=dev-qt/qtcore-5.15:5= - dev-qt/qtdbus:5= - dev-libs/libdbusmenu-qt[qt5(+)] >=dev-qt/qtgui-5.15:5=[dbus,jpeg,png,wayland?,X?] >=dev-qt/qtimageformats-5.15:5= >=dev-qt/qtnetwork-5.15:5=[ssl] @@ -93,14 +93,24 @@ COMMON_DEPEND=" wayland? ( dev-qt/qtwayland:5= ) + webkit? ( + >=dev-qt/qtdeclarative-5.15:5= + >=dev-qt/qtwayland-5.15:5= + ) + dev-qt/qtdbus:5= + dev-libs/libdbusmenu-qt[qt5(+)] ) qt6? ( - dev-qt/qtbase:6=[dbus,gui,network,opengl,widgets,X?] - dev-qt/qtimageformats:6= - dev-qt/qtsvg:6= - wayland? ( dev-qt/qtwayland:6= ) + >=dev-qt/qtbase-6.5:6=[dbus,gui,network,opengl,wayland?,widgets,X?] + >=dev-qt/qtimageformats-6.5:6= + >=dev-qt/qtsvg-6.5:6= + wayland? ( >=dev-qt/qtwayland-6.5:6=[compositor] ) + webkit? ( + >=dev-qt/qtdeclarative-6.5:6 + >=dev-qt/qtwayland-6.5:6[compositor] + ) qt6-imageformats? ( - dev-qt/qtimageformats:6= + >=dev-qt/qtimageformats-6.5:6= ${KIMAGEFORMATS_RDEPEND} ) ) @@ -108,6 +118,11 @@ COMMON_DEPEND=" x11-libs/libxcb:= x11-libs/xcb-util-keysyms ) + dev-libs/libsigc++:2 + dev-libs/libfmt:= + media-fonts/open-sans + media-libs/fontconfig:= + media-libs/libyuv:= pulseaudio? ( !pipewire? ( media-sound/pulseaudio-daemon ) ) @@ -115,11 +130,6 @@ COMMON_DEPEND=" media-video/pipewire[sound-server(+)] !media-sound/pulseaudio-daemon ) - system-libtgvoip? ( >media-libs/libtgvoip-2.4.4:=[pulseaudio(-)=,pipewire(-)=] ) - enchant? ( app-text/enchant:= ) - hunspell? ( >=app-text/hunspell-1.7:= ) - dev-cpp/abseil-cpp:= - media-libs/libjpeg-turbo:= media-libs/libyuv:= >=media-libs/tg_owt-0_pre20230401:=[pipewire(-)=,screencast=,X=] wayland? ( @@ -127,26 +137,31 @@ COMMON_DEPEND=" dev-libs/wayland-protocols:= dev-libs/plasma-wayland-protocols:= ) - net-libs/webkit-gtk:= - X? ( x11-libs/libxcb:= ) " RDEPEND=" ${COMMON_DEPEND} + net-libs/webkit-gtk:= " DEPEND=" ${COMMON_DEPEND} >=dev-cpp/range-v3-0.10.0:= " +# system-gsl? ( >dev-cpp/ms-gsl-2.0.0:= ) +# ^ TG upstream uses patched bundled version. +# >=dev-cpp/cppgir-0_p20230926 +# ^ WFM even without it 🤷 BDEPEND=" >=dev-util/cmake-3.16 + >=dev-util/gdbus-codegen-2.77 virtual/pkgconfig amd64? ( dev-lang/yasm ) " # system-rlottie? ( >=media-libs/rlottie-0_pre20190818:=[threads(-),-cache(-)] ) +# ^ TG upstream uses patched bundled version. # system-expected? ( >dev-cpp/tl-expected-1.0.0:= ) -# system-gsl? ( >dev-cpp/ms-gsl-2.0.0:= ) +# ^ TG upstream uses patched bundled version. RESTRICT="!test? ( test )" diff --git a/net-im/telegram-desktop/telegram-desktop-9999.ebuild b/net-im/telegram-desktop/telegram-desktop-9999.ebuild index fc30800f..9ad81dab 100644 --- a/net-im/telegram-desktop/telegram-desktop-9999.ebuild +++ b/net-im/telegram-desktop/telegram-desktop-9999.ebuild @@ -33,7 +33,7 @@ fi LICENSE="GPL-3-with-openssl-exception" SLOT="0" #IUSE="custom-api-id debug enchant +hunspell +jemalloc lto pipewire pulseaudio qt6 qt6-imageformats +screencast system-gsl +system-expected +system-libtgvoip system-rlottie test +wayland +X" -IUSE="custom-api-id debug enchant +hunspell +jemalloc lto pipewire pulseaudio qt6 qt6-imageformats +screencast +system-libtgvoip test +wayland +X" +IUSE="custom-api-id debug enchant +hunspell +jemalloc lto pipewire pulseaudio qt6 qt6-imageformats +screencast +system-libtgvoip test +wayland +webkit +X" REQUIRED_USE=" ^^ ( enchant hunspell ) @@ -63,27 +63,27 @@ KIMAGEFORMATS_RDEPEND=" COMMON_DEPEND=" !net-im/telegram-desktop-bin app-arch/lz4:= - >=dev-cpp/glibmm-2.77:2.68= - >=dev-libs/glib-2.77:= - >=dev-libs/gobject-introspection-1.77:= - dev-libs/openssl:= - dev-libs/xxhash:= + dev-cpp/abseil-cpp:= + >=dev-cpp/glibmm-2.77:2.68 + >=dev-libs/glib-2.77:2 + >=dev-libs/gobject-introspection-1.77 dev-libs/libdispatch - dev-libs/libsigc++:2 - dev-libs/libfmt:= - media-fonts/open-sans - media-libs/fontconfig:= - media-libs/rnnoise:= - media-libs/libyuv:= + dev-libs/openssl:= + dev-libs/protobuf + dev-libs/xxhash + media-libs/libjpeg-turbo:= + system-libtgvoip? ( >media-libs/libtgvoip-2.4.4:=[pulseaudio(-)=,pipewire(-)=] ) media-libs/openal:=[pipewire=] media-libs/opus:= + media-libs/rnnoise:= media-video/ffmpeg:=[opus,vpx] sys-libs/zlib:=[minizip] + virtual/opengl + enchant? ( app-text/enchant:= ) + hunspell? ( >=app-text/hunspell-1.7:= ) jemalloc? ( dev-libs/jemalloc:=[-lazy-lock] ) !qt6? ( >=dev-qt/qtcore-5.15:5= - dev-qt/qtdbus:5= - dev-libs/libdbusmenu-qt[qt5(+)] >=dev-qt/qtgui-5.15:5=[dbus,jpeg,png,wayland?,X?] >=dev-qt/qtimageformats-5.15:5= >=dev-qt/qtnetwork-5.15:5=[ssl] @@ -93,14 +93,24 @@ COMMON_DEPEND=" wayland? ( dev-qt/qtwayland:5= ) + webkit? ( + >=dev-qt/qtdeclarative-5.15:5= + >=dev-qt/qtwayland-5.15:5= + ) + dev-qt/qtdbus:5= + dev-libs/libdbusmenu-qt[qt5(+)] ) qt6? ( - dev-qt/qtbase:6=[dbus,gui,network,opengl,widgets,X?] - dev-qt/qtimageformats:6= - dev-qt/qtsvg:6= - wayland? ( dev-qt/qtwayland:6= ) + >=dev-qt/qtbase-6.5:6=[dbus,gui,network,opengl,wayland?,widgets,X?] + >=dev-qt/qtimageformats-6.5:6= + >=dev-qt/qtsvg-6.5:6= + wayland? ( >=dev-qt/qtwayland-6.5:6=[compositor] ) + webkit? ( + >=dev-qt/qtdeclarative-6.5:6 + >=dev-qt/qtwayland-6.5:6[compositor] + ) qt6-imageformats? ( - dev-qt/qtimageformats:6= + >=dev-qt/qtimageformats-6.5:6= ${KIMAGEFORMATS_RDEPEND} ) ) @@ -108,6 +118,11 @@ COMMON_DEPEND=" x11-libs/libxcb:= x11-libs/xcb-util-keysyms ) + dev-libs/libsigc++:2 + dev-libs/libfmt:= + media-fonts/open-sans + media-libs/fontconfig:= + media-libs/libyuv:= pulseaudio? ( !pipewire? ( media-sound/pulseaudio-daemon ) ) @@ -115,11 +130,6 @@ COMMON_DEPEND=" media-video/pipewire[sound-server(+)] !media-sound/pulseaudio-daemon ) - system-libtgvoip? ( >media-libs/libtgvoip-2.4.4:=[pulseaudio(-)=,pipewire(-)=] ) - enchant? ( app-text/enchant:= ) - hunspell? ( >=app-text/hunspell-1.7:= ) - dev-cpp/abseil-cpp:= - media-libs/libjpeg-turbo:= media-libs/libyuv:= >=media-libs/tg_owt-0_pre20230401:=[pipewire(-)=,screencast=,X=] wayland? ( @@ -127,26 +137,31 @@ COMMON_DEPEND=" dev-libs/wayland-protocols:= dev-libs/plasma-wayland-protocols:= ) - net-libs/webkit-gtk:= - X? ( x11-libs/libxcb:= ) " RDEPEND=" ${COMMON_DEPEND} + net-libs/webkit-gtk:= " DEPEND=" ${COMMON_DEPEND} >=dev-cpp/range-v3-0.10.0:= " +# system-gsl? ( >dev-cpp/ms-gsl-2.0.0:= ) +# ^ TG upstream uses patched bundled version. +# >=dev-cpp/cppgir-0_p20230926 +# ^ WFM even without it 🤷 BDEPEND=" >=dev-util/cmake-3.16 + >=dev-util/gdbus-codegen-2.77 virtual/pkgconfig amd64? ( dev-lang/yasm ) " # system-rlottie? ( >=media-libs/rlottie-0_pre20190818:=[threads(-),-cache(-)] ) +# ^ TG upstream uses patched bundled version. # system-expected? ( >dev-cpp/tl-expected-1.0.0:= ) -# system-gsl? ( >dev-cpp/ms-gsl-2.0.0:= ) +# ^ TG upstream uses patched bundled version. RESTRICT="!test? ( test )"