From a355ed8d3aa8c29d62b054d4ce6fdbb9e756f98c Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 17 Oct 2021 13:38:57 +1000 Subject: [PATCH] tg_owt: use external abseil_cpp, cleanup patchset --- .../patches/tg_owt-0.0.20210915.patchset | 155 ------------------ media-libs/tg_owt/tg_owt-0.0.20210915.recipe | 10 +- 2 files changed, 7 insertions(+), 158 deletions(-) diff --git a/media-libs/tg_owt/patches/tg_owt-0.0.20210915.patchset b/media-libs/tg_owt/patches/tg_owt-0.0.20210915.patchset index 774c99f21..ba4085bdf 100644 --- a/media-libs/tg_owt/patches/tg_owt-0.0.20210915.patchset +++ b/media-libs/tg_owt/patches/tg_owt-0.0.20210915.patchset @@ -109,46 +109,6 @@ index f5696ed..819d371 100644 set(platform_export libevent ) -diff --git a/cmake/external.cmake b/cmake/external.cmake -index 781f0a1..28e0804 100644 ---- a/cmake/external.cmake -+++ b/cmake/external.cmake -@@ -1,7 +1,7 @@ - # OpenSSL - set(TG_OWT_OPENSSL_INCLUDE_PATH "" CACHE STRING "Include path for openssl.") - function(link_openssl target_name) -- if (TG_OWT_PACKAGED_BUILD) -+ if (TG_OWT_PACKAGED_BUILD OR HAIKU) - find_package(OpenSSL REQUIRED) - target_include_directories(${target_name} PRIVATE ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(${target_name} PRIVATE ${OPENSSL_LIBRARIES}) -@@ -20,7 +20,7 @@ endfunction() - # Opus - set(TG_OWT_OPUS_INCLUDE_PATH "" CACHE STRING "Include path for opus.") - function(link_opus target_name) -- if (TG_OWT_PACKAGED_BUILD) -+ if (TG_OWT_PACKAGED_BUILD OR HAIKU) - find_package(PkgConfig REQUIRED) - pkg_check_modules(OPUS REQUIRED opus) - target_include_directories(${target_name} PRIVATE ${OPUS_INCLUDE_DIRS}) -@@ -41,7 +41,7 @@ endfunction() - set(TG_OWT_FFMPEG_INCLUDE_PATH "" CACHE STRING "Include path for ffmpeg.") - option(TG_OWT_PACKAGED_BUILD_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF) - function(link_ffmpeg target_name) -- if (TG_OWT_PACKAGED_BUILD) -+ if (TG_OWT_PACKAGED_BUILD OR HAIKU) - find_package(PkgConfig REQUIRED) - pkg_check_modules(AVCODEC REQUIRED libavcodec) - pkg_check_modules(AVFORMAT REQUIRED libavformat) -@@ -89,7 +89,7 @@ endfunction() - # libjpeg - set(TG_OWT_LIBJPEG_INCLUDE_PATH "" CACHE STRING "Include path for libjpeg.") - function(link_libjpeg target_name) -- if (TG_OWT_PACKAGED_BUILD) -+ if (TG_OWT_PACKAGED_BUILD OR HAIKU) - find_package(JPEG REQUIRED) - target_include_directories(${target_name} PRIVATE ${JPEG_INCLUDE_DIRS}) - target_link_libraries(${target_name} PRIVATE ${JPEG_LIBRARIES}) diff --git a/cmake/libusrsctp.cmake b/cmake/libusrsctp.cmake index 1dc5e5e..e88531c 100644 --- a/cmake/libusrsctp.cmake @@ -1793,121 +1753,6 @@ index 4ac7043..5fe950f 100644 RTC_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport)); #undef RTC_EXPORT_TEMPLATE_TEST -diff --git a/src/third_party/abseil-cpp/absl/base/options.h b/src/third_party/abseil-cpp/absl/base/options.h -index 230bf1e..6e1b9e5 100644 ---- a/src/third_party/abseil-cpp/absl/base/options.h -+++ b/src/third_party/abseil-cpp/absl/base/options.h -@@ -100,7 +100,7 @@ - // User code should not inspect this macro. To check in the preprocessor if - // absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY. - --#define ABSL_OPTION_USE_STD_ANY 2 -+#define ABSL_OPTION_USE_STD_ANY 0 - - - // ABSL_OPTION_USE_STD_OPTIONAL -@@ -127,7 +127,7 @@ - // absl::optional is a typedef of std::optional, use the feature macro - // ABSL_USES_STD_OPTIONAL. - --#define ABSL_OPTION_USE_STD_OPTIONAL 2 -+#define ABSL_OPTION_USE_STD_OPTIONAL 0 - - - // ABSL_OPTION_USE_STD_STRING_VIEW -@@ -154,7 +154,7 @@ - // absl::string_view is a typedef of std::string_view, use the feature macro - // ABSL_USES_STD_STRING_VIEW. - --#define ABSL_OPTION_USE_STD_STRING_VIEW 2 -+#define ABSL_OPTION_USE_STD_STRING_VIEW 0 - - // ABSL_OPTION_USE_STD_VARIANT - // -@@ -180,7 +180,7 @@ - // absl::variant is a typedef of std::variant, use the feature macro - // ABSL_USES_STD_VARIANT. - --#define ABSL_OPTION_USE_STD_VARIANT 2 -+#define ABSL_OPTION_USE_STD_VARIANT 0 - - - // ABSL_OPTION_USE_INLINE_NAMESPACE -diff --git a/src/third_party/abseil-cpp/absl/strings/match.cc b/src/third_party/abseil-cpp/absl/strings/match.cc -index 8127cb0..40a23b6 100644 ---- a/src/third_party/abseil-cpp/absl/strings/match.cc -+++ b/src/third_party/abseil-cpp/absl/strings/match.cc -@@ -19,22 +19,5 @@ - namespace absl { - ABSL_NAMESPACE_BEGIN - --bool EqualsIgnoreCase(absl::string_view piece1, absl::string_view piece2) { -- return (piece1.size() == piece2.size() && -- 0 == absl::strings_internal::memcasecmp(piece1.data(), piece2.data(), -- piece1.size())); -- // memcasecmp uses absl::ascii_tolower(). --} -- --bool StartsWithIgnoreCase(absl::string_view text, absl::string_view prefix) { -- return (text.size() >= prefix.size()) && -- EqualsIgnoreCase(text.substr(0, prefix.size()), prefix); --} -- --bool EndsWithIgnoreCase(absl::string_view text, absl::string_view suffix) { -- return (text.size() >= suffix.size()) && -- EqualsIgnoreCase(text.substr(text.size() - suffix.size()), suffix); --} -- - ABSL_NAMESPACE_END - } // namespace absl -diff --git a/src/third_party/abseil-cpp/absl/strings/match.h b/src/third_party/abseil-cpp/absl/strings/match.h -index 90fca98..53ada13 100644 ---- a/src/third_party/abseil-cpp/absl/strings/match.h -+++ b/src/third_party/abseil-cpp/absl/strings/match.h -@@ -35,7 +35,9 @@ - - #include - -+#include "absl/strings/match.h" - #include "absl/strings/string_view.h" -+#include "absl/strings/internal/memutil.h" - - namespace absl { - ABSL_NAMESPACE_BEGIN -@@ -70,19 +72,30 @@ inline bool EndsWith(absl::string_view text, absl::string_view suffix) { - // - // Returns whether given ASCII strings `piece1` and `piece2` are equal, ignoring - // case in the comparison. --bool EqualsIgnoreCase(absl::string_view piece1, absl::string_view piece2); -+inline bool EqualsIgnoreCase(absl::string_view piece1, absl::string_view piece2) { -+ return (piece1.size() == piece2.size() && -+ 0 == absl::strings_internal::memcasecmp(piece1.data(), piece2.data(), -+ piece1.size())); -+ // memcasecmp uses absl::ascii_tolower(). -+} - - // StartsWithIgnoreCase() - // - // Returns whether a given ASCII string `text` starts with `prefix`, - // ignoring case in the comparison. --bool StartsWithIgnoreCase(absl::string_view text, absl::string_view prefix); -+inline bool StartsWithIgnoreCase(absl::string_view text, absl::string_view prefix) { -+ return (text.size() >= prefix.size()) && -+ EqualsIgnoreCase(text.substr(0, prefix.size()), prefix); -+} - - // EndsWithIgnoreCase() - // - // Returns whether a given ASCII string `text` ends with `suffix`, ignoring - // case in the comparison. --bool EndsWithIgnoreCase(absl::string_view text, absl::string_view suffix); -+inline bool EndsWithIgnoreCase(absl::string_view text, absl::string_view suffix) { -+ return (text.size() >= suffix.size()) && -+ EqualsIgnoreCase(text.substr(text.size() - suffix.size()), suffix); -+} - - ABSL_NAMESPACE_END - } // namespace absl diff --git a/src/third_party/openh264/src/codec/common/src/WelsThreadLib.cpp b/src/third_party/openh264/src/codec/common/src/WelsThreadLib.cpp index 8aa67f1..5c2b6e1 100644 --- a/src/third_party/openh264/src/codec/common/src/WelsThreadLib.cpp diff --git a/media-libs/tg_owt/tg_owt-0.0.20210915.recipe b/media-libs/tg_owt/tg_owt-0.0.20210915.recipe index b1d8596e8..103aa0539 100644 --- a/media-libs/tg_owt/tg_owt-0.0.20210915.recipe +++ b/media-libs/tg_owt/tg_owt-0.0.20210915.recipe @@ -3,7 +3,7 @@ DESCRIPTION="Telegram Desktop's fork of Google's WebRTC." HOMEPAGE="https://github.com/desktop-app/tg_owt" COPYRIGHT="2013-2021 Telegram" LICENSE="BSD (3-clause)" -REVISION="1" +REVISION="2" srcGitRev="575fb17d2853c43329e45f6693370f5e41668055" SOURCE_URI="https://github.com/desktop-app/tg_owt/archive/$srcGitRev.tar.gz" SOURCE_DIR="tg_owt-$srcGitRev" @@ -29,6 +29,7 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix + lib:libabsl_strings$secondaryArchSuffix lib:libavcodec$secondaryArchSuffix lib:libavformat$secondaryArchSuffix lib:libavutil$secondaryArchSuffix @@ -43,6 +44,8 @@ REQUIRES=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel + devel:libabsl_strings$secondaryArchSuffix + devel:libcrypto$secondaryArchSuffix devel:libavcodec$secondaryArchSuffix devel:libavformat$secondaryArchSuffix devel:libavutil$secondaryArchSuffix @@ -50,6 +53,7 @@ BUILD_REQUIRES=" devel:libjpeg$secondaryArchSuffix devel:libopus$secondaryArchSuffix devel:libprotobuf$secondaryArchSuffix + devel:libssl$secondaryArchSuffix devel:libswresample$secondaryArchSuffix devel:libswscale$secondaryArchSuffix devel:libz$secondaryArchSuffix @@ -80,8 +84,8 @@ BUILD() -DCMAKE_INSTALL_LIBDIR=$developLibDir \ -DCMAKE_INSTALL_INCLUDEDIR=$includeDir \ -DBUILD_SHARED_LIBS=FALSE \ - -DTG_OWT_PACKAGED_BUILD=FALSE \ - -DTG_OWT_SPECIAL_TARGET=haiku \ + -DTG_OWT_PACKAGED_BUILD=TRUE \ + -DTG_OWT_BUILD_AUDIO_BACKENDS=OFF \ -DTG_OWT_USE_PROTOBUF=FALSE \ -DTG_OWT_USE_PIPEWIRE=FALSE make $jobArgs