commit:     20af0ec5453796d6c599aa58a7654abe6bc391f6
Author:     Esteve Varela Colominas <esteve.varela <AT> gmail <DOT> com>
AuthorDate: Fri Nov 21 13:55:43 2025 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sun Nov 23 09:46:56 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20af0ec5

net-im/telegram-desktop: Fix minizip-ng compilation

Closes: https://bugs.gentoo.org/965735
Part-of: https://github.com/gentoo/gentoo/pull/44707
Signed-off-by: Esteve Varela Colominas <esteve.varela <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 .../files/tdesktop-6.3.2-loosen-minizip.patch        | 20 ++++++++++++++++++++
 .../telegram-desktop/telegram-desktop-6.3.3.ebuild   | 20 +++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/net-im/telegram-desktop/files/tdesktop-6.3.2-loosen-minizip.patch 
b/net-im/telegram-desktop/files/tdesktop-6.3.2-loosen-minizip.patch
new file mode 100644
index 000000000000..d9232d336e02
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-6.3.2-loosen-minizip.patch
@@ -0,0 +1,20 @@
+Loosen minizip requirement
+
+The new minizip-ng reports itself as version 4, but should be compatible with
+the old one. I doubt there will ever be much breakage here, so completely
+removing the version requirement makes sense.
+
+Warning! I have not tested minizip-ng at runtime. All my systems are stable,
+I'll just see the bug reports arrive if anything's up.
+
+--- tdesktop-6.3.2-full.orig/cmake/external/minizip/CMakeLists.txt
++++ tdesktop-6.3.2-full/cmake/external/minizip/CMakeLists.txt
+@@ -10,7 +10,7 @@
+ if (DESKTOP_APP_USE_PACKAGED)
+     find_package(PkgConfig REQUIRED)
+     if (PkgConfig_FOUND)
+-        pkg_check_modules(DESKTOP_APP_MINIZIP IMPORTED_TARGET REQUIRED 
minizip<2.0.0)
++        pkg_check_modules(DESKTOP_APP_MINIZIP IMPORTED_TARGET REQUIRED 
minizip)
+     endif()
+ 
+     if (DESKTOP_APP_MINIZIP_FOUND)

diff --git a/net-im/telegram-desktop/telegram-desktop-6.3.3.ebuild 
b/net-im/telegram-desktop/telegram-desktop-6.3.3.ebuild
index 2fca5df9e73c..eece5e63d838 100644
--- a/net-im/telegram-desktop/telegram-desktop-6.3.3.ebuild
+++ b/net-im/telegram-desktop/telegram-desktop-6.3.3.ebuild
@@ -82,6 +82,7 @@ PATCHES=(
        "${FILESDIR}"/tdesktop-5.7.2-cstring.patch
        "${FILESDIR}"/tdesktop-5.8.3-cstdint.patch
        "${FILESDIR}"/tdesktop-5.14.3-system-cppgir.patch
+       "${FILESDIR}"/tdesktop-6.3.2-loosen-minizip.patch
 )
 
 pkg_pretend() {
@@ -119,6 +120,17 @@ src_prepare() {
        sed -e '/find_package(Opus /d' -i cmake/external/opus/CMakeLists.txt || 
die
        sed -e '/find_package(xxHash /d' -i 
cmake/external/xxhash/CMakeLists.txt || die
 
+       # Greedily remove ThirdParty directories, keep only ones that interest 
us
+       local keep=(
+               rlottie  # Patched, not recommended to unbundle by upstream
+               libprisma  # Telegram-specific library, no stable releases
+               tgcalls  # Telegram-specific library, no stable releases
+               xdg-desktop-portal  # Only a few xml files are used with 
gdbus-codegen
+       )
+       for x in Telegram/ThirdParty/*; do
+               has "${x##*/}" "${keep[@]}" || rm -r "${x}" || die
+       done
+
        # Control QtDBus dependency from here, to avoid messing with QtGui.
        # QtGui will use find_package to find QtDbus as well, which
        # conflicts with the -DCMAKE_DISABLE_FIND_PACKAGE method.
@@ -133,6 +145,12 @@ src_prepare() {
                        -i 
Telegram/lib_webview/webview/platform/linux/webview_linux_compositor.h || die
        fi
 
+       # Shut the CMake 4 QA checker up by removing unused CMakeLists files
+       rm Telegram/ThirdParty/rlottie/CMakeLists.txt || die
+       rm cmake/external/glib/cppgir/expected-lite/example/CMakeLists.txt || 
die
+       rm cmake/external/glib/cppgir/expected-lite/test/CMakeLists.txt || die
+       rm cmake/external/glib/cppgir/expected-lite/CMakeLists.txt || die
+
        cmake_src_prepare
 }
 
@@ -143,7 +161,7 @@ src_configure() {
        # - bug 920819: system-wide directories ignored when variable is set
        export XDG_DATA_DIRS="${ESYSROOT}/usr/share"
 
-       # Evil flag (bug #919201)
+       # Evil flag (See https://bugs.gentoo.org/919201)
        filter-flags -fno-delete-null-pointer-checks
 
        # The ABI of media-libs/tg_owt breaks if the -DNDEBUG flag doesn't keep

Reply via email to