mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
feat: adapt AyuGram to Flatpak (#10)
This commit is contained in:
parent
e4e6fb14c7
commit
bf743836c1
7 changed files with 18 additions and 18 deletions
|
@ -1934,9 +1934,9 @@ endif()
|
||||||
|
|
||||||
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
|
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
configure_file("../lib/xdg/ayugram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.service" @ONLY)
|
configure_file("../lib/xdg/com.ayugram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.service" @ONLY)
|
||||||
configure_file("../lib/xdg/ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml" @ONLY)
|
configure_file("../lib/xdg/com.ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml" @ONLY)
|
||||||
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml")
|
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml")
|
||||||
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "ayugram.png")
|
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "ayugram.png")
|
||||||
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "ayugram.png")
|
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "ayugram.png")
|
||||||
|
@ -1945,8 +1945,8 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
|
||||||
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "ayugram.png")
|
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "ayugram.png")
|
||||||
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "ayugram.png")
|
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "ayugram.png")
|
||||||
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "ayugram.png")
|
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "ayugram.png")
|
||||||
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "telegram-symbolic.svg")
|
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "ayugram-symbolic.svg")
|
||||||
install(FILES "../lib/xdg/ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
install(FILES "../lib/xdg/com.ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -56,6 +56,6 @@
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/misc">
|
<qresource prefix="/misc">
|
||||||
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
|
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
|
||||||
<file alias="ayugram.desktop.desktop">../../../../lib/xdg/ayugram.desktop.desktop</file>
|
<file alias="com.ayugram.desktop.desktop">../../../../lib/xdg/com.ayugram.desktop.desktop</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -198,7 +198,7 @@ bool GenerateDesktopFile(
|
||||||
DEBUG_LOG(("App Info: placing .desktop file to %1").arg(targetPath));
|
DEBUG_LOG(("App Info: placing .desktop file to %1").arg(targetPath));
|
||||||
if (!QDir(targetPath).exists()) QDir().mkpath(targetPath);
|
if (!QDir(targetPath).exists()) QDir().mkpath(targetPath);
|
||||||
|
|
||||||
const auto sourceFile = u":/misc/ayugram.desktop.desktop"_q;
|
const auto sourceFile = u":/misc/com.ayugram.desktop.desktop"_q;
|
||||||
const auto targetFile = targetPath
|
const auto targetFile = targetPath
|
||||||
+ QGuiApplication::desktopFileName()
|
+ QGuiApplication::desktopFileName()
|
||||||
+ u".desktop"_q;
|
+ u".desktop"_q;
|
||||||
|
@ -319,7 +319,7 @@ bool GenerateDesktopFile(
|
||||||
hashMd5Hex(d.constData(), d.size(), md5Hash);
|
hashMd5Hex(d.constData(), d.size(), md5Hash);
|
||||||
|
|
||||||
if (!Core::Launcher::Instance().customWorkingDir()) {
|
if (!Core::Launcher::Instance().customWorkingDir()) {
|
||||||
QFile::remove(u"%1org.telegram.desktop._%2.desktop"_q.arg(
|
QFile::remove(u"%1ayugram.desktop._%2.desktop"_q.arg(
|
||||||
targetPath,
|
targetPath,
|
||||||
md5Hash));
|
md5Hash));
|
||||||
|
|
||||||
|
@ -623,10 +623,10 @@ void start() {
|
||||||
md5Hash.data());
|
md5Hash.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
return u"ayugram.desktop._%1"_q.arg(md5Hash.constData());
|
return u"com.ayugram.desktop._%1"_q.arg(md5Hash.constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
return u"ayugram.desktop"_q;
|
return u"com.ayugram.desktop"_q;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
LOG(("App ID: %1").arg(QGuiApplication::desktopFileName()));
|
LOG(("App ID: %1").arg(QGuiApplication::desktopFileName()));
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[D-BUS Service]
|
|
||||||
Name=ayugram.desktop
|
|
||||||
Exec=@CMAKE_INSTALL_FULL_BINDIR@/ayugram-desktop
|
|
|
@ -3,7 +3,7 @@ Name=AyuGram Desktop
|
||||||
Comment=Desktop version of AyuGram - ToS breaking Telegram client
|
Comment=Desktop version of AyuGram - ToS breaking Telegram client
|
||||||
TryExec=ayugram-desktop
|
TryExec=ayugram-desktop
|
||||||
Exec=DESKTOPINTEGRATION=1 ayugram-desktop -- %u
|
Exec=DESKTOPINTEGRATION=1 ayugram-desktop -- %u
|
||||||
Icon=telegram
|
Icon=ayugram
|
||||||
Terminal=false
|
Terminal=false
|
||||||
StartupWMClass=AyuGram
|
StartupWMClass=AyuGram
|
||||||
Type=Application
|
Type=Application
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<component type="desktop">
|
<component type="desktop">
|
||||||
<id>ayugram.desktop</id>
|
<id>com.ayugram.desktop</id>
|
||||||
<metadata_license>CC0-1.0</metadata_license>
|
<metadata_license>CC0-1.0</metadata_license>
|
||||||
<project_license>GPL-3.0</project_license>
|
<project_license>GPL-3.0</project_license>
|
||||||
<name>AyuGram Desktop</name>
|
<name>AyuGram Desktop</name>
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
<content_attribute id="money-gambling">none</content_attribute>
|
<content_attribute id="money-gambling">none</content_attribute>
|
||||||
<content_attribute id="money-advertising">moderate</content_attribute>
|
<content_attribute id="money-advertising">moderate</content_attribute>
|
||||||
</content_rating>
|
</content_rating>
|
||||||
<launchable type="desktop-id">ayugram.desktop.desktop</launchable>
|
<launchable type="desktop-id">com.ayugram.desktop.desktop</launchable>
|
||||||
<provides>
|
<provides>
|
||||||
<binary>ayugram-desktop</binary>
|
<binary>ayugram-desktop</binary>
|
||||||
</provides>
|
</provides>
|
3
lib/xdg/com.ayugram.desktop.service
Normal file
3
lib/xdg/com.ayugram.desktop.service
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[D-BUS Service]
|
||||||
|
Name=com.ayugram.desktop
|
||||||
|
Exec=@CMAKE_INSTALL_FULL_BINDIR@/com.ayugram.desktop
|
Loading…
Add table
Reference in a new issue