Further improvements for the 'Lite' Flatpak variant (#836)
These changes should only affect the Linux build. Co-authored-by: guihkx <guihkx@users.noreply.github.com>
This commit is contained in:
parent
954b097cf9
commit
f64c46c6ae
@ -193,16 +193,19 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT USE_WEBENGINE)
|
if(NOT USE_WEBENGINE)
|
||||||
|
set(APP_REVERSE_NAME "io.github.martinrotter.rssguardlite")
|
||||||
set(APP_REVISION "${APP_REVISION}-nowebengine")
|
set(APP_REVISION "${APP_REVISION}-nowebengine")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(APP_LOW_NAME "${CMAKE_PROJECT_NAME}")
|
||||||
|
|
||||||
# Pass common defines.
|
# Pass common defines.
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
APP_NAME="${APP_NAME}"
|
APP_NAME="${APP_NAME}"
|
||||||
APP_VERSION="${CMAKE_PROJECT_VERSION}"
|
APP_VERSION="${CMAKE_PROJECT_VERSION}"
|
||||||
APP_URL="${APP_URL}"
|
APP_URL="${APP_URL}"
|
||||||
APP_LONG_NAME="${APP_NAME} ${CMAKE_PROJECT_VERSION}"
|
APP_LONG_NAME="${APP_NAME} ${CMAKE_PROJECT_VERSION}"
|
||||||
APP_LOW_NAME="${CMAKE_PROJECT_NAME}"
|
APP_LOW_NAME="${APP_LOW_NAME}"
|
||||||
APP_REVERSE_NAME="${APP_REVERSE_NAME}"
|
APP_REVERSE_NAME="${APP_REVERSE_NAME}"
|
||||||
|
|
||||||
QT_USE_QSTRINGBUILDER
|
QT_USE_QSTRINGBUILDER
|
||||||
@ -240,6 +243,12 @@ elseif(APPLE)
|
|||||||
resources/macosx/Info.plist.in
|
resources/macosx/Info.plist.in
|
||||||
${CMAKE_BINARY_DIR}/Info.plist
|
${CMAKE_BINARY_DIR}/Info.plist
|
||||||
)
|
)
|
||||||
|
elseif(UNIX AND NOT ANDROID)
|
||||||
|
add_subdirectory(resources/desktop)
|
||||||
|
add_compile_definitions(
|
||||||
|
APPDATA_NAME="${APPDATA_NAME}"
|
||||||
|
APPDATA_SUMMARY="${APPDATA_SUMMARY}"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Generate localizations, build library and application.
|
# Generate localizations, build library and application.
|
||||||
|
24
resources/desktop/CMakeLists.txt
Normal file
24
resources/desktop/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
set(APPDATA_NAME_REGULAR ${APP_NAME})
|
||||||
|
set(APPDATA_NAME_LITE "${APP_NAME} Lite")
|
||||||
|
set(APPDATA_SUMMARY_REGULAR "Simple, yet powerful news feed reader")
|
||||||
|
set(APPDATA_SUMMARY_LITE "${APPDATA_SUMMARY_REGULAR} (no built-in web browser)")
|
||||||
|
|
||||||
|
if(USE_WEBENGINE)
|
||||||
|
set(APPDATA_NAME "${APPDATA_NAME_REGULAR}")
|
||||||
|
set(APPDATA_SUMMARY "${APPDATA_SUMMARY_REGULAR}")
|
||||||
|
else()
|
||||||
|
set(APPDATA_NAME "${APPDATA_NAME_LITE}")
|
||||||
|
set(APPDATA_SUMMARY "${APPDATA_SUMMARY_LITE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
rssguard.desktop.in
|
||||||
|
${CMAKE_BINARY_DIR}/${APP_REVERSE_NAME}.desktop
|
||||||
|
)
|
||||||
|
configure_file(
|
||||||
|
rssguard.metainfo.xml.in
|
||||||
|
${CMAKE_BINARY_DIR}/${APP_REVERSE_NAME}.metainfo.xml
|
||||||
|
)
|
||||||
|
|
||||||
|
set(APPDATA_NAME ${APPDATA_NAME} PARENT_SCOPE)
|
||||||
|
set(APPDATA_SUMMARY ${APPDATA_SUMMARY} PARENT_SCOPE)
|
@ -1,9 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Version=1.0
|
|
||||||
Type=Application
|
|
||||||
Terminal=false
|
|
||||||
Name=RSS Guard
|
|
||||||
Exec=%1
|
|
||||||
Hidden=false
|
|
||||||
X-GNOME-Autostart-Delay=15
|
|
||||||
X-LXQt-Need-Tray=true
|
|
@ -1,17 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Version=1.0
|
|
||||||
Exec=rssguard
|
|
||||||
X-GNOME-Autostart-Delay=15
|
|
||||||
X-LXQt-Need-Tray=true
|
|
||||||
Name=RSS Guard
|
|
||||||
GenericName=Feed reader
|
|
||||||
GenericName[cs]=Velmi jednoduchá čtečka kanálů
|
|
||||||
GenericName[de]=Feedreader
|
|
||||||
Comment=Tiny yet feature rich Qt feed reader
|
|
||||||
Comment[cs]=Velmi jednoduchá čtečka kanálů
|
|
||||||
Comment[de]=Qt Feedreader mit großem Funktionsumfang bei geringem Ressourcenbedarf
|
|
||||||
Icon=rssguard
|
|
||||||
Terminal=false
|
|
||||||
Categories=Qt;Network;News;
|
|
||||||
StartupWMClass=rssguard
|
|
11
resources/desktop/rssguard.desktop.in
Normal file
11
resources/desktop/rssguard.desktop.in
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=@APPDATA_NAME@
|
||||||
|
Comment=@APPDATA_SUMMARY@
|
||||||
|
Icon=@APP_REVERSE_NAME@
|
||||||
|
Exec=@APP_LOW_NAME@
|
||||||
|
Categories=Feed;News;Network;Qt;
|
||||||
|
StartupWMClass=@APP_LOW_NAME@
|
||||||
|
X-GNOME-SingleWindow=true
|
||||||
|
X-GNOME-Autostart-Delay=15
|
||||||
|
X-LXQt-Need-Tray=true
|
@ -1,16 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Copyright 2017-2022 Martin Rotter <rotter.martinos@gmail.com> -->
|
<!-- Copyright 2017-2022 Martin Rotter <rotter.martinos@gmail.com> -->
|
||||||
<component type="desktop-application">
|
<component type="desktop-application">
|
||||||
<id>io.github.martinrotter.rssguard</id>
|
<id>@APP_REVERSE_NAME@</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>RSS Guard</name>
|
<name>@APPDATA_NAME@</name>
|
||||||
<developer_name>Martin Rotter</developer_name>
|
<developer_name>Martin Rotter</developer_name>
|
||||||
<update_contact>rotter.martinos_AT_gmail.com</update_contact>
|
<update_contact>rotter.martinos_AT_gmail.com</update_contact>
|
||||||
<summary>Simple (yet powerful) feed reader</summary>
|
<summary>@APPDATA_SUMMARY@</summary>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
RSS Guard is a simple (yet powerful) feed reader, written in C++ and Qt.
|
@APPDATA_NAME@ is a news feed reader, written in C++ and Qt.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
It supports many feed formats, such as:
|
It supports many feed formats, such as:
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<li>Tiny Tiny RSS</li>
|
<li>Tiny Tiny RSS</li>
|
||||||
</ul>
|
</ul>
|
||||||
</description>
|
</description>
|
||||||
<launchable type="desktop-id">io.github.martinrotter.rssguard.desktop</launchable>
|
<launchable type="desktop-id">@APP_REVERSE_NAME@.desktop</launchable>
|
||||||
<screenshots>
|
<screenshots>
|
||||||
<screenshot type="default">
|
<screenshot type="default">
|
||||||
<image>https://raw.githubusercontent.com/martinrotter/rssguard/master/resources/docs/images/rssguard-window.png</image>
|
<image>https://raw.githubusercontent.com/martinrotter/rssguard/master/resources/docs/images/rssguard-window.png</image>
|
||||||
@ -63,6 +63,6 @@
|
|||||||
<release version="4.2.6" date="2022-12-21" />
|
<release version="4.2.6" date="2022-12-21" />
|
||||||
</releases>
|
</releases>
|
||||||
<provides>
|
<provides>
|
||||||
<binary>rssguard</binary>
|
<binary>@APP_LOW_NAME@</binary>
|
||||||
</provides>
|
</provides>
|
||||||
</component>
|
</component>
|
@ -91,8 +91,7 @@
|
|||||||
|
|
||||||
<file>initial_feeds/feeds-en_US.opml</file>
|
<file>initial_feeds/feeds-en_US.opml</file>
|
||||||
|
|
||||||
<file>desktop/io.github.martinrotter.rssguard.desktop</file>
|
<file>desktop/rssguard.desktop.in</file>
|
||||||
<file>desktop/io.github.martinrotter.rssguard.autostart</file>
|
|
||||||
|
|
||||||
<file>../localization/rssguard_cs.qm</file>
|
<file>../localization/rssguard_cs.qm</file>
|
||||||
<file>../localization/rssguard_da.qm</file>
|
<file>../localization/rssguard_da.qm</file>
|
||||||
|
@ -10,7 +10,11 @@ if [[ "$os" == *"ubuntu"* ]]; then
|
|||||||
echo "We are building for GNU/Linux on Ubuntu."
|
echo "We are building for GNU/Linux on Ubuntu."
|
||||||
is_linux=true
|
is_linux=true
|
||||||
prefix="AppDir/usr"
|
prefix="AppDir/usr"
|
||||||
app_id="io.github.martinrotter.rssguard"
|
if [[ "$webengine" == "ON" ]]; then
|
||||||
|
app_id="io.github.martinrotter.rssguard"
|
||||||
|
else
|
||||||
|
app_id="io.github.martinrotter.rssguardlite"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "We are building for macOS."
|
echo "We are building for macOS."
|
||||||
is_linux=false
|
is_linux=false
|
||||||
|
@ -4,7 +4,7 @@ changelog_file="resources/text/CHANGELOG"
|
|||||||
datestring="$(date +%F)"
|
datestring="$(date +%F)"
|
||||||
versionstring="$(head -n 1 "$changelog_file")"
|
versionstring="$(head -n 1 "$changelog_file")"
|
||||||
|
|
||||||
for appdata_file in resources/desktop/*.metainfo.xml; do
|
for appdata_file in resources/desktop/*.metainfo.xml.in; do
|
||||||
appdata_file_n="${appdata_file}.n"
|
appdata_file_n="${appdata_file}.n"
|
||||||
|
|
||||||
# Set version and date.
|
# Set version and date.
|
||||||
|
@ -345,8 +345,7 @@
|
|||||||
#define APP_LANG_PATH QSL(":/localization")
|
#define APP_LANG_PATH QSL(":/localization")
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
#define APP_DESKTOP_SOURCE_ENTRY_FILE APP_REVERSE_NAME ".autostart"
|
#define APP_DESKTOP_ENTRY_FILE "rssguard.desktop.in"
|
||||||
#define APP_DESKTOP_ENTRY_FILE APP_REVERSE_NAME ".desktop"
|
|
||||||
|
|
||||||
#define APP_DESKTOP_ENTRY_PATH QSL(":/desktop")
|
#define APP_DESKTOP_ENTRY_PATH QSL(":/desktop")
|
||||||
#endif
|
#endif
|
||||||
|
@ -765,7 +765,7 @@ void Application::showMessagesNumber(int unread_messages, bool any_feed_has_new_
|
|||||||
bool task_bar_count_enabled = settings()->value(GROUP(GUI), SETTING(GUI::UnreadNumbersOnTaskBar)).toBool();
|
bool task_bar_count_enabled = settings()->value(GROUP(GUI), SETTING(GUI::UnreadNumbersOnTaskBar)).toBool();
|
||||||
QDBusMessage signal = QDBusMessage::createSignal(QSL("/"), QSL("com.canonical.Unity.LauncherEntry"), QSL("Update"));
|
QDBusMessage signal = QDBusMessage::createSignal(QSL("/"), QSL("com.canonical.Unity.LauncherEntry"), QSL("Update"));
|
||||||
|
|
||||||
signal << QSL("application://%1").arg(APP_DESKTOP_ENTRY_FILE);
|
signal << QSL("application://%1.desktop").arg(APP_REVERSE_NAME);
|
||||||
|
|
||||||
QVariantMap setProperty;
|
QVariantMap setProperty;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ QString SystemFactory::autostartDesktopFileLocation() const {
|
|||||||
if (!xdg_config_path.isEmpty()) {
|
if (!xdg_config_path.isEmpty()) {
|
||||||
// XDG_CONFIG_HOME variable is specified. Look for .desktop file
|
// XDG_CONFIG_HOME variable is specified. Look for .desktop file
|
||||||
// in 'autostart' subdirectory.
|
// in 'autostart' subdirectory.
|
||||||
desktop_file_location = xdg_config_path + QSL("/autostart/") + APP_DESKTOP_ENTRY_FILE;
|
desktop_file_location = xdg_config_path + QSL("/autostart/") + APP_REVERSE_NAME + QSL(".desktop");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Desired variable is not set, look for the default 'autostart' subdirectory.
|
// Desired variable is not set, look for the default 'autostart' subdirectory.
|
||||||
@ -103,7 +103,7 @@ QString SystemFactory::autostartDesktopFileLocation() const {
|
|||||||
if (!home_directory.isEmpty()) {
|
if (!home_directory.isEmpty()) {
|
||||||
// Home directory exists. Check if target .desktop file exists and
|
// Home directory exists. Check if target .desktop file exists and
|
||||||
// return according status.
|
// return according status.
|
||||||
desktop_file_location = home_directory + QSL("/.config/autostart/") + APP_DESKTOP_ENTRY_FILE;
|
desktop_file_location = home_directory + QSL("/.config/autostart/") + APP_REVERSE_NAME + QSL(".desktop");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ bool SystemFactory::setAutoStartStatus(AutoStartStatus new_status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QString source_autostart_desktop_file =
|
const QString source_autostart_desktop_file =
|
||||||
QString(APP_DESKTOP_ENTRY_PATH) + QDir::separator() + APP_DESKTOP_SOURCE_ENTRY_FILE;
|
QString(APP_DESKTOP_ENTRY_PATH) + QDir::separator() + APP_DESKTOP_ENTRY_FILE;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
QString desktop_file_contents = QString::fromUtf8(IOFactory::readFile(source_autostart_desktop_file));
|
QString desktop_file_contents = QString::fromUtf8(IOFactory::readFile(source_autostart_desktop_file));
|
||||||
@ -189,13 +189,17 @@ bool SystemFactory::setAutoStartStatus(AutoStartStatus new_status) {
|
|||||||
args = FROM_STD_LIST(QStringList, std_args);
|
args = FROM_STD_LIST(QStringList, std_args);
|
||||||
|
|
||||||
#if defined(IS_FLATPAK_BUILD)
|
#if defined(IS_FLATPAK_BUILD)
|
||||||
const QString flatpak_run = QSL("flatpak run %1").arg(QSL(APP_REVERSE_NAME));
|
const QString flatpak_run = QSL("flatpak run %1").arg(APP_REVERSE_NAME);
|
||||||
|
|
||||||
args = args.mid(1);
|
args = args.mid(1);
|
||||||
args.prepend(flatpak_run);
|
args.prepend(flatpak_run);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
desktop_file_contents = desktop_file_contents.arg(args.join(QL1C(' ')));
|
desktop_file_contents.replace("Exec=@APP_LOW_NAME@", QSL("Exec=") + args.join(QL1C(' ')));
|
||||||
|
desktop_file_contents.replace("@APPDATA_SUMMARY@", APPDATA_SUMMARY);
|
||||||
|
desktop_file_contents.replace("@APPDATA_NAME@", APPDATA_NAME);
|
||||||
|
desktop_file_contents.replace("@APP_REVERSE_NAME@", APP_REVERSE_NAME);
|
||||||
|
desktop_file_contents.replace("@APP_LOW_NAME@", APP_LOW_NAME);
|
||||||
|
|
||||||
IOFactory::writeFile(destination_file, desktop_file_contents.toUtf8());
|
IOFactory::writeFile(destination_file, desktop_file_contents.toUtf8());
|
||||||
}
|
}
|
||||||
|
@ -63,14 +63,15 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
|
|||||||
install(TARGETS app
|
install(TARGETS app
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/resources/desktop/${APP_REVERSE_NAME}.desktop
|
install(FILES ${CMAKE_BINARY_DIR}/${APP_REVERSE_NAME}.desktop
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
|
||||||
)
|
)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/resources/desktop/${APP_REVERSE_NAME}.metainfo.xml
|
install(FILES ${CMAKE_BINARY_DIR}/${APP_REVERSE_NAME}.metainfo.xml
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo
|
||||||
)
|
)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/resources/graphics/${CMAKE_PROJECT_NAME}.png
|
install(FILES ${CMAKE_SOURCE_DIR}/resources/graphics/${CMAKE_PROJECT_NAME}.png
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
|
||||||
|
RENAME ${APP_REVERSE_NAME}.png
|
||||||
)
|
)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
install(TARGETS app
|
install(TARGETS app
|
||||||
|
@ -32,7 +32,7 @@ int main(int argc, char* argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
QApplication::setDesktopFileName(APP_DESKTOP_ENTRY_FILE);
|
QApplication::setDesktopFileName(APP_REVERSE_NAME + QSL(".desktop"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QT_STATIC)
|
#if defined(QT_STATIC)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user