From 322d2c452bf1a4df7b9fe161d4991a347043550c Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Wed, 2 Mar 2022 01:07:48 +0100 Subject: [PATCH] Introduce TDESKTOP_DISABLE_LEGACY_TGVOIP Originally from Alt Linux[0], OpenBSD has so far adapted the removal of tgvoip in the official net/tdesktop build. tgcalls provides everything needed for calls; audio/video/desktop sharing calls have been working fine across different operating systems and telegram desktop/mobile versions without problems. 0: http://www.sisyphus.ru/cgi-bin/srpm.pl/Sisyphus/telegram-desktop/getpatch/1 --- Telegram/CMakeLists.txt | 6 +++--- Telegram/SourceFiles/calls/calls_call.cpp | 6 ++++++ Telegram/cmake/lib_tgcalls.cmake | 4 ++++ Telegram/cmake/telegram_options.cmake | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 008c71b15..291305909 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -26,7 +26,9 @@ get_filename_component(res_loc Resources REALPATH) include(cmake/telegram_options.cmake) include(cmake/lib_ffmpeg.cmake) include(cmake/lib_stripe.cmake) -include(cmake/lib_tgvoip.cmake) +if (NOT TDESKTOP_DISABLE_LEGACY_TGVOIP) + include(cmake/lib_tgvoip.cmake) +endif() include(cmake/lib_tgcalls.cmake) include(cmake/td_export.cmake) include(cmake/td_mtproto.cmake) @@ -49,9 +51,7 @@ set_target_properties(Telegram PROPERTIES AUTOMOC ON) target_link_libraries(Telegram PRIVATE - tdesktop::lib_tgcalls_legacy tdesktop::lib_tgcalls - tdesktop::lib_tgvoip # Order in this list defines the order of include paths in command line. # We need to place desktop-app::external_minizip this early to have its diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp index 5fe9ac677..bebf48e70 100644 --- a/Telegram/SourceFiles/calls/calls_call.cpp +++ b/Telegram/SourceFiles/calls/calls_call.cpp @@ -39,8 +39,10 @@ class InstanceImpl; class InstanceV2Impl; class InstanceV2ReferenceImpl; class InstanceV2_4_0_0Impl; +#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP class InstanceImplLegacy; void SetLegacyGlobalServerConfig(const std::string &serverConfig); +#endif } // namespace tgcalls namespace Calls { @@ -56,7 +58,9 @@ const auto Register = tgcalls::Register(); const auto RegisterV2 = tgcalls::Register(); const auto RegV2Ref = tgcalls::Register(); const auto RegisterV240 = tgcalls::Register(); +#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP const auto RegisterLegacy = tgcalls::Register(); +#endif [[nodiscard]] base::flat_set CollectEndpointIds( const QVector &list) { @@ -1332,7 +1336,9 @@ Call::~Call() { } void UpdateConfig(const std::string &data) { +#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP tgcalls::SetLegacyGlobalServerConfig(data); +#endif } } // namespace Calls diff --git a/Telegram/cmake/lib_tgcalls.cmake b/Telegram/cmake/lib_tgcalls.cmake index 94cfdb856..9ac4fe479 100644 --- a/Telegram/cmake/lib_tgcalls.cmake +++ b/Telegram/cmake/lib_tgcalls.cmake @@ -268,6 +268,10 @@ PRIVATE ${tgcalls_loc} ) +if (TDESKTOP_DISABLE_LEGACY_TGVOIP) + return() +endif() + add_library(lib_tgcalls_legacy STATIC) init_target(lib_tgcalls_legacy) diff --git a/Telegram/cmake/telegram_options.cmake b/Telegram/cmake/telegram_options.cmake index a5a6d9405..2eb9953f2 100644 --- a/Telegram/cmake/telegram_options.cmake +++ b/Telegram/cmake/telegram_options.cmake @@ -4,7 +4,9 @@ # For license and copyright information please follow this link: # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +option(TDESKTOP_DISABLE_LEGACY_TGVOIP "Disable legacy tgvoip support." OFF) option(TDESKTOP_API_TEST "Use test API credentials." OFF) + set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.") set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.") @@ -36,6 +38,12 @@ if (TDESKTOP_API_ID STREQUAL "0" OR TDESKTOP_API_HASH STREQUAL "") " ") endif() +if (TDESKTOP_DISABLE_LEGACY_TGVOIP) + target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_LEGACY_TGVOIP) +else() + target_link_libraries(Telegram PRIVATE tdesktop::lib_tgcalls_legacy tdesktop::lib_tgvoip) +endif() + if (DESKTOP_APP_DISABLE_AUTOUPDATE) target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE) endif() -- 2.39.2 s): new exported procedure. * gnu/system/image.scm (partition->gexp): Adapt accordingly. * gnu/build/image.scm (sexp->partition): Also adapt accordingly, (make-ext-image): and pass file-system options to mke2fs. Mathieu Othacehe 2020-05-26image: Set offset default to zero....* gnu/image.scm (<partition>)[offset]: Set to zero by default. * gnu/system/image.scm (system-disk-image): Adapt accordingly. Mathieu Othacehe 2020-05-26image: Add partition offset support....* gnu/image.scm (partition-offset): New procedure, (<partition>)[offset]: new field. * gnu/system/image.scm (system-disk-image): Apply the partition offset. Mathieu Othacehe 2020-05-05image: Add a new API....Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This is quite fragile, very slow, and almost unusable without KVM. For all these reasons, add support for host image generation. This implies the use new image generation mechanisms. - Raw disk images: images of partitions are created using tools such as mke2fs and mkdosfs depending on the partition file-system type. The partition images are then assembled into a final image using genimage. - ISO9660 images: the ISO root directory is populated within the store. GNU xorriso is then called on that directory, in the exact same way as this is done in (gnu build vm) module. Those mechanisms are built upon the new (gnu image) module. * gnu/image.scm: New file. * gnu/system/image.scm: New file. * gnu/build/image: New file. * gnu/local.mk: Add them. * gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm. * gnu/ci.scm (qemu-jobs): Adapt to new API. * gnu/tests/install.scm (run-install): Ditto. * guix/scripts/system.scm (system-derivation-for-action): Ditto. Mathieu Othacehe