diff options
Diffstat (limited to 'media-libs/tg_owt')
-rw-r--r-- | media-libs/tg_owt/Manifest | 6 | ||||
-rw-r--r-- | media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-X11.patch | 108 | ||||
-rw-r--r-- | media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pipewire.patch | 36 | ||||
-rw-r--r-- | media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch | 90 | ||||
-rw-r--r-- | media-libs/tg_owt/metadata.xml | 6 | ||||
-rw-r--r-- | media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild | 113 | ||||
-rw-r--r-- | media-libs/tg_owt/tg_owt-0_pre20210914.ebuild | 116 | ||||
-rw-r--r-- | media-libs/tg_owt/tg_owt-0_pre20230921.ebuild | 129 |
8 files changed, 135 insertions, 469 deletions
diff --git a/media-libs/tg_owt/Manifest b/media-libs/tg_owt/Manifest index 6342eb38fb94..5807307f49bd 100644 --- a/media-libs/tg_owt/Manifest +++ b/media-libs/tg_owt/Manifest @@ -1,3 +1,3 @@ -DIST libyuv-ad890067f661dc747a975bc55ba3767fe30d4452.tar.gz 473845 BLAKE2B 664be51c166440e6b03fa98f65d907efc446800804058a5ea7fdf944e12cb1237a1487e83fbe9a2f1ce4c73521234e43632f921ad0333507737d81e1cb23ce8f SHA512 f97529b80a786e2e92443caabebd6d85a42641e10c3d2940b0f69bedf3b8a96c69c3247abddd059c4ddd6f78107ab7214222a4267a559fc2086c8edf5ea1afbc -DIST tg_owt-0_pre20210626.tar.gz 16264716 BLAKE2B de500e02789516527c814d0aba87cf1d0e772747f06acff7ac9295508c6e6bce1915cd3a703df618ff17ba8e04dc194538a6ef859fa85b301bb63eceab2c339a SHA512 a5d10011c427d8685bcf0743c356ff8c58c3cad6c59ac2409298b30b15cb04233889a5ed0a18107ac5b3477eee96741fdc85176d4330c866e8e3329753be7d73 -DIST tg_owt-0_pre20210914.tar.gz 16266351 BLAKE2B 048d6a77046b10af63f4e5c1530b6aeb9d423702a6e34e6e0082a10b06262e19c30aa766cc9ea38549605d8d2cc08bfcd5a4e715ab53c46031c23938f94af27e SHA512 bd46393d9a85fa38fcd560af4f68a4868b25528b134731070e8578217cb0b9bb8b5cf7b3990f619d321ba373e5630a52e467e14d93f71b24de3a5b3e591b8866 +DIST libsrtp-a566a9cfcd619e8327784aa7cff4a1276dc1e895.tar.gz 636836 BLAKE2B 496afcb80f67a8f76104e338408d4930475daadaf3f7cd2d673336aef938986876995e475a4d932424d7f99f6a339bad360f566d6fd3719316eaf8241970cf8d SHA512 930e665434e80e8a26d81b785563c915619b546a9a0af0455a14278816997074add852fae107027f4899415cb0ab47ffbf9492bea76b94b10f558b52098bbf92 +DIST libyuv-04821d1e7d60845525e8db55c7bcd41ef5be9406.tar.bz2 418856 BLAKE2B a72e1f75491785b272b0ded46368a67aadb643278e5764d16dcd902ab7e4139d8664ffbacd940f30113ce3171e0b0846fe0d6111ced17c5b08f326cd61b2af14 SHA512 ff9cfbb61a1361e959740d00c741dc6fbe71ca7c61770abc35f70aada402df3884d7d5992ae79472dfe3d7641154d4f13065593fee41bf8eae924e26cc654117 +DIST tg_owt-0_pre20230921.tar.gz 13726037 BLAKE2B 635342dd2127330542374e2f0f9acee91844c3c825fe4610dabe2996c541d9b3dc1681999910e5b591752f7e8f65a089c16b43216dd0c0b84f1a0e913e5a0213 SHA512 538d713e9ac91e9f676cdf301d11d7b5be0d67bda6283537e03b6322f3cca5c0234ff2f2b0b23e9046709f77ed282fc4d3526d3b21ee93478c50380be410372f diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-X11.patch b/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-X11.patch deleted file mode 100644 index c6abf9660468..000000000000 --- a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-X11.patch +++ /dev/null @@ -1,108 +0,0 @@ -Add -DTG_OWT_USE_X11 - -Allows disabling X11 desktop capturing independently of pipewire support, for -the few people that run wayland without any X11 support whatsoever. - -This setup is untested, but supported by the GNI build system, see: -* src/modules/desktop_capture/BUILD.gn (option rtc_use_x11_extensions) - -Toggling the WEBRTC_USE_X11 define also affects some files under -src/modules/audio_device, but that falls under "X11 support", regardless... - ---- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/CMakeLists.txt -+++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/CMakeLists.txt -@@ -21,11 +21,13 @@ - - option(BUILD_SHARED_LIBS "Builds shared libraries instead of static." ${TG_OWT_PACKAGED_BUILD}) - option(TG_OWT_USE_PROTOBUF "Use protobuf to generate additional headers. Useful for packaged build." ${BUILD_SHARED_LIBS}) -+option(TG_OWT_USE_X11 "Use X11 for desktop capture on non-Apple Unix." ON) - option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture on non-Apple Unix." ON) - option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire 0.3 for desktop capture on non-Apple Unix." ${not_packaged_build}) - option(TG_OWT_BUILD_AUDIO_BACKENDS "Build webrtc audio backends." ON) - - if (NOT UNIX OR APPLE) -+ set(TG_OWT_USE_X11 OFF) - set(TG_OWT_USE_PIPEWIRE OFF) - endif() - -@@ -87,6 +89,10 @@ - add_library(tg_owt) - init_target(tg_owt) - -+if (TG_OWT_USE_X11) -+ link_x11(tg_owt) -+endif() -+ - if (TG_OWT_USE_PIPEWIRE) - link_glib(tg_owt) - if (TG_OWT_DLOPEN_PIPEWIRE) -@@ -169,7 +175,6 @@ - target_link_libraries(tg_owt PUBLIC tg_owt::libwebrtcbuild) - - if (UNIX AND NOT APPLE) -- link_x11(tg_owt) - endif() - - function(add_sublibrary postfix) -@@ -2161,6 +2166,37 @@ - ) - endif() - -+if (NOT TG_OWT_USE_X11) -+ remove_target_sources(tg_owt ${webrtc_loc} -+ modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc -+ modules/desktop_capture/linux/mouse_cursor_monitor_x11.h -+ modules/desktop_capture/linux/screen_capturer_x11.cc -+ modules/desktop_capture/linux/screen_capturer_x11.h -+ modules/desktop_capture/linux/shared_x_display.cc -+ modules/desktop_capture/linux/shared_x_display.h -+ modules/desktop_capture/linux/window_capturer_x11.cc -+ modules/desktop_capture/linux/window_capturer_x11.h -+ modules/desktop_capture/linux/window_finder_x11.cc -+ modules/desktop_capture/linux/window_finder_x11.h -+ modules/desktop_capture/linux/window_list_utils.cc -+ modules/desktop_capture/linux/window_list_utils.h -+ modules/desktop_capture/linux/x_atom_cache.cc -+ modules/desktop_capture/linux/x_atom_cache.h -+ modules/desktop_capture/linux/x_error_trap.cc -+ modules/desktop_capture/linux/x_error_trap.h -+ modules/desktop_capture/linux/x_server_pixel_buffer.cc -+ modules/desktop_capture/linux/x_server_pixel_buffer.h -+ modules/desktop_capture/linux/x_window_property.cc -+ modules/desktop_capture/linux/x_window_property.h -+ -+ modules/desktop_capture/screen_drawer.cc -+ modules/desktop_capture/screen_drawer.h -+ modules/desktop_capture/screen_drawer_linux.cc -+ modules/desktop_capture/screen_drawer_lock_posix.cc -+ modules/desktop_capture/screen_drawer_lock_posix.h -+ ) -+endif() -+ - if (NOT TG_OWT_USE_PIPEWIRE) - remove_target_sources(tg_owt ${webrtc_loc} - modules/desktop_capture/linux/base_capturer_pipewire.cc ---- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/cmake/libwebrtcbuild.cmake -+++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/cmake/libwebrtcbuild.cmake -@@ -27,6 +27,13 @@ - BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0 - ) - -+if (TG_OWT_USE_X11) -+ target_compile_definitions(libwebrtcbuild -+ INTERFACE -+ WEBRTC_USE_X11 -+ ) -+endif() -+ - if (TG_OWT_USE_PIPEWIRE) - target_compile_definitions(libwebrtcbuild - INTERFACE -@@ -63,7 +70,6 @@ - INTERFACE - WEBRTC_POSIX - WEBRTC_LINUX -- WEBRTC_USE_X11 - ) - endif() - diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pipewire.patch b/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pipewire.patch deleted file mode 100644 index 9cc55585a561..000000000000 --- a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pipewire.patch +++ /dev/null @@ -1,36 +0,0 @@ -Fix an issue with -DTG_OWT_USE_PIPEWIRE=OFF - -Some files were erroneously being included despite the option being turned off - ---- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/CMakeLists.txt -+++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/CMakeLists.txt -@@ -88,6 +88,7 @@ - init_target(tg_owt) - - if (TG_OWT_USE_PIPEWIRE) -+ link_glib(tg_owt) - if (TG_OWT_DLOPEN_PIPEWIRE) - include(cmake/generate_stubs.cmake) - set(stubs_loc ${webrtc_loc}/modules/desktop_capture/linux) -@@ -169,7 +170,6 @@ - - if (UNIX AND NOT APPLE) - link_x11(tg_owt) -- link_glib(tg_owt) - endif() - - function(add_sublibrary postfix) -@@ -2161,6 +2161,13 @@ - ) - endif() - -+if (NOT TG_OWT_USE_PIPEWIRE) -+ remove_target_sources(tg_owt ${webrtc_loc} -+ modules/desktop_capture/linux/base_capturer_pipewire.cc -+ modules/desktop_capture/linux/base_capturer_pipewire.h -+ ) -+endif() -+ - if (NOT TG_OWT_BUILD_AUDIO_BACKENDS) - remove_target_sources(tg_owt ${webrtc_loc} - rtc_base/win/windows_version.cc diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch b/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch deleted file mode 100644 index 0bddb5fd00f6..000000000000 --- a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch +++ /dev/null @@ -1,90 +0,0 @@ -Add support for -DTG_OWT_BUILD_PULSE_BACKEND - -This is based off of the rtc_include_pulse_audio option in: -* src/modules/audio_device/BUILD.gn - -ALSA must be enabled unless audio support is removed as a whole, see: -* src/modules/audio_device/audio_device_impl.cc - ---- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/CMakeLists.txt -+++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/CMakeLists.txt -@@ -25,12 +25,17 @@ - option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture on non-Apple Unix." ON) - option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire 0.3 for desktop capture on non-Apple Unix." ${not_packaged_build}) - option(TG_OWT_BUILD_AUDIO_BACKENDS "Build webrtc audio backends." ON) -+option(TG_OWT_BUILD_PULSE_BACKEND "Build pulseaudio audio backend on non-Apple Unix." ON) - - if (NOT UNIX OR APPLE) - set(TG_OWT_USE_X11 OFF) - set(TG_OWT_USE_PIPEWIRE OFF) - endif() - -+if (NOT TG_OWT_BUILD_AUDIO_BACKENDS) -+ set(TG_OWT_BUILD_PULSE_BACKEND OFF) -+endif() -+ - if (BUILD_SHARED_LIBS) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - endif() -@@ -162,9 +167,11 @@ - link_libvpx(tg_owt) - - if (TG_OWT_BUILD_AUDIO_BACKENDS AND (UNIX AND NOT APPLE)) -- link_libalsa(tg_owt) -- link_libpulse(tg_owt) - link_dl(tg_owt) -+ link_libalsa(tg_owt) -+ if (TG_OWT_BUILD_PULSE_BACKEND) -+ link_libpulse(tg_owt) -+ endif() - endif() - - if (NOT WIN32 AND NOT APPLE) -@@ -2218,12 +2225,6 @@ - modules/audio_device/linux/audio_mixer_manager_alsa_linux.h - modules/audio_device/linux/latebindingsymboltable_linux.cc - modules/audio_device/linux/latebindingsymboltable_linux.h -- modules/audio_device/linux/audio_device_pulse_linux.cc -- modules/audio_device/linux/audio_device_pulse_linux.h -- modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc -- modules/audio_device/linux/audio_mixer_manager_pulse_linux.h -- modules/audio_device/linux/pulseaudiosymboltable_linux.cc -- modules/audio_device/linux/pulseaudiosymboltable_linux.h - modules/audio_device/mac/audio_device_mac.cc - modules/audio_device/mac/audio_device_mac.h - modules/audio_device/mac/audio_mixer_manager_mac.cc -@@ -2243,6 +2244,17 @@ - ) - endif() - -+if (NOT TG_OWT_BUILD_PULSE_BACKEND) -+ remove_target_sources(tg_owt ${webrtc_loc} -+ modules/audio_device/linux/audio_device_pulse_linux.cc -+ modules/audio_device/linux/audio_device_pulse_linux.h -+ modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc -+ modules/audio_device/linux/audio_mixer_manager_pulse_linux.h -+ modules/audio_device/linux/pulseaudiosymboltable_linux.cc -+ modules/audio_device/linux/pulseaudiosymboltable_linux.h -+ ) -+endif() -+ - if (NOT WIN32) - remove_target_sources(tg_owt ${webrtc_loc} - rtc_base/win32.cc ---- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/cmake/libwebrtcbuild.cmake -+++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/cmake/libwebrtcbuild.cmake -@@ -50,8 +50,13 @@ - target_compile_definitions(libwebrtcbuild - INTERFACE - WEBRTC_ENABLE_LINUX_ALSA -- WEBRTC_ENABLE_LINUX_PULSE - ) -+ if (TG_OWT_BUILD_PULSE_BACKEND) -+ target_compile_definitions(libwebrtcbuild -+ INTERFACE -+ WEBRTC_ENABLE_LINUX_PULSE -+ ) -+ endif() - endif() - - if (WIN32) diff --git a/media-libs/tg_owt/metadata.xml b/media-libs/tg_owt/metadata.xml index fe3b79cfdcca..4dd0b956cc49 100644 --- a/media-libs/tg_owt/metadata.xml +++ b/media-libs/tg_owt/metadata.xml @@ -9,7 +9,7 @@ <email>proxy-maint@gentoo.org</email> <name>Proxy Maintainers</name> </maintainer> - <use> - <flag name="screencast">Enable support for remote desktop and screen cast using <pkg>media-video/pipewire</pkg></flag> - </use> + <upstream> + <remote-id type="github">desktop-app/tg_owt</remote-id> + </upstream> </pkgmetadata> diff --git a/media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild b/media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild deleted file mode 100644 index 5a261d38d4b2..000000000000 --- a/media-libs/tg_owt/tg_owt-0_pre20210626-r1.ebuild +++ /dev/null @@ -1,113 +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="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 - - # libopenh264 has GENERATED files with yasm that aren't excluded by - # EXCLUDE_FROM_ALL, and I have no clue how to avoid this. - # These source files aren't used with system-openh264, anyway. - sed -i '/include(cmake\/libopenh264.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" || die - find -type f -name "*.h" -exec install -Dm644 '{}' "${ED}/usr/include/tg_owt/third_party/libyuv/include/{}" \; || die -} diff --git a/media-libs/tg_owt/tg_owt-0_pre20210914.ebuild b/media-libs/tg_owt/tg_owt-0_pre20210914.ebuild deleted file mode 100644 index 7b86c6adb9d5..000000000000 --- a/media-libs/tg_owt/tg_owt-0_pre20210914.ebuild +++ /dev/null @@ -1,116 +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="575fb17d2853c43329e45f6693370f5e41668055" -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 - - # libopenh264 has GENERATED files with yasm that aren't excluded by - # EXCLUDE_FROM_ALL, and I have no clue how to avoid this. - # These source files aren't used with system-openh264, anyway. - sed -i '/include(cmake\/libopenh264.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/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 third_party/libyuv anyway... - dodir /usr/include/tg_owt/third_party/libyuv/include - cd "${S}/src/third_party/libyuv/include" || die - find -type f -name "*.h" -exec install -Dm644 '{}' "${ED}/usr/include/tg_owt/third_party/libyuv/include/{}" \; || die -} diff --git a/media-libs/tg_owt/tg_owt-0_pre20230921.ebuild b/media-libs/tg_owt/tg_owt-0_pre20230921.ebuild new file mode 100644 index 000000000000..15ec3d79c4d6 --- /dev/null +++ b/media-libs/tg_owt/tg_owt-0_pre20230921.ebuild @@ -0,0 +1,129 @@ +# Copyright 2020-2024 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="592b14d13bf9103226e90a83571e24c49f6bfdcd" +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-20220623.1:= + 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:= + ) + 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 + media-libs/mesa + x11-libs/libdrm + ) +" +BDEPEND=" + virtual/pkgconfig + X? ( x11-base/xorg-proto ) +" + +src_unpack() { + unpack "${P}.tar.gz" + unpack "libyuv-${LIBYUV_COMMIT}.tar.bz2" + mv -T "libyuv-${LIBYUV_COMMIT}" "${S}/src/third_party/libyuv" || die + unpack "libsrtp-${LIBSRTP_COMMIT}.tar.gz" + mv -T "libsrtp-${LIBSRTP_COMMIT}" "${S}/src/third_party/libsrtp" || die +} + +src_prepare() { + # libopenh264 has GENERATED files with yasm that aren't excluded by + # EXCLUDE_FROM_ALL, and I have no clue how to avoid this. + # These source files aren't used with system-openh264, anyway. + sed -i '/include(cmake\/libopenh264.cmake)/d' CMakeLists.txt || die + + # 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 +} |