diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile index 83722a378102..d104f840c0a7 100644 --- a/net-im/telegram-desktop/Makefile +++ b/net-im/telegram-desktop/Makefile @@ -1,121 +1,120 @@ PORTNAME= telegram-desktop -DISTVERSION= 4.9.3 -PORTREVISION= 1 +DISTVERSION= 4.9.8 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= ports@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 BROKEN_SSL= openssl30 openssl31 BROKEN_SSL_REASON= undefined symbol: ERR_load_BIO_strings NOT_FOR_ARCHS= powerpc powerpc64 powerpcspe NOT_FOR_ARCHS_REASON= Only little endian is supported BUILD_DEPENDS= boost-libs>0:devel/boost-libs \ microsoft-gsl>0:devel/microsoft-gsl \ 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 \ libfmt.so:devel/libfmt \ libhunspell-1.7.so:textproc/hunspell \ liblz4.so:archivers/liblz4 \ 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 desktop-file-utils gl gnome jpeg localbase \ minizip openal pkgconfig python: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 \ +USE_QT= buildtools:build core dbus declarative 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 glibmm26 introspection USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrandr xrender xtst CMAKE_ARGS= -DTDESKTOP_API_ID=${TELEGRAM_API_ID} -DTDESKTOP_API_HASH=${TELEGRAM_API_HASH} CMAKE_ON= DESKTOP_APP_USE_PACKAGED DESKTOP_APP_DISABLE_CRASH_REPORTS \ DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION # Since cmake 3.25.0, BSDs are no longer recognised as Linux (in this port). CMAKE_ARGS+= -DLINUX=true # libdispatch components LDFLAGS+= -lBlocksRuntime # 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= SYSTEM_FONTS OPTIONS_DEFAULT= ALSA OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO AUDIO_DESC= Audio backend for voice calls SYSTEM_FONTS_DESC= Use system fonts instead of bundled patched ones ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio ALSA_CMAKE_BOOL_OFF= LIBTGVOIP_DISABLE_ALSA PULSEAUDIO_CMAKE_BOOL_OFF= LIBTGVOIP_DISABLE_PULSEAUDIO SYSTEM_FONTS_CMAKE_BOOL_OFF= DESKTOP_APP_USE_PACKAGED_FONTS # Telegram asks each custom build to have its own API ID and hash. TELEGRAM_API_HASH= 20a3432aab43f24bb4460fceac5ba38d TELEGRAM_API_ID= 601761 .include .if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400000 && ${OSVERSION} < 1400079 -USES+= llvm:build +USES+= llvm:max=15,build .else USES+= compiler:c++20-lang .endif post-patch: # XXX fix the following on every source file # warning: unknown warning option '-Wno-maybe-uninitialized' # warning: argument unused during compilation: '-fstack-clash-protection' ${REINPLACE_CMD} -e /-Wno-maybe-uninitialized/d -e /-fstack-clash-protection/d \ ${WRKSRC}/cmake/options_linux.cmake .include diff --git a/net-im/telegram-desktop/distinfo b/net-im/telegram-desktop/distinfo index ee9cbae15235..69c861bf77d0 100644 --- a/net-im/telegram-desktop/distinfo +++ b/net-im/telegram-desktop/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1695648456 -SHA256 (tdesktop-4.9.3-full.tar.gz) = 2ef462651d397d807576f5df3a5d3de2764accf8d155a0b4d576a354a614d107 -SIZE (tdesktop-4.9.3-full.tar.gz) = 69517868 +TIMESTAMP = 1695904525 +SHA256 (tdesktop-4.9.8-full.tar.gz) = af041ecb623ee7603781e0ff2b262e15bb8de2858a9a42982a10396bc9014d53 +SIZE (tdesktop-4.9.8-full.tar.gz) = 73655253 diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__compositor.cpp b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__compositor.cpp new file mode 100644 index 000000000000..c46fa3c11634 --- /dev/null +++ b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__compositor.cpp @@ -0,0 +1,14 @@ +--- Telegram/lib_webview/webview/platform/linux/webview_linux_compositor.cpp.orig 2023-09-22 07:01:01 UTC ++++ Telegram/lib_webview/webview/platform/linux/webview_linux_compositor.cpp +@@ -199,8 +199,9 @@ Compositor::Compositor() + const auto output = new Output(this, xdgSurface); + + output->chrome().surfaceCompleted() | rpl::start_with_next([=] { +- const auto parent = qvariant_cast( +- popup->parentXdgSurface()->property("output"))->window(); ++ const auto parent = (*static_cast( ++ popup->parentXdgSurface()->property("output").constData() ++ ))->window(); + if (_private->widget + && parent == _private->widget->quickWindow()) { + output->window()->setTransientParent( diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkitgtk.cpp b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkitgtk.cpp new file mode 100644 index 000000000000..3a97b98103f6 --- /dev/null +++ b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkitgtk.cpp @@ -0,0 +1,48 @@ +--- Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk.cpp.orig 2023-09-22 07:01:01 UTC ++++ Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk.cpp +@@ -33,6 +33,13 @@ constexpr auto kHelperObjectPath = "/org/desktop_app/G + constexpr auto kMasterObjectPath = "/org/desktop_app/GtkIntegration/Webview/Master"; + constexpr auto kHelperObjectPath = "/org/desktop_app/GtkIntegration/Webview/Helper"; + ++void (* const SetGraphicsApi)(QSGRendererInterface::GraphicsApi) = ++#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) ++ QQuickWindow::setGraphicsApi; ++#else // Qt >= 6.0.0 ++ QQuickWindow::setSceneGraphBackend; ++#endif // Qt < 6.0.0 ++ + std::string SocketPath; + + inline std::string SocketPathToDBusAddress(const std::string &socketPath) { +@@ -116,12 +123,10 @@ Instance::Instance(bool remoting) + Ui::GL::CheckCapabilities(nullptr)); + switch (backend) { + case Ui::GL::Backend::Raster: +- QQuickWindow::setGraphicsApi( +- QSGRendererInterface::Software); ++ SetGraphicsApi(QSGRendererInterface::Software); + break; + case Ui::GL::Backend::OpenGL: +- QQuickWindow::setGraphicsApi( +- QSGRendererInterface::OpenGL); ++ SetGraphicsApi(QSGRendererInterface::OpenGL); + break; + } + return true; +@@ -637,11 +642,11 @@ void Instance::setOpaqueBg(QColor opaqueBg) { + return; + } + +- GdkRGBA rgba{ +- opaqueBg.redF(), +- opaqueBg.greenF(), +- opaqueBg.blueF(), +- opaqueBg.alphaF(), ++ const GdkRGBA rgba{ ++ float(opaqueBg.redF()), ++ float(opaqueBg.greenF()), ++ float(opaqueBg.blueF()), ++ float(opaqueBg.alphaF()), + }; + webkit_web_view_set_background_color( + WEBKIT_WEB_VIEW(_webview), diff --git a/net-im/telegram-desktop/files/patch-cmake_external_qt_CMakeLists.txt b/net-im/telegram-desktop/files/patch-cmake_external_qt_CMakeLists.txt new file mode 100644 index 000000000000..3604617e930c --- /dev/null +++ b/net-im/telegram-desktop/files/patch-cmake_external_qt_CMakeLists.txt @@ -0,0 +1,44 @@ +--- cmake/external/qt/CMakeLists.txt.orig 2023-09-13 17:06:28 UTC ++++ cmake/external/qt/CMakeLists.txt +@@ -16,6 +16,8 @@ if (DESKTOP_APP_USE_PACKAGED) + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate ++ $ ++ $ + $ + Qt::Widgets + Qt::WidgetsPrivate +@@ -36,6 +38,7 @@ INTERFACE + ${qt_loc}/include + ${qt_loc}/include/QtCore + ${qt_loc}/include/QtGui ++ $<$:${qt_loc}/include/QtServiceSupport> + $<$:${qt_loc}/include/QtOpenGL> + ${qt_loc}/include/QtWidgets + $<$:${qt_loc}/include/QtOpenGLWidgets> +@@ -46,9 +49,11 @@ INTERFACE + $<$:${qt_loc}/include/QtWaylandCompositor> + ${qt_loc}/include/QtCore/${qt_version} + ${qt_loc}/include/QtGui/${qt_version} ++ ${qt_loc}/include/QtServiceSupport/${qt_version} + ${qt_loc}/include/QtWidgets/${qt_version} + ${qt_loc}/include/QtCore/${qt_version}/QtCore + ${qt_loc}/include/QtGui/${qt_version}/QtGui ++ ${qt_loc}/include/QtServiceSupport/${qt_version}/QtServiceSupport + ${qt_loc}/include/QtWidgets/${qt_version}/QtWidgets + ) + +@@ -92,6 +97,12 @@ set(common_qt_libs + lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Gui + lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}Core + ) ++ ++if (TARGET Qt::ServiceSupport) ++ list(PREPEND common_qt_libs ++ lib/${qt_lib_prefix}Qt${QT_VERSION_MAJOR}ServiceSupport ++ ) ++endif() + + if (TARGET Qt::OpenGL) + list(PREPEND common_qt_libs diff --git a/net-im/telegram-desktop/files/patch-cmake_external_qt_package.cmake b/net-im/telegram-desktop/files/patch-cmake_external_qt_package.cmake new file mode 100644 index 000000000000..9c9fe0c93f1d --- /dev/null +++ b/net-im/telegram-desktop/files/patch-cmake_external_qt_package.cmake @@ -0,0 +1,11 @@ +--- cmake/external/qt/package.cmake.orig 2023-09-13 17:06:28 UTC ++++ cmake/external/qt/package.cmake +@@ -45,6 +45,8 @@ if (QT_VERSION_MAJOR GREATER_EQUAL 6) + set(qt_version_6_5_or_greater 1) + endif() + find_package(Qt${QT_VERSION_MAJOR} COMPONENTS OpenGL OpenGLWidgets REQUIRED) ++else() ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ServiceSupport REQUIRED) + endif() + + # QtWaylandScanner cmake integration from Qt 6 is used