net-im/telegram-desktop: update from 4.2.4 to 4.4.1

Patches obtained from: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/net/tdesktop/patches/
Hotfix for Qt5: 5990b0fabf

Special thanks to:	Klemens Nanni <kn@openbsd.org>
This commit is contained in:
Sergey A. Osokin 2022-12-08 17:07:24 -05:00
parent 2d011fa6c0
commit 01e12e4ddf
6 changed files with 124 additions and 9 deletions

View File

@ -1,6 +1,5 @@
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
@ -33,10 +32,12 @@ LIB_DEPENDS= libabsl_base.so:devel/abseil \
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 \
@ -52,7 +53,7 @@ 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
@ -69,7 +70,7 @@ 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" \

View File

@ -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

View File

@ -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<base::Platform::DBus::ServiceWatcher>
try {
const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::SESSION);
+ const auto GlibNames =
+ base::Platform::DBus::ListActivatableNames(connection);
+ const std::vector<std::string> 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<void()> 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<std::string> 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;
}

View File

@ -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<std::string>(
+ GlibNames.begin(), GlibNames.end()
+ );
}
} catch (...) {
}
- return std::vector<Glib::ustring>();
+ return std::vector<std::string>();
}();
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;

View File

@ -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<crl::time> 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<crl::time> 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;

View File

@ -1,5 +1,5 @@
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
@ -7,4 +7,4 @@ 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