Skip to content

Commit

Permalink
net-im/telegram-desktop: update to 4.9.8 release
Browse files Browse the repository at this point in the history
* Backport webview patches from upstream
* Fix build with qt5, required #include <private/qgenericunixservices_p.h>
  is still provided by QtServiceSupport module but moved to QtGui in Qt6

PR:	274143
  • Loading branch information
fluffykhv committed Sep 28, 2023
1 parent 144e1b6 commit bb380e5
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 7 deletions.
7 changes: 3 additions & 4 deletions net-im/telegram-desktop/Makefile
@@ -1,6 +1,5 @@
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
Expand Down Expand Up @@ -60,7 +59,7 @@ 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
Expand Down Expand Up @@ -106,7 +105,7 @@ TELEGRAM_API_ID= 601761
.include <bsd.port.options.mk>

.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400000 && ${OSVERSION} < 1400079
USES+= llvm:build
USES+= llvm:max=15,build
.else
USES+= compiler:c++20-lang
.endif
Expand Down
6 changes: 3 additions & 3 deletions 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
@@ -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<Output*>(
- popup->parentXdgSurface()->property("output"))->window();
+ const auto parent = (*static_cast<Output * const *>(
+ popup->parentXdgSurface()->property("output").constData()
+ ))->window();
if (_private->widget
&& parent == _private->widget->quickWindow()) {
output->window()->setTransientParent(
@@ -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),
@@ -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
+ $<TARGET_NAME_IF_EXISTS:Qt::ServiceSupport>
+ $<TARGET_NAME_IF_EXISTS:Qt::ServiceSupportPrivate>
$<TARGET_NAME_IF_EXISTS:Qt::OpenGL>
Qt::Widgets
Qt::WidgetsPrivate
@@ -36,6 +38,7 @@ INTERFACE
${qt_loc}/include
${qt_loc}/include/QtCore
${qt_loc}/include/QtGui
+ $<$<TARGET_EXISTS:Qt::ServiceSupport>:${qt_loc}/include/QtServiceSupport>
$<$<TARGET_EXISTS:Qt::OpenGL>:${qt_loc}/include/QtOpenGL>
${qt_loc}/include/QtWidgets
$<$<TARGET_EXISTS:Qt::OpenGLWidgets>:${qt_loc}/include/QtOpenGLWidgets>
@@ -46,9 +49,11 @@ INTERFACE
$<$<TARGET_EXISTS:Qt::WaylandCompositor>:${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
@@ -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

0 comments on commit bb380e5

Please sign in to comment.