diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile index ee236dcca34b..a5871e50ed73 100644 --- a/net-im/telegram-desktop/Makefile +++ b/net-im/telegram-desktop/Makefile @@ -1,105 +1,106 @@ PORTNAME= telegram-desktop DISTVERSION= 3.1.9 PORTREVISION= 1 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 +MAINTAINER= glebius@FreeBSD.org COMMENT= Telegram Desktop messaging app LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE 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 \ 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 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 +CMAKE_OFF= DESKTOP_APP_USE_PACKAGED_FONTS # Disable DCHECKs, otherwise video calls will crash. CXXFLAGS+= -DNDEBUG # see Bugzilla #245452 for details NO_CCACHE= yes +INSTALLS_ICONS= 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= WEBKIT OPTIONS_DEFAULT= ALSA OPTIONS_MULTI= AUDIO OPTIONS_MULTI_AUDIO= ALSA PULSEAUDIO AUDIO_DESC= Audio backend for voice calls WEBKIT_DESC= WebKit-gtk integration for payments ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio WEBKIT_CMAKE_BOOL_OFF= DESKTOP_APP_DISABLE_WEBKITGTK WEBKIT_LIB_DEPENDS= libwebkit2gtk-4.0.so:www/webkit2-gtk3 WEBKIT_USE= GNOME=cairo,gtk30 # Telegram asks each custom build to have its own API ID and hash. TELEGRAM_API_HASH= 20a3432aab43f24bb4460fceac5ba38d TELEGRAM_API_ID= 601761 .include -.if ${CHOSEN_COMPILER_TYPE} == clang && ${COMPILER_VERSION} <= 100 -post-patch: - @${REINPLACE_CMD} -e '/-fstack-clash-protection/d' ${WRKSRC}/cmake/options_linux.cmake +.if ${COMPILER_VERSION} < 120 +LLVM_VER= 12 +BUILD_DEPENDS+= clang${LLVM_VER}:devel/llvm${LLVM_VER} +CC= ${LOCALBASE}/bin/clang${LLVM_VER} +CXX= ${LOCALBASE}/bin/clang++${LLVM_VER} .endif .include 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 deleted file mode 100644 index 8650be013302..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp.orig 2021-10-08 09:51:22 UTC -+++ Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp -@@ -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_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp deleted file mode 100644 index d690ef4e6357..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp.orig 2019-04-03 18:20:00 UTC -+++ Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp -@@ -64,6 +64,7 @@ void NetworkSocketPosix::SetMaxPriority(){ - if(res<0){ - LOGE("error setting darwin-specific net priority: %d / %s", errno, strerror(errno)); - } -+#elif defined(__FreeBSD__) - #elif defined(__linux__) - int prio=6; - int res=setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio)); diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_platform__thread__types.cc b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_platform__thread__types.cc deleted file mode 100644 index 319d7658c909..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_platform__thread__types.cc +++ /dev/null @@ -1,27 +0,0 @@ ---- Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc.orig 2018-11-23 01:03:16 UTC -+++ Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc -@@ -11,9 +11,13 @@ - #include "rtc_base/platform_thread_types.h" - - #if defined(WEBRTC_LINUX) -+#ifdef __FreeBSD__ -+#include -+#else - #include - #include - #endif -+#endif - - namespace rtc { - -@@ -27,6 +31,10 @@ PlatformThreadId CurrentThreadId() { - return gettid(); - #elif defined(WEBRTC_FUCHSIA) - return zx_thread_self(); -+#elif defined(__FreeBSD__) -+ long tid; -+ thr_self(&tid); -+ return tid; - #elif defined(WEBRTC_LINUX) - return syscall(__NR_gettid); - #else diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp deleted file mode 100644 index 4ad977ab7480..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp +++ /dev/null @@ -1,13 +0,0 @@ ---- Telegram/ThirdParty/tgcalls/tgcalls/Manager.cpp.orig 2021-07-21 01:10:26 UTC -+++ Telegram/ThirdParty/tgcalls/tgcalls/Manager.cpp -@@ -72,10 +72,6 @@ bool Manager::ResolvedNetworkStatus::operator==(const - return true; - } - --bool Manager::ResolvedNetworkStatus::operator!=(const ResolvedNetworkStatus &rhs) { -- return !(*this == rhs); --} -- - Manager::Manager(rtc::Thread *thread, Descriptor &&descriptor) : - _thread(thread), - _encryptionKey(descriptor.encryptionKey), diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h deleted file mode 100644 index 9f4cdb075506..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h +++ /dev/null @@ -1,10 +0,0 @@ ---- Telegram/ThirdParty/tgcalls/tgcalls/Manager.h.orig 2021-07-21 01:10:21 UTC -+++ Telegram/ThirdParty/tgcalls/tgcalls/Manager.h -@@ -17,7 +17,6 @@ class Manager final : public std::enable_shared_from_t - bool isLowDataRequested = false; - - bool operator==(const ResolvedNetworkStatus &rhs); -- bool operator!=(const ResolvedNetworkStatus &rhs); - }; - - public: 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 deleted file mode 100644 index 86acdd096d6d..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h +++ /dev/null @@ -1,20 +0,0 @@ ---- 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; - } - -@@ -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__base_base_zlib__help.h b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_zlib__help.h deleted file mode 100644 index bea32ef42fa7..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_zlib__help.h +++ /dev/null @@ -1,13 +0,0 @@ ---- Telegram/lib_base/base/zlib_help.h.orig 2020-05-12 13:19:31 UTC -+++ Telegram/lib_base/base/zlib_help.h -@@ -6,8 +6,8 @@ - // - #pragma once - --#include --#include -+#include "minizip/zip.h" -+#include "minizip/unzip.h" - #include "logs.h" - - #ifdef small 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 deleted file mode 100644 index 3d0e797856ff..000000000000 --- a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h +++ /dev/null @@ -1,10 +0,0 @@ ---- 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 - #include - #include - #include diff --git a/net-im/telegram-desktop/files/patch-cmake_external_rlottie_CMakeLists.txt b/net-im/telegram-desktop/files/patch-cmake_external_rlottie_CMakeLists.txt deleted file mode 100644 index 9eb9a6519ffa..000000000000 --- a/net-im/telegram-desktop/files/patch-cmake_external_rlottie_CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ ---- cmake/external/rlottie/CMakeLists.txt.orig 2020-10-23 14:48:52 UTC -+++ cmake/external/rlottie/CMakeLists.txt -@@ -7,7 +7,7 @@ - add_library(external_rlottie INTERFACE IMPORTED GLOBAL) - add_library(desktop-app::external_rlottie ALIAS external_rlottie) - --if (DESKTOP_APP_USE_PACKAGED) -+if (0) # DESKTOP_APP_USE_PACKAGED - find_package(rlottie QUIET) - - if (rlottie_FOUND)