diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile index 2d1b9476ba07..4b61f33b21d4 100644 --- a/net-im/telegram-desktop/Makefile +++ b/net-im/telegram-desktop/Makefile @@ -1,118 +1,119 @@ PORTNAME= telegram-desktop -DISTVERSION= 4.2.4 -PORTREVISION= 1 +DISTVERSION= 4.4.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= osa@FreeBSD.org COMMENT= Telegram Desktop messaging app WWW= https://desktop.telegram.org/ 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= libabsl_base.so:devel/abseil \ libavformat.so:multimedia/ffmpeg \ libdbus-1.so:devel/dbus \ libdispatch.so:devel/libdispatch \ libenchant-2.so:textproc/enchant2 \ libhunspell-1.7.so:textproc/hunspell \ libjpeg.so:graphics/jpeg-turbo \ liblz4.so:archivers/liblz4 \ + libminizip.so:archivers/minizip \ libopenal.so:audio/openal-soft \ libopenh264.so:multimedia/openh264 \ libopus.so:audio/opus \ libpipewire-0.3.so:multimedia/pipewire \ + libprotobuf.so:devel/protobuf \ libqrcodegencpp.so:graphics/qr-code-generator \ librnnoise.so:audio/rnnoise \ libxcb-keysyms.so:x11/xcb-util-keysyms \ libxkbcommon.so:x11/libxkbcommon \ libxxhash.so:devel/xxhash \ libvpx.so:multimedia/libvpx FLAVORS= qt5 qt6 FLAVOR?= ${FLAVORS:[1]} qt5_PKGNAMESUFFIX= qt6_PKGNAMESUFFIX= -qt6 qt5_CONFLICTS_INSTALL= ${PORTNAME}-qt6 qt6_CONFLICTS_INSTALL= ${PORTNAME} USES= cmake compiler:c++17-lang desktop-file-utils gl \ - gnome pkgconfig python:3.7+,build ssl xorg + gnome localbase pkgconfig python:3.7+,build ssl xorg USE_GITHUB= nodefault GH_ACCOUNT= telegramdesktop GH_PROJECT= tdesktop .if ${FLAVOR} == qt5 USES+= kde:5 qt:5 USE_QT= buildtools:build core dbus gui imageformats network qmake:build \ svg wayland widgets USE_KDE= coreaddons kimageformats .else USES+= qt:6 USE_QT= 5compat base imageformats lottie shadertools svg tools:build wayland .endif USE_GL= gl -USE_GNOME= glib20 glibmm +USE_GNOME= glib20 glibmm26 USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrandr xrender 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 \ DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION CMAKE_OFF= DESKTOP_APP_USE_PACKAGED_FONTS # libdispatch components LDFLAGS+= -lBlocksRuntime # 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= 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 ${COMPILER_VERSION} < 130 LLVM_VER= 13 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/distinfo b/net-im/telegram-desktop/distinfo index 1ef1665503fe..217bbbf98d1f 100644 --- a/net-im/telegram-desktop/distinfo +++ b/net-im/telegram-desktop/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1664664542 -SHA256 (tdesktop-4.2.4-full.tar.gz) = a8109fce9d55553efcbc7c3d9349869e1e267113f5badaf48cf4e0c25cd559d1 -SIZE (tdesktop-4.2.4-full.tar.gz) = 49210806 +TIMESTAMP = 1670536925 +SHA256 (tdesktop-4.4.1-full.tar.gz) = 76981e32541c42b3212427e9abb4db2a6f55a14eaba31b3d7ad7d3d5ed8008b1 +SIZE (tdesktop-4.4.1-full.tar.gz) = 50077498 diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_notifications__manager__linux.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_notifications__manager__linux.cpp new file mode 100644 index 000000000000..99edcb91d928 --- /dev/null +++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_notifications__manager__linux.cpp @@ -0,0 +1,54 @@ +--- Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp.orig 2022-12-07 09:41:04 UTC ++++ Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +@@ -75,12 +75,17 @@ std::unique_ptr + try { + const auto connection = Gio::DBus::Connection::get_sync( + Gio::DBus::BusType::SESSION); ++ const auto GlibNames = ++ base::Platform::DBus::ListActivatableNames(connection); ++ const std::vector StringNames( ++ GlibNames.begin(), GlibNames.end() ++ ); + + const auto activatable = [&] { + try { + return ranges::contains( +- base::Platform::DBus::ListActivatableNames(connection), +- Glib::ustring(std::string(kService))); ++ StringNames, ++ std::string(kService)); + } catch (...) { + // avoid service restart loop in sandboxed environments + return true; +@@ -129,7 +134,7 @@ void StartServiceAsync(Fn callback) { + }; + + const auto errorName = +- Gio::DBus::ErrorUtils::get_remote_error(e); ++ Gio::DBus::ErrorUtils::get_remote_error(e).raw(); + + if (!ranges::contains(NotSupportedErrors, errorName)) { + throw e; +@@ -151,6 +156,11 @@ bool GetServiceRegistered() { + try { + const auto connection = Gio::DBus::Connection::get_sync( + Gio::DBus::BusType::SESSION); ++ const auto GlibNames = ++ base::Platform::DBus::ListActivatableNames(connection); ++ const std::vector StringNames( ++ GlibNames.begin(), GlibNames.end() ++ ); + + const auto hasOwner = [&] { + try { +@@ -165,8 +175,8 @@ bool GetServiceRegistered() { + static const auto activatable = [&] { + try { + return ranges::contains( +- DBus::ListActivatableNames(connection), +- Glib::ustring(std::string(kService))); ++ StringNames, ++ std::string(kService)); + } catch (...) { + return false; + } 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 new file mode 100644 index 000000000000..364d86fdf5f7 --- /dev/null +++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_specific__linux.cpp @@ -0,0 +1,39 @@ +--- Telegram/SourceFiles/platform/linux/specific_linux.cpp.orig 2022-12-07 09:41:04 UTC ++++ Telegram/SourceFiles/platform/linux/specific_linux.cpp +@@ -244,12 +244,16 @@ void LaunchGApplication() { + const auto activatableNames = [&] { + try { + if (connection) { +- return ListActivatableNames(connection); ++ const auto GlibNames = ++ ListActivatableNames(connection); ++ return std::vector( ++ GlibNames.begin(), GlibNames.end() ++ ); + } + } catch (...) { + } + +- return std::vector(); ++ return std::vector(); + }(); + + const auto freedesktopNotifications = [&] { +@@ -356,7 +360,7 @@ void LaunchGApplication() { + + using Window::Notifications::Manager; + using NotificationId = Manager::NotificationId; +- using NotificationIdTuple = std::result_of< ++ using NotificationIdTuple = ranges::result_of< + decltype(&NotificationId::toTuple)(NotificationId*) + >::type; + +@@ -731,7 +735,7 @@ void start() { + md5Hash.data()); + } + +- return u"org.telegram.desktop._%1.desktop"_q.arg(md5Hash); ++ return u"org.telegram.desktop._%1.desktop"_q.arg(md5Hash.constData()); + } + + return u"org.telegram.desktop.desktop"_q; diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_platform_linux_base__last__input__linux.cpp b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_platform_linux_base__last__input__linux.cpp new file mode 100644 index 000000000000..82f5a0b7acf8 --- /dev/null +++ b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_platform_linux_base__last__input__linux.cpp @@ -0,0 +1,21 @@ +--- Telegram/lib_base/base/platform/linux/base_last_input_linux.cpp.orig 2022-12-07 06:59:17 UTC ++++ Telegram/lib_base/base/platform/linux/base_last_input_linux.cpp +@@ -103,7 +103,7 @@ std::optional FreedesktopDBusLastUserInputT + "org.freedesktop.DBus.Error.AccessDenied", + }; + +- const auto errorName = Gio::DBus::ErrorUtils::get_remote_error(e); ++ const auto errorName = Gio::DBus::ErrorUtils::get_remote_error(e).raw(); + if (ranges::contains(NotSupportedErrors, errorName)) { + NotSupported = true; + return std::nullopt; +@@ -163,7 +163,7 @@ std::optional MutterDBusLastUserInputTime() + "org.freedesktop.DBus.Error.AccessDenied", + }; + +- const auto errorName = Gio::DBus::ErrorUtils::get_remote_error(e); ++ const auto errorName = Gio::DBus::ErrorUtils::get_remote_error(e).raw(); + if (ranges::contains(NotSupportedErrors, errorName)) { + NotSupported = true; + return std::nullopt; + diff --git a/net-im/telegram-desktop/pkg-plist b/net-im/telegram-desktop/pkg-plist index 9f9a17a5ff0e..106d6671dbba 100644 --- a/net-im/telegram-desktop/pkg-plist +++ b/net-im/telegram-desktop/pkg-plist @@ -1,10 +1,10 @@ bin/telegram-desktop -share/applications/telegramdesktop.desktop +share/applications/org.telegram.desktop.desktop share/icons/hicolor/128x128/apps/telegram.png share/icons/hicolor/16x16/apps/telegram.png share/icons/hicolor/256x256/apps/telegram.png share/icons/hicolor/32x32/apps/telegram.png share/icons/hicolor/48x48/apps/telegram.png share/icons/hicolor/512x512/apps/telegram.png share/icons/hicolor/64x64/apps/telegram.png -share/metainfo/telegramdesktop.metainfo.xml +share/metainfo/org.telegram.desktop.metainfo.xml