diff --git a/media-libs/tg_owt/Manifest b/media-libs/tg_owt/Manifest new file mode 100644 index 0000000..ef566ce --- /dev/null +++ b/media-libs/tg_owt/Manifest @@ -0,0 +1,4 @@ +DIST libsrtp-a566a9cfcd619e8327784aa7cff4a1276dc1e895.tar.gz 636836 BLAKE2B 496afcb80f67a8f76104e338408d4930475daadaf3f7cd2d673336aef938986876995e475a4d932424d7f99f6a339bad360f566d6fd3719316eaf8241970cf8d SHA512 930e665434e80e8a26d81b785563c915619b546a9a0af0455a14278816997074add852fae107027f4899415cb0ab47ffbf9492bea76b94b10f558b52098bbf92 +DIST libyuv-04821d1e7d60845525e8db55c7bcd41ef5be9406.tar.bz2 418856 BLAKE2B a72e1f75491785b272b0ded46368a67aadb643278e5764d16dcd902ab7e4139d8664ffbacd940f30113ce3171e0b0846fe0d6111ced17c5b08f326cd61b2af14 SHA512 ff9cfbb61a1361e959740d00c741dc6fbe71ca7c61770abc35f70aada402df3884d7d5992ae79472dfe3d7641154d4f13065593fee41bf8eae924e26cc654117 +DIST tg_owt-0_pre20241202.tar.gz 11722610 BLAKE2B effe7b833db593bdbf5d923b362cbc8839853e068d22ac1efd39ae8287eac0aeb71e74bf4476fa2a1a1b67c4e7370c6bc3b28d97e510c50b9621761b9b7be219 SHA512 10b7d0686fabc289694c659bcd138737b33375d0aad936e0cf8dcdebeebf30e7c0e1af7a9196c4275bcbb88b5867bcefa8179564980941895a6b7d9bfae822b2 +DIST tg_owt-0_pre20250515.tar.gz 11719653 BLAKE2B 804a72d97b535efb6e6319e609763f2b641cb9962e59d4afd5ea5b98b9b49b5c32344341ca6096899e806c3a115f784975a442c758896913a162a2d96a77703a SHA512 3930584575a61b5c8aeea871be85d0700ccc32b852adb10293ab4267066cfcf6857ceea51b267507f5d23e088c331fb7b42ebccbb71ef9b8a2ecdba60c2ca2e3 diff --git a/media-libs/tg_owt/files/pipewire-1.4.patch b/media-libs/tg_owt/files/pipewire-1.4.patch new file mode 100644 index 0000000..46fe260 --- /dev/null +++ b/media-libs/tg_owt/files/pipewire-1.4.patch @@ -0,0 +1,23 @@ +Bug: https://github.com/desktop-app/tg_owt/issues/148 +Upstream pull request: https://github.com/desktop-app/tg_owt/pull/149/files + +--- a/src/modules/video_capture/linux/pipewire_session.cc ++++ b/src/modules/video_capture/linux/pipewire_session.cc +@@ -60,7 +60,7 @@ + .param = OnNodeParam, + }; + +- pw_node_add_listener(proxy_, &node_listener_, &node_events, this); ++ pw_node_add_listener(reinterpret_cast(proxy_), &node_listener_, &node_events, this); + } + + PipeWireNode::~PipeWireNode() { +@@ -94,7 +94,7 @@ + uint32_t id = info->params[i].id; + if (id == SPA_PARAM_EnumFormat && + info->params[i].flags & SPA_PARAM_INFO_READ) { +- pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); ++ pw_node_enum_params(reinterpret_cast(that->proxy_), 0, id, 0, UINT32_MAX, nullptr); + break; + } + } diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20250515-fix-clang20.patch b/media-libs/tg_owt/files/tg_owt-0_pre20250515-fix-clang20.patch new file mode 100644 index 0000000..21ff5e5 --- /dev/null +++ b/media-libs/tg_owt/files/tg_owt-0_pre20250515-fix-clang20.patch @@ -0,0 +1,30 @@ +https://github.com/desktop-app/tg_owt/pull/162 +From c6ffc8aefb8520a51234c380cc415dd21469cf6b Mon Sep 17 00:00:00 2001 +From: Yao Zi +Date: Mon, 12 May 2025 09:05:30 +0000 +Subject: [PATCH] Remove ABSL_ATTRIBUTE_LIFETIME_BOUND from void functions + +LLVM 20 errors on void functions whose parameters are applied +[[lifetimebound]]. + +Link: https://github.com/llvm/llvm-project/pull/113460 +--- + src/api/candidate.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/api/candidate.h b/src/api/candidate.h +index 0aa75aa..715761a 100644 +--- a/src/api/candidate.h ++++ b/src/api/candidate.h +@@ -105,7 +105,7 @@ class RTC_EXPORT Candidate { + // cricket::LOCAL_PORT_TYPE). The type should really be an enum rather than a + // string, but until we make that change the lifetime attribute helps us lock + // things down. See also the `Port` class. +- void set_type(absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND) { ++ void set_type(absl::string_view type) { + Assign(type_, type); + } + +-- +2.49.0 + diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20250515-fix-gcc16.patch b/media-libs/tg_owt/files/tg_owt-0_pre20250515-fix-gcc16.patch new file mode 100644 index 0000000..f13c875 --- /dev/null +++ b/media-libs/tg_owt/files/tg_owt-0_pre20250515-fix-gcc16.patch @@ -0,0 +1,26 @@ +https://github.com/desktop-app/tg_owt/pull/161 +From: Brahmajit Das +Date: Fri, 27 Jun 2025 04:01:15 +0530 +Subject: [PATCH 1/1] Fix building with GCC 16 + +Building with GCC 16 results in the follwing build error: + +/var/tmp/portage/media-libs/tg_owt-0_pre20250515/work/tg_owt-232ec410502e773024e8d83cfae83a52203306c0/src/video/stats_counter.h:116:28: error: uint32_t has not been declared + 116 | void Set(int64_t sample, uint32_t stream_id); + | ^~~~~~~~ + +Downstream-bug: https://bugs.gentoo.org/958600 +Signed-off-by: Brahmajit Das +--- a/src/video/stats_counter.h ++++ b/src/video/stats_counter.h +@@ -13,6 +13,7 @@ + + #include + #include ++#include + + namespace webrtc { + +-- +2.50.0 + diff --git a/media-libs/tg_owt/files/tg_owt-patch-absl.patch b/media-libs/tg_owt/files/tg_owt-patch-absl.patch new file mode 100644 index 0000000..25d92b2 --- /dev/null +++ b/media-libs/tg_owt/files/tg_owt-patch-absl.patch @@ -0,0 +1,23 @@ +--- a/src/api/scoped_refptr.h 2025-05-15 18:16:02.000000000 +0800 ++++ b/src/api/scoped_refptr.h 2025-11-02 02:44:14.976765731 +0800 +@@ -66,6 +66,20 @@ + #include + #include + ++#include "absl/base/nullability.h" ++ ++namespace absl { ++#ifdef absl_nonnull ++template ++using Nonnull = T absl_nonnull; ++#endif // absl_nonnull ++ ++#ifdef absl_nullable ++template ++using Nullable = T absl_nullable; ++#endif // absl_nullable ++} ++ + namespace webrtc { + + template diff --git a/media-libs/tg_owt/metadata.xml b/media-libs/tg_owt/metadata.xml new file mode 100644 index 0000000..4dd0b95 --- /dev/null +++ b/media-libs/tg_owt/metadata.xml @@ -0,0 +1,15 @@ + + + + + esteve.varela@gmail.com + Esteve Varela Colominas + + + proxy-maint@gentoo.org + Proxy Maintainers + + + desktop-app/tg_owt + + diff --git a/media-libs/tg_owt/tg_owt-0_pre20241202.ebuild b/media-libs/tg_owt/tg_owt-0_pre20241202.ebuild new file mode 100644 index 0000000..eb09ca7 --- /dev/null +++ b/media-libs/tg_owt/tg_owt-0_pre20241202.ebuild @@ -0,0 +1,125 @@ +# 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="be39b8c8d0db1f377118f813f0c4bd331d341d5e" +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 + https://github.com/cisco/libsrtp/archive/${LIBSRTP_COMMIT}.tar.gz -> libsrtp-${LIBSRTP_COMMIT}.tar.gz" +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) +# - libsrtp (project uses private APIs) +# - 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:= + 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 ) +" + +PATCHES=( "${FILESDIR}/pipewire-1.4.patch" ) + +src_unpack() { + default + + mv -T "libyuv-${LIBYUV_COMMIT}" "${S}/src/third_party/libyuv" || die + mv -T "libsrtp-${LIBSRTP_COMMIT}" "${S}/src/third_party/libsrtp" || 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 +} diff --git a/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild b/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild new file mode 100644 index 0000000..4b6b5ce --- /dev/null +++ b/media-libs/tg_owt/tg_owt-0_pre20250515-r2.ebuild @@ -0,0 +1,126 @@ +# 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 ) +" + +PATCHES=( + "${FILESDIR}/tg_owt-0_pre20250515-fix-gcc16.patch" + "${FILESDIR}/tg_owt-0_pre20250515-fix-clang20.patch" +) + +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 +} diff --git a/media-libs/tg_owt/tg_owt-0_pre20250515-r3.ebuild b/media-libs/tg_owt/tg_owt-0_pre20250515-r3.ebuild new file mode 100644 index 0000000..89ae0d1 --- /dev/null +++ b/media-libs/tg_owt/tg_owt-0_pre20250515-r3.ebuild @@ -0,0 +1,127 @@ +# 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 ) +" + +PATCHES=( + "${FILESDIR}/tg_owt-0_pre20250515-fix-gcc16.patch" + "${FILESDIR}/tg_owt-0_pre20250515-fix-clang20.patch" + "${FILESDIR}/tg_owt-patch-absl.patch" +) + +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 +} diff --git a/media-libs/tg_owt/tg_owt-0_pre20250515.ebuild b/media-libs/tg_owt/tg_owt-0_pre20250515.ebuild new file mode 100644 index 0000000..356feb8 --- /dev/null +++ b/media-libs/tg_owt/tg_owt-0_pre20250515.ebuild @@ -0,0 +1,121 @@ +# 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 +} diff --git a/metadata/md5-cache/media-libs/tg_owt-0_pre20241202 b/metadata/md5-cache/media-libs/tg_owt-0_pre20241202 new file mode 100644 index 0000000..514cd53 --- /dev/null +++ b/metadata/md5-cache/media-libs/tg_owt-0_pre20241202 @@ -0,0 +1,15 @@ +BDEPEND=virtual/pkgconfig X? ( x11-base/xorg-proto ) app-alternatives/ninja >=dev-build/cmake-3.28.5 +DEFINED_PHASES=compile configure install prepare test unpack +DEPEND=>=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:= 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 ) screencast? ( media-libs/libglvnd[X] media-libs/mesa x11-libs/libdrm ) +DESCRIPTION=WebRTC build for Telegram +EAPI=8 +HOMEPAGE=https://github.com/desktop-app/tg_owt +INHERIT=cmake flag-o-matic +IUSE=screencast +X +KEYWORDS=amd64 ~arm64 ~loong ~ppc64 ~riscv +LICENSE=BSD +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:= 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 ) +SLOT=0/20241202 +SRC_URI=https://github.com/desktop-app/tg_owt/archive/be39b8c8d0db1f377118f813f0c4bd331d341d5e.tar.gz -> tg_owt-0_pre20241202.tar.gz https://gitlab.com/chromiumsrc/libyuv/-/archive/04821d1e7d60845525e8db55c7bcd41ef5be9406/libyuv-04821d1e7d60845525e8db55c7bcd41ef5be9406.tar.bz2 https://github.com/cisco/libsrtp/archive/a566a9cfcd619e8327784aa7cff4a1276dc1e895.tar.gz -> libsrtp-a566a9cfcd619e8327784aa7cff4a1276dc1e895.tar.gz +_eclasses_=toolchain-funcs 98d9f464d912ae6b7316fb8a3721f5db flag-o-matic a7afe42e95fb46ce9691605acfb24672 multiprocessing 1e32df7deee68372153dca65f4a7c21f ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 cmake 29a000891e576f0392730bb6834b67f5 +_md5_=375e6244e85aff8aa39417c7cb3562d7 diff --git a/metadata/md5-cache/media-libs/tg_owt-0_pre20250515 b/metadata/md5-cache/media-libs/tg_owt-0_pre20250515 new file mode 100644 index 0000000..939f1ed --- /dev/null +++ b/metadata/md5-cache/media-libs/tg_owt-0_pre20250515 @@ -0,0 +1,15 @@ +BDEPEND=virtual/pkgconfig X? ( x11-base/xorg-proto ) app-alternatives/ninja >=dev-build/cmake-3.28.5 +DEFINED_PHASES=compile configure install prepare test unpack +DEPEND=>=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 ) screencast? ( media-libs/libglvnd[X] media-libs/mesa x11-libs/libdrm ) +DESCRIPTION=WebRTC build for Telegram +EAPI=8 +HOMEPAGE=https://github.com/desktop-app/tg_owt +INHERIT=cmake flag-o-matic +IUSE=screencast +X +KEYWORDS=amd64 ~arm64 ~loong ~ppc64 ~riscv +LICENSE=BSD +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 ) +SLOT=0/20250515 +SRC_URI=https://github.com/desktop-app/tg_owt/archive/232ec410502e773024e8d83cfae83a52203306c0.tar.gz -> tg_owt-0_pre20250515.tar.gz https://gitlab.com/chromiumsrc/libyuv/-/archive/04821d1e7d60845525e8db55c7bcd41ef5be9406/libyuv-04821d1e7d60845525e8db55c7bcd41ef5be9406.tar.bz2 +_eclasses_=toolchain-funcs 98d9f464d912ae6b7316fb8a3721f5db flag-o-matic a7afe42e95fb46ce9691605acfb24672 multiprocessing 1e32df7deee68372153dca65f4a7c21f ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 cmake 29a000891e576f0392730bb6834b67f5 +_md5_=6424f0ad69cdc4ca7368cbdf0774aca5 diff --git a/metadata/md5-cache/media-libs/tg_owt-0_pre20250515-r2 b/metadata/md5-cache/media-libs/tg_owt-0_pre20250515-r2 new file mode 100644 index 0000000..40f5a9d --- /dev/null +++ b/metadata/md5-cache/media-libs/tg_owt-0_pre20250515-r2 @@ -0,0 +1,15 @@ +BDEPEND=virtual/pkgconfig X? ( x11-base/xorg-proto ) app-alternatives/ninja >=dev-build/cmake-3.28.5 +DEFINED_PHASES=compile configure install prepare test unpack +DEPEND=>=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 ) screencast? ( media-libs/libglvnd[X] media-libs/mesa x11-libs/libdrm ) +DESCRIPTION=WebRTC build for Telegram +EAPI=8 +HOMEPAGE=https://github.com/desktop-app/tg_owt +INHERIT=cmake flag-o-matic +IUSE=screencast +X +KEYWORDS=amd64 ~arm64 ~loong ~ppc64 ~riscv +LICENSE=BSD +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 ) +SLOT=0/20250515 +SRC_URI=https://github.com/desktop-app/tg_owt/archive/232ec410502e773024e8d83cfae83a52203306c0.tar.gz -> tg_owt-0_pre20250515.tar.gz https://gitlab.com/chromiumsrc/libyuv/-/archive/04821d1e7d60845525e8db55c7bcd41ef5be9406/libyuv-04821d1e7d60845525e8db55c7bcd41ef5be9406.tar.bz2 +_eclasses_=toolchain-funcs 98d9f464d912ae6b7316fb8a3721f5db flag-o-matic a7afe42e95fb46ce9691605acfb24672 multiprocessing 1e32df7deee68372153dca65f4a7c21f ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 cmake 29a000891e576f0392730bb6834b67f5 +_md5_=34831bb64198c91cf6987a2e45ef3d38 diff --git a/metadata/md5-cache/media-libs/tg_owt-0_pre20250515-r3 b/metadata/md5-cache/media-libs/tg_owt-0_pre20250515-r3 new file mode 100644 index 0000000..73873b6 --- /dev/null +++ b/metadata/md5-cache/media-libs/tg_owt-0_pre20250515-r3 @@ -0,0 +1,15 @@ +BDEPEND=virtual/pkgconfig X? ( x11-base/xorg-proto ) app-alternatives/ninja >=dev-build/cmake-3.28.5 +DEFINED_PHASES=compile configure install prepare test unpack +DEPEND=>=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 ) screencast? ( media-libs/libglvnd[X] media-libs/mesa x11-libs/libdrm ) +DESCRIPTION=WebRTC build for Telegram +EAPI=8 +HOMEPAGE=https://github.com/desktop-app/tg_owt +INHERIT=cmake flag-o-matic +IUSE=screencast +X +KEYWORDS=amd64 ~arm64 ~loong ~ppc64 ~riscv +LICENSE=BSD +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 ) +SLOT=0/20250515 +SRC_URI=https://github.com/desktop-app/tg_owt/archive/232ec410502e773024e8d83cfae83a52203306c0.tar.gz -> tg_owt-0_pre20250515.tar.gz https://gitlab.com/chromiumsrc/libyuv/-/archive/04821d1e7d60845525e8db55c7bcd41ef5be9406/libyuv-04821d1e7d60845525e8db55c7bcd41ef5be9406.tar.bz2 +_eclasses_=toolchain-funcs 98d9f464d912ae6b7316fb8a3721f5db flag-o-matic a7afe42e95fb46ce9691605acfb24672 multiprocessing 1e32df7deee68372153dca65f4a7c21f ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 cmake 29a000891e576f0392730bb6834b67f5 +_md5_=6f87cd76b331a164c7e1e1af7049a6e7