Skip to content

Commit f64c46c

Browse files
authored
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>
1 parent 954b097 commit f64c46c

14 files changed

Lines changed: 73 additions & 48 deletions

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,19 @@ else()
193193
endif()
194194

195195
if(NOT USE_WEBENGINE)
196+
set(APP_REVERSE_NAME "io.github.martinrotter.rssguardlite")
196197
set(APP_REVISION "${APP_REVISION}-nowebengine")
197198
endif()
198199

200+
set(APP_LOW_NAME "${CMAKE_PROJECT_NAME}")
201+
199202
# Pass common defines.
200203
add_compile_definitions(
201204
APP_NAME="${APP_NAME}"
202205
APP_VERSION="${CMAKE_PROJECT_VERSION}"
203206
APP_URL="${APP_URL}"
204207
APP_LONG_NAME="${APP_NAME} ${CMAKE_PROJECT_VERSION}"
205-
APP_LOW_NAME="${CMAKE_PROJECT_NAME}"
208+
APP_LOW_NAME="${APP_LOW_NAME}"
206209
APP_REVERSE_NAME="${APP_REVERSE_NAME}"
207210

208211
QT_USE_QSTRINGBUILDER
@@ -240,6 +243,12 @@ elseif(APPLE)
240243
resources/macosx/Info.plist.in
241244
${CMAKE_BINARY_DIR}/Info.plist
242245
)
246+
elseif(UNIX AND NOT ANDROID)
247+
add_subdirectory(resources/desktop)
248+
add_compile_definitions(
249+
APPDATA_NAME="${APPDATA_NAME}"
250+
APPDATA_SUMMARY="${APPDATA_SUMMARY}"
251+
)
243252
endif()
244253

245254
# Generate localizations, build library and application.

resources/desktop/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set(APPDATA_NAME_REGULAR ${APP_NAME})
2+
set(APPDATA_NAME_LITE "${APP_NAME} Lite")
3+
set(APPDATA_SUMMARY_REGULAR "Simple, yet powerful news feed reader")
4+
set(APPDATA_SUMMARY_LITE "${APPDATA_SUMMARY_REGULAR} (no built-in web browser)")
5+
6+
if(USE_WEBENGINE)
7+
set(APPDATA_NAME "${APPDATA_NAME_REGULAR}")
8+
set(APPDATA_SUMMARY "${APPDATA_SUMMARY_REGULAR}")
9+
else()
10+
set(APPDATA_NAME "${APPDATA_NAME_LITE}")
11+
set(APPDATA_SUMMARY "${APPDATA_SUMMARY_LITE}")
12+
endif()
13+
14+
configure_file(
15+
rssguard.desktop.in
16+
${CMAKE_BINARY_DIR}/${APP_REVERSE_NAME}.desktop
17+
)
18+
configure_file(
19+
rssguard.metainfo.xml.in
20+
${CMAKE_BINARY_DIR}/${APP_REVERSE_NAME}.metainfo.xml
21+
)
22+
23+
set(APPDATA_NAME ${APPDATA_NAME} PARENT_SCOPE)
24+
set(APPDATA_SUMMARY ${APPDATA_SUMMARY} PARENT_SCOPE)

resources/desktop/io.github.martinrotter.rssguard.autostart

Lines changed: 0 additions & 9 deletions
This file was deleted.

resources/desktop/io.github.martinrotter.rssguard.desktop

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=@APPDATA_NAME@
4+
Comment=@APPDATA_SUMMARY@
5+
Icon=@APP_REVERSE_NAME@
6+
Exec=@APP_LOW_NAME@
7+
Categories=Feed;News;Network;Qt;
8+
StartupWMClass=@APP_LOW_NAME@
9+
X-GNOME-SingleWindow=true
10+
X-GNOME-Autostart-Delay=15
11+
X-LXQt-Need-Tray=true

resources/desktop/io.github.martinrotter.rssguard.metainfo.xml renamed to resources/desktop/rssguard.metainfo.xml.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!-- Copyright 2017-2022 Martin Rotter <rotter.martinos@gmail.com> -->
33
<component type="desktop-application">
4-
<id>io.github.martinrotter.rssguard</id>
4+
<id>@APP_REVERSE_NAME@</id>
55
<metadata_license>CC0-1.0</metadata_license>
66
<project_license>GPL-3.0</project_license>
7-
<name>RSS Guard</name>
7+
<name>@APPDATA_NAME@</name>
88
<developer_name>Martin Rotter</developer_name>
99
<update_contact>rotter.martinos_AT_gmail.com</update_contact>
10-
<summary>Simple (yet powerful) feed reader</summary>
10+
<summary>@APPDATA_SUMMARY@</summary>
1111
<description>
1212
<p>
13-
RSS Guard is a simple (yet powerful) feed reader, written in C++ and Qt.
13+
@APPDATA_NAME@ is a news feed reader, written in C++ and Qt.
1414
</p>
1515
<p>
1616
It supports many feed formats, such as:
@@ -31,7 +31,7 @@
3131
<li>Tiny Tiny RSS</li>
3232
</ul>
3333
</description>
34-
<launchable type="desktop-id">io.github.martinrotter.rssguard.desktop</launchable>
34+
<launchable type="desktop-id">@APP_REVERSE_NAME@.desktop</launchable>
3535
<screenshots>
3636
<screenshot type="default">
3737
<image>https://raw.githubusercontent.com/martinrotter/rssguard/master/resources/docs/images/rssguard-window.png</image>
@@ -63,6 +63,6 @@
6363
<release version="4.2.6" date="2022-12-21" />
6464
</releases>
6565
<provides>
66-
<binary>rssguard</binary>
66+
<binary>@APP_LOW_NAME@</binary>
6767
</provides>
6868
</component>

resources/rssguard.qrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@
9191

9292
<file>initial_feeds/feeds-en_US.opml</file>
9393

94-
<file>desktop/io.github.martinrotter.rssguard.desktop</file>
95-
<file>desktop/io.github.martinrotter.rssguard.autostart</file>
94+
<file>desktop/rssguard.desktop.in</file>
9695

9796
<file>../localization/rssguard_cs.qm</file>
9897
<file>../localization/rssguard_da.qm</file>

resources/scripts/github-actions/build-linux-mac.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ if [[ "$os" == *"ubuntu"* ]]; then
1010
echo "We are building for GNU/Linux on Ubuntu."
1111
is_linux=true
1212
prefix="AppDir/usr"
13-
app_id="io.github.martinrotter.rssguard"
13+
if [[ "$webengine" == "ON" ]]; then
14+
app_id="io.github.martinrotter.rssguard"
15+
else
16+
app_id="io.github.martinrotter.rssguardlite"
17+
fi
1418
else
1519
echo "We are building for macOS."
1620
is_linux=false

resources/scripts/hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ changelog_file="resources/text/CHANGELOG"
44
datestring="$(date +%F)"
55
versionstring="$(head -n 1 "$changelog_file")"
66

7-
for appdata_file in resources/desktop/*.metainfo.xml; do
7+
for appdata_file in resources/desktop/*.metainfo.xml.in; do
88
appdata_file_n="${appdata_file}.n"
99

1010
# Set version and date.

src/librssguard/definitions/definitions.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@
345345
#define APP_LANG_PATH QSL(":/localization")
346346

347347
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
348-
#define APP_DESKTOP_SOURCE_ENTRY_FILE APP_REVERSE_NAME ".autostart"
349-
#define APP_DESKTOP_ENTRY_FILE APP_REVERSE_NAME ".desktop"
348+
#define APP_DESKTOP_ENTRY_FILE "rssguard.desktop.in"
350349

351350
#define APP_DESKTOP_ENTRY_PATH QSL(":/desktop")
352351
#endif

0 commit comments

Comments
 (0)