From 10012d6b310e156efad963c246bc04000dc29ce1 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 1 Oct 2020 02:42:58 +0400 Subject: [PATCH] Handle launcher basename compile-time for snap Just like for flatpak --- .../SourceFiles/platform/linux/specific_linux.cpp | 11 ----------- snap/snapcraft.yaml | 5 +++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 86b58477ba..463b7452b3 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -949,17 +949,6 @@ QString SingleInstanceLocalServerName(const QString &hash) { QString GetLauncherBasename() { static const auto Result = [&] { - if (InSnap() && !cExeName().isEmpty()) { - const auto snapNameKey = - qEnvironmentVariableIsSet("SNAP_INSTANCE_NAME") - ? "SNAP_INSTANCE_NAME" - : "SNAP_NAME"; - - return qsl("%1_%2") - .arg(QString::fromLatin1(qgetenv(snapNameKey))) - .arg(cExeName()); - } - if ((IsStaticBinary() || InAppImage()) && !cExeName().isEmpty()) { const auto appimagePath = qsl("file://%1%2") .arg(cExeDir()) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a3c60c14c2..dd55d3b203 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -16,7 +16,7 @@ apps: telegram-desktop: command: bin/desktop-launch telegram-desktop common-id: org.telegram.desktop - desktop: usr/share/applications/telegramdesktop.desktop + desktop: usr/share/applications/telegram-desktop_telegram-desktop.desktop environment: # Use GTK3 cursor theme, icon theme and open/save file dialogs. QT_QPA_PLATFORMTHEME: gtk3 @@ -65,7 +65,7 @@ parts: plugin: cmake source: . source-type: git - parse-info: [usr/share/metainfo/telegramdesktop.appdata.xml] + parse-info: [usr/share/metainfo/telegram-desktop_telegram-desktop.appdata.xml] build-environment: - LD_LIBRARY_PATH: $SNAPCRAFT_STAGE/usr/lib - tg_owt_DIR: $SNAPCRAFT_STAGE/tg_owt @@ -105,6 +105,7 @@ parts: - -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c - -DDESKTOP_APP_USE_PACKAGED_LAZY=ON - -DDESKTOP_APP_QTWAYLANDCLIENT_PRIVATE_HEADERS=$SNAPCRAFT_STAGE/usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5/QtWaylandClient/5.12.8 + - -DTDESKTOP_LAUNCHER_BASENAME=telegram-desktop_telegram-desktop override-pull: | snapcraftctl pull