From 006b6e378c1b40875808dd363fb2281ca13b396c Mon Sep 17 00:00:00 2001 From: Esteve Varela Colominas Date: Thu, 12 Aug 2021 11:00:03 +0200 Subject: media-libs/tg_owt: Don't build audio backends Recent bug regarding ABI compatibility of different USE flags of this library makes me aware that this package should have as few USE flags as possible... Signed-off-by: Esteve Varela Colominas Signed-off-by: Georgy Yakovlev --- ...t-0_pre20210626-expose-set_allow_pipewire.patch | 16 --- media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild | 108 +++++++++++++++++++++ media-libs/tg_owt/tg_owt-0_pre20210626.ebuild | 104 -------------------- 3 files changed, 108 insertions(+), 120 deletions(-) delete mode 100644 media-libs/tg_owt/files/tg_owt-0_pre20210626-expose-set_allow_pipewire.patch create mode 100644 media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild delete mode 100644 media-libs/tg_owt/tg_owt-0_pre20210626.ebuild (limited to 'media-libs/tg_owt') diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20210626-expose-set_allow_pipewire.patch b/media-libs/tg_owt/files/tg_owt-0_pre20210626-expose-set_allow_pipewire.patch deleted file mode 100644 index ef93ea24101c..000000000000 --- a/media-libs/tg_owt/files/tg_owt-0_pre20210626-expose-set_allow_pipewire.patch +++ /dev/null @@ -1,16 +0,0 @@ -Exposes a dummy version of set_allow_pipewire in case the library is built -without WEBRTC_USE_PIPEWIRE. This function is expected to be used by -applications, and removing it completely breaks the ABI. - ---- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/src/modules/desktop_capture/desktop_capture_options.h -+++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/src/modules/desktop_capture/desktop_capture_options.h -@@ -131,6 +131,9 @@ - #if defined(WEBRTC_USE_PIPEWIRE) - bool allow_pipewire() const { return allow_pipewire_; } - void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } -+#else -+ bool allow_pipewire() const { return false; } -+ void set_allow_pipewire(bool allow) { } - #endif - - private: diff --git a/media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild b/media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild new file mode 100644 index 000000000000..6b1f91230c17 --- /dev/null +++ b/media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild @@ -0,0 +1,108 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="WebRTC build for Telegram" +HOMEPAGE="https://github.com/desktop-app/tg_owt" + +TG_OWT_COMMIT="91d836dc84a16584c6ac52b36c04c0de504d9c34" +LIBYUV_COMMIT="ad890067f661dc747a975bc55ba3767fe30d4452" +SRC_URI="https://github.com/desktop-app/tg_owt/archive/${TG_OWT_COMMIT}.tar.gz -> ${P}.tar.gz + https://archive.org/download/libyuv-${LIBYUV_COMMIT}.tar/libyuv-${LIBYUV_COMMIT}.tar.gz" +S="${WORKDIR}/${PN}-${TG_OWT_COMMIT}" +# Fetch libyuv archive from: https://chromium.googlesource.com/libyuv/libyuv/+archive/${LIBYUV_COMMIT}.tar.gz + +LICENSE="BSD" +SLOT="0/${PV##*pre}" +KEYWORDS="amd64 ~ppc64" +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. + +# 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) +# media-libs/libjpeg-turbo is required for libyuv +DEPEND=" + dev-cpp/abseil-cpp:=[cxx17(+)] + dev-libs/libevent:= + 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/usrsctp + screencast? ( + dev-libs/glib:2 + media-video/pipewire:= + ) + 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 + ) +" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/tg_owt-0_pre20210626-allow-disabling-pipewire.patch" + "${FILESDIR}/tg_owt-0_pre20210626-allow-disabling-X11.patch" + "${FILESDIR}/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch" +) + +src_unpack() { + unpack "${P}.tar.gz" + cd "${S}/src/third_party/libyuv" || die + unpack "libyuv-${LIBYUV_COMMIT}.tar.gz" +} + +src_prepare() { + # libvpx source files aren't included in the repository + sed -i '/include(cmake\/libvpx.cmake)/d' CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + # Defined by -DCMAKE_BUILD_TYPE=Release, avoids crashes + # see https://bugs.gentoo.org/754012 + append-cppflags '-DNDEBUG' + + local mycmakeargs=( + -DTG_OWT_USE_X11=$(usex X) + -DTG_OWT_USE_PIPEWIRE=$(usex screencast) + + # Not required by net-im/telegram-desktop right now, I'd rather avoid + # the (ABI compatibility) headache. + -DTG_OWT_BUILD_AUDIO_BACKENDS=OFF + #-DTG_OWT_BUILD_AUDIO_BACKENDS=$(usex alsa) + #-DTG_OWT_BUILD_PULSE_BACKEND=$(usex pulseaudio) + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + + # Save about 15MB of useless headers + rm -r "${ED}/usr/include/tg_owt/third_party" || die + + # Install third_party/libyuv anyway... + dodir /usr/include/tg_owt/third_party/libyuv/include + cd "${S}/src/third_party/libyuv/include" + find -type f -name "*.h" -exec install -Dm644 '{}' "${ED}/usr/include/tg_owt/third_party/libyuv/include/{}" \; +} diff --git a/media-libs/tg_owt/tg_owt-0_pre20210626.ebuild b/media-libs/tg_owt/tg_owt-0_pre20210626.ebuild deleted file mode 100644 index 6fd83cb3e00f..000000000000 --- a/media-libs/tg_owt/tg_owt-0_pre20210626.ebuild +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2020-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake - -DESCRIPTION="WebRTC build for Telegram" -HOMEPAGE="https://github.com/desktop-app/tg_owt" - -TG_OWT_COMMIT="91d836dc84a16584c6ac52b36c04c0de504d9c34" -LIBYUV_COMMIT="ad890067f661dc747a975bc55ba3767fe30d4452" -SRC_URI="https://github.com/desktop-app/tg_owt/archive/${TG_OWT_COMMIT}.tar.gz -> ${P}.tar.gz - https://archive.org/download/libyuv-${LIBYUV_COMMIT}.tar/libyuv-${LIBYUV_COMMIT}.tar.gz" -S="${WORKDIR}/${PN}-${TG_OWT_COMMIT}" -# Fetch libyuv archive from: https://chromium.googlesource.com/libyuv/libyuv/+archive/${LIBYUV_COMMIT}.tar.gz - -LICENSE="BSD" -SLOT="0/${PV##*pre}" -KEYWORDS="amd64 ~ppc64" -IUSE="+alsa pulseaudio screencast +X" -REQUIRED_USE="pulseaudio? ( alsa )" - -# 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) -# media-libs/libjpeg-turbo is required for libyuv -DEPEND=" - dev-cpp/abseil-cpp:=[cxx17(+)] - dev-libs/libevent:= - 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/usrsctp - alsa? ( media-libs/alsa-lib ) - pulseaudio? ( media-sound/pulseaudio ) - screencast? ( - dev-libs/glib:2 - media-video/pipewire:= - ) - 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 - ) -" -RDEPEND="${DEPEND}" -BDEPEND="virtual/pkgconfig" - -PATCHES=( - "${FILESDIR}/tg_owt-0_pre20210626-allow-disabling-pipewire.patch" - "${FILESDIR}/tg_owt-0_pre20210626-allow-disabling-X11.patch" - "${FILESDIR}/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch" - "${FILESDIR}/tg_owt-0_pre20210626-expose-set_allow_pipewire.patch" -) - -src_unpack() { - unpack "${P}.tar.gz" - cd "${S}/src/third_party/libyuv" || die - unpack "libyuv-${LIBYUV_COMMIT}.tar.gz" -} - -src_prepare() { - # libvpx source files aren't included in the repository - sed -i '/include(cmake\/libvpx.cmake)/d' CMakeLists.txt || die - - cmake_src_prepare -} - -src_configure() { - # Defined by -DCMAKE_BUILD_TYPE=Release, avoids crashes - # see https://bugs.gentoo.org/754012 - append-cppflags '-DNDEBUG' - - local mycmakeargs=( - -DTG_OWT_USE_X11=$(usex X ON OFF) - -DTG_OWT_USE_PIPEWIRE=$(usex screencast ON OFF) - -DTG_OWT_BUILD_AUDIO_BACKENDS=$(usex alsa ON OFF) - -DTG_OWT_BUILD_PULSE_BACKEND=$(usex pulseaudio ON OFF) - ) - cmake_src_configure -} - -src_install() { - cmake_src_install - - # Save about 15MB of useless headers - rm -r "${ED}/usr/include/tg_owt/third_party" || die - - # Install third_party/libyuv anyway... - dodir /usr/include/tg_owt/third_party/libyuv/include - cd "${S}/src/third_party/libyuv/include" - find -type f -name "*.h" -exec install -Dm644 '{}' "${ED}/usr/include/tg_owt/third_party/libyuv/include/{}" \; -} -- cgit v1.2.3-65-gdbad