commit: b5e1f322c3742ef24f591a64a2f282f53b1ee241
Author: Zurab Kvachadze <zurabid2016 <AT> gmail <DOT> com>
AuthorDate: Sat Nov 15 16:46:01 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 17 07:39:15 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5e1f322
media-libs/tg_owt: Fix regression with abseil-cpp-20250512.1, drop old
Commit 56a02b6294daf8f7db58bf72c4f6fe64fdf8b3e6 ("media-libs/tg_owt: fix
build with abseil-cpp-20250814.1"), fixing bug 964949, introduced a
regression for <=dev-cpp/abseil-cpp-20250512.1: redefinition of
absl::Nonnull and absl::Nullable.
Later versions of abseil, i.e. >dev-cpp/abseil-cpp-20250512.1,
completely remove absl::Nonnull and absl::Nullable so their redefinition
is fine.
This commit #ifdef's the patch added in the aforementioned commit to
abseil versions > 20250512, fixing the regression. The patch was
proposed by Nikita Kostovsky[1].
[1]: https://bugs.gentoo.org/965838#c6
See-also: https://github.com/desktop-app/tg_owt/pull/164
See-also: https://github.com/desktop-app/tg_owt/pull/169
Bug: https://bugs.gentoo.org/964949
Closes: https://bugs.gentoo.org/965838
Signed-off-by: Zurab Kvachadze <zurabid2016 <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44634
Closes: https://github.com/gentoo/gentoo/pull/44634
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/tg_owt-0_pre20250515-scope-nonnull.patch | 22 ++++
media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild | 4 +
media-libs/tg_owt/tg_owt-0_pre20250515.ebuild | 121 ---------------------
3 files changed, 26 insertions(+), 121 deletions(-)
diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20250515-scope-nonnull.patch
b/media-libs/tg_owt/files/tg_owt-0_pre20250515-scope-nonnull.patch
new file mode 100644
index 000000000000..b0ccc56e728c
--- /dev/null
+++ b/media-libs/tg_owt/files/tg_owt-0_pre20250515-scope-nonnull.patch
@@ -0,0 +1,22 @@
+diff --git a/src/api/scoped_refptr.h b/src/api/scoped_refptr.h
+index 6ff8a3cf..5d58968e 100644
+--- a/src/api/scoped_refptr.h
++++ b/src/api/scoped_refptr.h
+@@ -68,6 +68,9 @@
+
+ #include "absl/base/nullability.h"
+
++// Compatibility shim for abseil versions that remove absl::Nonnull and
++// absl::Nullable.
++#if ABSL_LTS_RELEASE_VERSION > 20250512
+ namespace absl {
+ #ifdef absl_nonnull
+ template<typename T>
+@@ -79,6 +82,7 @@ template<typename T>
+ using Nullable = T absl_nullable;
+ #endif // absl_nullable
+ }
++#endif // ABSL_LTS_RELEASE_VERSION > 20250512
+
+ namespace webrtc {
+
diff --git a/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild
b/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild
index 742aec133c3a..a3b48c966a64 100644
--- a/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild
+++ b/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild
@@ -71,7 +71,11 @@ BDEPEND="
PATCHES=(
"${FILESDIR}/tg_owt-0_pre20250515-fix-gcc16.patch"
"${FILESDIR}/tg_owt-0_pre20250515-fix-clang20.patch"
+
+ # Bug 964949. Incomplete, regresses abseil-cpp-2025012.
"${FILESDIR}/tg_owt-0_pre20250515-nonnull.patch"
+ # Bug 965838. Fixes regression with abseil-cpp-2025012.
+ "${FILESDIR}/tg_owt-0_pre20250515-scope-nonnull.patch"
)
src_unpack() {
diff --git a/media-libs/tg_owt/tg_owt-0_pre20250515.ebuild
b/media-libs/tg_owt/tg_owt-0_pre20250515.ebuild
deleted file mode 100644
index 356feb89226d..000000000000
--- a/media-libs/tg_owt/tg_owt-0_pre20250515.ebuild
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright 2020-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit cmake flag-o-matic
-
-DESCRIPTION="WebRTC build for Telegram"
-HOMEPAGE="https://github.com/desktop-app/tg_owt"
-
-TG_OWT_COMMIT="232ec410502e773024e8d83cfae83a52203306c0"
-LIBYUV_COMMIT="04821d1e7d60845525e8db55c7bcd41ef5be9406"
-LIBSRTP_COMMIT="a566a9cfcd619e8327784aa7cff4a1276dc1e895"
-SRC_URI="https://github.com/desktop-app/tg_owt/archive/${TG_OWT_COMMIT}.tar.gz
-> ${P}.tar.gz
-
https://gitlab.com/chromiumsrc/libyuv/-/archive/${LIBYUV_COMMIT}/libyuv-${LIBYUV_COMMIT}.tar.bz2"
-S="${WORKDIR}/${PN}-${TG_OWT_COMMIT}"
-# Upstream libyuv: https://chromium.googlesource.com/libyuv/libyuv
-
-LICENSE="BSD"
-SLOT="0/${PV##*pre}"
-KEYWORDS="amd64 ~arm64 ~loong ~ppc64 ~riscv"
-IUSE="screencast +X"
-
-# This package's USE flags may change the ABI and require a rebuild of
-# dependent pacakges. As such, one should make sure to depend on
-# media-libs/tg_owt[x=,y=,z=] for any package that uses this.
-# Furthermore, the -DNDEBUG preprocessor flag should be defined by any
-# dependent package, failure to do so will change the ABI in the header files.
-
-# Bundled libs:
-# - libyuv (no stable versioning, www-client/chromium and media-libs/libvpx
bundle it)
-# - pffft (no stable versioning, patched)
-RDEPEND="
- >=dev-cpp/abseil-cpp-20240722.0:=
- dev-libs/openssl:=
- dev-libs/protobuf:=
- media-libs/libjpeg-turbo:=
- >=media-libs/libvpx-1.10.0:=
- media-libs/openh264:=
- media-libs/opus
- media-video/ffmpeg:=
- net-libs/libsrtp:2=
- dev-libs/crc32c
- screencast? (
- dev-libs/glib:2
- >=media-video/pipewire-1.0.7:=
- )
- X? (
- x11-libs/libX11
- x11-libs/libXcomposite
- x11-libs/libXdamage
- x11-libs/libXext
- x11-libs/libXfixes
- x11-libs/libXrender
- x11-libs/libXrandr
- x11-libs/libXtst
- )
-"
-DEPEND="${RDEPEND}
- screencast? (
- media-libs/libglvnd[X]
- media-libs/mesa
- x11-libs/libdrm
- )
-"
-BDEPEND="
- virtual/pkgconfig
- X? ( x11-base/xorg-proto )
-"
-
-src_unpack() {
- default
-
- mv -T "libyuv-${LIBYUV_COMMIT}" "${S}/src/third_party/libyuv" || die
-}
-
-src_prepare() {
- # The sources for these aren't available, avoid needing them
- sed -e '/include(cmake\/libcrc32c.cmake)/d' \
- -e '/include(cmake\/libabsl.cmake)/d' -i CMakeLists.txt || die
-
- # "lol" said the scorpion, "lmao"
- sed -i '/if (BUILD_SHARED_LIBS)/{n;n;s/WARNING/DEBUG/}' CMakeLists.txt
|| die
-
- cmake_src_prepare
-}
-
-src_configure() {
- # Defined by -DCMAKE_BUILD_TYPE=Release, avoids crashes
- # See https://bugs.gentoo.org/754012
- # EAPI 8 still wipes this flag.
- append-cppflags '-DNDEBUG'
-
- local mycmakeargs=(
- -DTG_OWT_USE_X11=$(usex X)
- -DTG_OWT_USE_PIPEWIRE=$(usex screencast)
- )
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
-
- # Save about 15MB of useless headers
- rm -r "${ED}/usr/include/tg_owt/rtc_base/third_party" || die
- rm -r "${ED}/usr/include/tg_owt/common_audio/third_party" || die
- rm -r "${ED}/usr/include/tg_owt/modules/third_party" || die
- rm -r "${ED}/usr/include/tg_owt/third_party" || die
-
- # Install a few headers anyway, as required by
net-im/telegram-desktop...
- local headers=(
- third_party/libyuv/include
- rtc_base/third_party/sigslot
- rtc_base/third_party/base64
- )
- for dir in "${headers[@]}"; do
- pushd "${S}/src/${dir}" > /dev/null || die
- find -type f -name "*.h" -exec install -Dm644 '{}'
"${ED}/usr/include/tg_owt/${dir}/{}" \; || die
- popd > /dev/null || die
- done
-}