diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile index 4b7923a14832..12264d47a854 100644 --- a/net-im/telegram-desktop/Makefile +++ b/net-im/telegram-desktop/Makefile @@ -1,98 +1,100 @@ PORTNAME= telegram-desktop -DISTVERSION= 2.8.11 -PORTREVISION= 4 +DISTVERSION= 3.1.9 CATEGORIES= net-im MASTER_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/v${DISTVERSION}/ DISTNAME= tdesktop-${DISTVERSION}-full DISTFILES= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= henry.hu.sh@gmail.com COMMENT= Telegram Desktop messaging app LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE -BROKEN_i386= Does not build, webrtc related. +BROKEN_i386= does not build, webrtc related NOT_FOR_ARCHS= powerpc powerpc64 powerpcspe NOT_FOR_ARCHS_REASON= Only little endian is supported BUILD_DEPENDS= alsa-lib>0:audio/alsa-lib \ microsoft-gsl>0:devel/microsoft-gsl \ pulseaudio>0:audio/pulseaudio \ range-v3>0:devel/range-v3 \ tl-expected>0:devel/tl-expected \ v4l_compat>0:multimedia/v4l_compat \ yasm:devel/yasm \ ${LOCALBASE}/lib/libtg_owt.a:net-im/tg_owt LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \ libdbus-1.so:devel/dbus \ libdbusmenu-qt5.so:devel/libdbusmenu-qt \ libenchant-2.so:textproc/enchant2 \ libevent.so:devel/libevent \ libhunspell-1.7.so:textproc/hunspell \ libjpeg.so:graphics/jpeg-turbo \ liblz4.so:archivers/liblz4 \ libminizip.so:archivers/minizip \ librnnoise.so:audio/rnnoise \ libopenal.so:audio/openal-soft \ libopenh264.so:multimedia/openh264 \ libopus.so:audio/opus \ libpipewire-0.3.so:multimedia/pipewire \ libqrcodegencpp.so:graphics/qr-code-generator \ libusrsctp.so:net/libusrsctp \ + libwebkit2gtk-4.0.so:www/webkit2-gtk3 \ libxcb-keysyms.so:x11/xcb-util-keysyms \ libxkbcommon.so:x11/libxkbcommon \ libxxhash.so:devel/xxhash \ libvpx.so:multimedia/libvpx USES= cmake compiler:c++17-lang desktop-file-utils gl \ gnome pkgconfig python:3.7+,build qt:5 ssl xorg USE_GITHUB= nodefault GH_ACCOUNT= telegramdesktop GH_PROJECT= tdesktop USE_GL= gl USE_GNOME= glib20 glibmm INSTALLS_ICONS= yes USE_QT= core dbus gui imageformats network widgets buildtools_build \ - qmake_build wayland + qmake_build wayland svg USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrender xrandr xtst CMAKE_ARGS= -DDESKTOP_APP_SPECIAL_TARGET="" -DTDESKTOP_LAUNCHER_BASENAME="telegramdesktop" \ -DTDESKTOP_API_ID=${TELEGRAM_API_ID} -DTDESKTOP_API_HASH=${TELEGRAM_API_HASH} \ -Ddisable_autoupdate=1 CMAKE_ON= DESKTOP_APP_USE_PACKAGED DESKTOP_APP_DISABLE_CRASH_REPORTS \ TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION \ DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION CMAKE_OFF= DESKTOP_APP_USE_PACKAGED_RLOTTIE DESKTOP_APP_USE_PACKAGED_VARIANT \ DESKTOP_APP_USE_GLIBC_WRAPS TDESKTOP_USE_PACKAGED_TGVOIP \ DESKTOP_APP_USE_PACKAGED_FONTS # Disable DCHECKs, otherwise video calls will crash. CXXFLAGS+= -DNDEBUG # see Bugzilla #245452 for details NO_CCACHE= yes # Telegram uses OpenAL for its audio, but libtgvoip (for voice calls) can use PulseAudio or ALSA. # It dynamically loads PulseAudio, and if this fails, it loads ALSA. # If both of them are not installed, then voice calls do not work, but other functionalities still work. -OPTIONS_DEFINE= GTK OPTIONS_DEFAULT= ALSA OPTIONS_MULTI= AUDIO OPTIONS_MULTI_AUDIO= ALSA PULSEAUDIO AUDIO_DESC= Audio backend for voice calls -GTK_DESC= Gtk integration (Use Gtk dialogs, etc.) ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib -GTK_CMAKE_BOOL_OFF= DESKTOP_APP_DISABLE_GTK_INTEGRATION -GTK_LIB_DEPENDS= libwebkit2gtk-4.0.so:www/webkit2-gtk3 -GTK_USE= GNOME=gtk30 PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio # Telegram asks each custom build to have its own API ID and hash. TELEGRAM_API_HASH= 20a3432aab43f24bb4460fceac5ba38d TELEGRAM_API_ID= 601761 -.include +.include + +.if ${CHOSEN_COMPILER_TYPE} == clang && ${COMPILER_VERSION} <= 100 +post-patch: + @${REINPLACE_CMD} -e '/-fstack-clash-protection/d' ${WRKSRC}/cmake/options_linux.cmake +.endif + +.include diff --git a/net-im/telegram-desktop/distinfo b/net-im/telegram-desktop/distinfo index be2453ce719a..c4fde3b70327 100644 --- a/net-im/telegram-desktop/distinfo +++ b/net-im/telegram-desktop/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1626644072 -SHA256 (tdesktop-2.8.11-full.tar.gz) = 168487a59a8ae6ca1fbd66ccefc9eae19344af61bfb8d4cdde3cf73c115aa9dc -SIZE (tdesktop-2.8.11-full.tar.gz) = 37105468 +TIMESTAMP = 1633724864 +SHA256 (tdesktop-3.1.9-full.tar.gz) = 569555194f8c8396ee21de44971709dc0d331fe9b3d99cce49977d6dd19fcecf +SIZE (tdesktop-3.1.9-full.tar.gz) = 38494199 diff --git a/net-im/telegram-desktop/files/patch-Telegram_CMakeLists.txt b/net-im/telegram-desktop/files/patch-Telegram_CMakeLists.txt deleted file mode 100644 index b73658c83961..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ ---- Telegram/CMakeLists.txt.orig 2020-02-18 08:28:06 UTC -+++ Telegram/CMakeLists.txt -@@ -4,6 +4,7 @@ - # For license and copyright information please follow this link: - # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - -+link_directories(${OPUS_LIBDIR}) - add_executable(Telegram WIN32 MACOSX_BUNDLE) - init_target(Telegram) - diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp index 0a485f86df83..8650be013302 100644 --- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp +++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp @@ -1,11 +1,11 @@ ---- Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp.orig 2020-08-23 13:36:52 UTC +--- Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp.orig 2021-10-08 09:51:22 UTC +++ Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp -@@ -88,7 +88,7 @@ constexpr auto kRefreshTimeout = 7200 * crl::time(1000 +@@ -99,7 +99,7 @@ constexpr auto kRefreshTimeout = 7200 * crl::time(1000 }, 5, }; - static const auto list = std::array{ + static const auto list = std::array{ &color1, &color2, &color3, diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_specific__linux.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_specific__linux.cpp deleted file mode 100644 index 6a5dbdc9c42c..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_specific__linux.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- Telegram/SourceFiles/platform/linux/specific_linux.cpp.orig 2021-07-17 09:47:10 UTC -+++ Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -48,7 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/maste - #include - #include - #include --#include -+#include - - #include - #include diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp deleted file mode 100644 index 1b19e7c3c042..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig 2020-02-12 13:11:18 UTC -+++ Telegram/ThirdParty/libtgvoip/VoIPController.cpp -@@ -3005,7 +3005,7 @@ static void initMachTimestart() { - #endif - - double VoIPController::GetCurrentTime(){ --#if defined(__linux__) -+#if defined(__linux__) || defined(__FreeBSD__) - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return ts.tv_sec+(double)ts.tv_nsec/1000000000.0; diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioIO.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioIO.cpp deleted file mode 100644 index 80883aad5e83..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioIO.cpp +++ /dev/null @@ -1,20 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/audio/AudioIO.cpp.orig 2018-12-31 01:05:58 UTC -+++ Telegram/ThirdParty/libtgvoip/audio/AudioIO.cpp -@@ -31,7 +31,7 @@ - #endif - #include "../os/windows/AudioInputWASAPI.h" - #include "../os/windows/AudioOutputWASAPI.h" --#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__gnu_hurd__) -+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__gnu_hurd__) - #ifndef WITHOUT_ALSA - #include "../os/linux/AudioInputALSA.h" - #include "../os/linux/AudioOutputALSA.h" -@@ -65,7 +65,7 @@ AudioIO* AudioIO::Create(std::string inputDevice, std: - return new ContextlessAudioIO(inputDevice, outputDevice); - #endif - return new ContextlessAudioIO(inputDevice, outputDevice); --#elif defined(__linux__) -+#elif defined(__linux__) || defined(__FreeBSD__) - #ifndef WITHOUT_ALSA - #ifndef WITHOUT_PULSE - if(AudioPulse::Load()){ diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp deleted file mode 100644 index 241943022c2e..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp +++ /dev/null @@ -1,20 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp.orig 2018-12-31 01:05:58 UTC -+++ Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp -@@ -26,7 +26,7 @@ - #include "../os/windows/AudioInputWave.h" - #endif - #include "../os/windows/AudioInputWASAPI.h" --#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__gnu_hurd__) -+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__gnu_hurd__) - #ifndef WITHOUT_ALSA - #include "../os/linux/AudioInputALSA.h" - #endif -@@ -72,7 +72,7 @@ void AudioInput::EnumerateDevices(std::vector --#elif defined(__linux__) -+#elif defined(__linux__) || defined(__FreeBSD__) - #include - #endif - -@@ -51,7 +51,7 @@ void tgvoip_log_file_write_header(FILE* file){ - #else - char* systemVersion="Windows RT"; - #endif --#elif defined(__linux__) -+#elif defined(__linux__) || defined(__FreeBSD__) - #ifdef __ANDROID__ - char systemVersion[128]; - char sysRel[PROP_VALUE_MAX]; diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp deleted file mode 100644 index 750f205f7496..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp +++ /dev/null @@ -1,13 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp.orig 2018-11-23 01:03:16 UTC -+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp -@@ -12,6 +12,10 @@ - #include "../../logging.h" - #include "../../VoIPController.h" - -+#ifndef typeof -+#define typeof __typeof__ -+#endif -+ - using namespace tgvoip::audio; - - #define BUFFER_SIZE 960 diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp deleted file mode 100644 index 5b409bc4e3e8..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp +++ /dev/null @@ -1,13 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp.orig 2018-11-23 01:03:16 UTC -+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp -@@ -11,6 +11,10 @@ - #include "../../logging.h" - #include "../../VoIPController.h" - -+#ifndef typeof -+#define typeof __typeof__ -+#endif -+ - #define BUFFER_SIZE 960 - #define CHECK_ERROR(res, msg) if(res<0){LOGE(msg ": %s", _snd_strerror(res)); failed=true; return;} - #define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); failed=true; return;} diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h deleted file mode 100644 index e1b6695ccac0..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h +++ /dev/null @@ -1,23 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/threading.h.orig 2018-11-23 01:03:16 UTC -+++ Telegram/ThirdParty/libtgvoip/threading.h -@@ -18,6 +18,9 @@ - #ifdef __APPLE__ - #include "os/darwin/DarwinSpecific.h" - #endif -+#ifdef __FreeBSD__ -+#include -+#endif - - namespace tgvoip{ - class Mutex{ -@@ -92,7 +95,9 @@ namespace tgvoip{ - static void* ActualEntryPoint(void* arg){ - Thread* self=reinterpret_cast(arg); - if(self->name){ --#if !defined(__APPLE__) && !defined(__gnu_hurd__) -+#if defined(__FreeBSD__) -+ pthread_set_name_np(self->thread, self->name); -+#elif !defined(__APPLE__) && !defined(__gnu_hurd__) - pthread_setname_np(self->thread, self->name); - #elif !defined(__gnu_hurd__) - pthread_setname_np(self->name); diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_stringutils.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_stringutils.h deleted file mode 100644 index d5cbd84ab180..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_stringutils.h +++ /dev/null @@ -1,11 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/stringutils.h.orig 2018-11-23 01:03:16 UTC -+++ Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/stringutils.h -@@ -25,7 +25,7 @@ - #endif // WEBRTC_WIN - - #if defined(WEBRTC_POSIX) --#ifdef BSD -+#ifdef __FreeBSD__ - #include - #else // BSD - #include diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h index e72f800947a4..86acdd096d6d 100644 --- a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h +++ b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h @@ -1,20 +1,20 @@ ---- Telegram/lib_base/base/bytes.h.orig 2020-05-12 13:19:31 UTC +--- Telegram/lib_base/base/bytes.h.orig 2021-10-06 07:02:39 UTC +++ Telegram/lib_base/base/bytes.h @@ -145,7 +145,7 @@ template < vector concatenate(Args &&...args) { const auto size = details::spansLength(args...); auto result = vector(size); - details::spansAppend(make_span(result), args...); + details::spansAppend(bytes::make_span(result), args...); return result; } -@@ -157,7 +157,7 @@ vector concatenate(SpanRange args) { +@@ -156,7 +156,7 @@ vector concatenate(SpanRange args) { size += bytes::make_span(arg).size(); } auto result = vector(size); - auto buffer = make_span(result); + auto buffer = bytes::make_span(result); for (const auto &arg : args) { const auto part = bytes::make_span(arg); bytes::copy(buffer, part); diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h index 4d3abc07b7be..3d0e797856ff 100644 --- a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h +++ b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h @@ -1,10 +1,10 @@ --- Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h.orig 2021-07-07 09:00:15 UTC +++ Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h @@ -6,6 +6,7 @@ // #pragma once +#include // Required for glib/gatomic.h - extern "C" { #include #include + #include diff --git a/net-im/telegram-desktop/files/patch-cmake_external_CMakeLists.txt b/net-im/telegram-desktop/files/patch-cmake_external_CMakeLists.txt deleted file mode 100644 index e2b542cb42f4..000000000000 --- a/net-im/telegram-desktop/files/patch-cmake_external_CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ ---- cmake/external/CMakeLists.txt.orig 2021-07-13 19:08:45 UTC -+++ cmake/external/CMakeLists.txt -@@ -37,9 +37,6 @@ if (add_hunspell_library) - add_checked_subdirectory(hunspell) - endif() - add_checked_subdirectory(iconv) --if (LINUX) -- add_checked_subdirectory(jemalloc) --endif() - add_checked_subdirectory(jpeg) - if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) - add_checked_subdirectory(kwayland) diff --git a/net-im/telegram-desktop/files/patch-cmake_options__linux.cmake b/net-im/telegram-desktop/files/patch-cmake_options__linux.cmake deleted file mode 100644 index aa6e5e7df10e..000000000000 --- a/net-im/telegram-desktop/files/patch-cmake_options__linux.cmake +++ /dev/null @@ -1,14 +0,0 @@ ---- cmake/options_linux.cmake.orig 2021-07-13 19:08:45 UTC -+++ cmake/options_linux.cmake -@@ -58,11 +58,6 @@ if (DESKTOP_APP_SPECIAL_TARGET) - endif() - endif() - --target_link_libraries(common_options --INTERFACE -- desktop-app::external_jemalloc --) -- - if (DESKTOP_APP_USE_PACKAGED) - find_library(ATOMIC_LIBRARY atomic) - else()