[evolution/bilelmoussaoui/flatpak: 4/7] flatpak: move the scripts to proper files
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/bilelmoussaoui/flatpak: 4/7] flatpak: move the scripts to proper files
- Date: Fri, 25 Mar 2022 17:30:44 +0000 (UTC)
commit 7640b529fb270841fc23e854f10b865937a37fbb
Author: Bilal Elmoussaoui <belmouss redhat com>
Date: Fri Mar 25 17:57:05 2022 +0100
flatpak: move the scripts to proper files
flatpak/evolution-fix-service-names.sh | 8 +++++
flatpak/evolution-wrapper.sh.in | 32 +++++++++++++++++++
flatpak/org.gnome.Evolution.json | 58 ++++------------------------------
3 files changed, 47 insertions(+), 51 deletions(-)
---
diff --git a/flatpak/evolution-fix-service-names.sh b/flatpak/evolution-fix-service-names.sh
new file mode 100755
index 0000000000..fea9b642f6
--- /dev/null
+++ b/flatpak/evolution-fix-service-names.sh
@@ -0,0 +1,8 @@
+# see https://gitlab.gnome.org/GNOME/glib/issues/1737
+# previous versions used milliseconds instead of seconds as the timeout argument
+(`pkg-config --atleast-version 2.60.1 gio-2.0` || `pkg-config --atleast-version 2.61.0 gio-2.0`) &&
TIMEOUTMULT= || TIMEOUTMULT=000
+
+sed -e "s|@SOURCES_SERVICE@|$(pkg-config --variable=sourcesdbusservicename evolution-data-server-1.2)|" \
+ -e "s|@ADDRESSBOOK_SERVICE@|$(pkg-config --variable=addressbookdbusservicename
evolution-data-server-1.2)|" \
+ -e "s|@CALENDAR_SERVICE@|$(pkg-config --variable=calendardbusservicename evolution-data-server-1.2)|" \
+ -e "s|@TIMEOUTMULT@|${TIMEOUTMULT}|"
diff --git a/flatpak/evolution-wrapper.sh.in b/flatpak/evolution-wrapper.sh.in
new file mode 100755
index 0000000000..5fb7c8a01c
--- /dev/null
+++ b/flatpak/evolution-wrapper.sh.in
@@ -0,0 +1,32 @@
+if [ "$1" = "--quit" -o "$1" = "--force-shutdown" ]; then
+ /app/bin/evolution "$@"
+else
+ export BOGOFILTER_DIR="${XDG_DATA_HOME}/bogofilter/"
+ export GIO_USE_NETWORK_MONITOR=base
+ export WEBKIT_FORCE_SANDBOX=0
+ gsettings reset org.gnome.evolution-data-server network-monitor-gio-name
+
+ gpg-agent --homedir ~/.gnupg --daemon --pinentry-program=/app/bin/pinentry
+
+ LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method
org.freedesktop.DBus.ListNames | grep @SOURCES_SERVICE@ | wc -l)
+ if [ "${LINES}" = "0" ]; then
+ /app/libexec/evolution-source-registry &
+ gdbus wait --session --timeout=1@TIMEOUTMULT@ @SOURCES_SERVICE@
+ fi
+
+ LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method
org.freedesktop.DBus.ListNames | grep @ADDRESSBOOK_SERVICE@ | wc -l)
+ if [ "${LINES}" = "0" ]; then
+ /app/libexec/evolution-addressbook-factory -r &
+ gdbus wait --session --timeout=1@TIMEOUTMULT@ @ADDRESSBOOK_SERVICE@
+ fi
+
+ LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method
org.freedesktop.DBus.ListNames | grep @CALENDAR_SERVICE@ | wc -l)
+ if [ "${LINES}" = "0" ]; then
+ /app/libexec/evolution-calendar-factory -r &
+ gdbus wait --session --timeout=1@TIMEOUTMULT@ @CALENDAR_SERVICE@
+ fi
+
+ /app/bin/evolution "$@"
+
+ pkill -TERM gpg-agent
+fi
diff --git a/flatpak/org.gnome.Evolution.json b/flatpak/org.gnome.Evolution.json
index 15f2dcb420..65c9ff685a 100644
--- a/flatpak/org.gnome.Evolution.json
+++ b/flatpak/org.gnome.Evolution.json
@@ -3,7 +3,7 @@
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
- "command": "evolution",
+ "command": "evolution-wrapper",
"rename-icon": "evolution",
"copy-icon": true,
"desktop-file-name-suffix": " (Development)",
@@ -405,56 +405,12 @@
"buildsystem": "simple",
"sources": [
{
- "type": "script",
- "commands": [
- "if [ \"$1\" = \"--quit\" -o \"$1\" = \"--force-shutdown\" ]; then",
- " /app/bin/evolution.bin \"$@\"",
- "else",
- " export BOGOFILTER_DIR=\"${XDG_DATA_HOME}/bogofilter/\"",
- " export GIO_USE_NETWORK_MONITOR=base",
- " export WEBKIT_FORCE_SANDBOX=0",
- " gsettings reset org.gnome.evolution-data-server network-monitor-gio-name",
- "",
- " gpg-agent --homedir ~/.gnupg --daemon --pinentry-program=/app/bin/pinentry",
- "",
- " LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path
/org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep @SOURCES_SERVICE@ | wc -l)",
- " if [ \"${LINES}\" = \"0\" ]; then",
- " /app/libexec/evolution-source-registry &",
- " gdbus wait --session --timeout=1@TIMEOUTMULT@ @SOURCES_SERVICE@",
- " fi",
- "",
- " LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path
/org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep @ADDRESSBOOK_SERVICE@ | wc -l)",
- " if [ \"${LINES}\" = \"0\" ]; then",
- " /app/libexec/evolution-addressbook-factory -r &",
- " gdbus wait --session --timeout=1@TIMEOUTMULT@ @ADDRESSBOOK_SERVICE@",
- " fi",
- "",
- " LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path
/org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep @CALENDAR_SERVICE@ | wc -l)",
- " if [ \"${LINES}\" = \"0\" ]; then",
- " /app/libexec/evolution-calendar-factory -r &",
- " gdbus wait --session --timeout=1@TIMEOUTMULT@ @CALENDAR_SERVICE@",
- " fi",
- "",
- " /app/bin/evolution.bin \"$@\"",
- "",
- " pkill -TERM gpg-agent",
- "fi"
- ],
- "dest-filename": "flatpak-evolution-wrapper.sh.in"
- },
+ "type": "file",
+ "path": "evolution-fix-service-names.sh"
+ }
{
- "type": "script",
- "commands": [
- "# see https://gitlab.gnome.org/GNOME/glib/issues/1737",
- "# previous versions used milliseconds instead of seconds as the timeout argument",
- "(`pkg-config --atleast-version 2.60.1 gio-2.0` || `pkg-config --atleast-version
2.61.0 gio-2.0`) && TIMEOUTMULT= || TIMEOUTMULT=000",
- "",
- "sed -e \"s|\\@SOURCES_SERVICE\\@|$(pkg-config --variable=sourcesdbusservicename
evolution-data-server-1.2)|\" \\",
- " -e \"s|\\@ADDRESSBOOK_SERVICE\\@|$(pkg-config
--variable=addressbookdbusservicename evolution-data-server-1.2)|\" \\",
- " -e \"s|\\@CALENDAR_SERVICE\\@|$(pkg-config --variable=calendardbusservicename
evolution-data-server-1.2)|\" \\",
- " -e \"s|\\@TIMEOUTMULT\\@|${TIMEOUTMULT}|\""
- ],
- "dest-filename": "flatpak-evolution-fix-service-names.sh"
+ "type": "file",
+ "path": "flatpak-evolution-wrapper.sh.in"
}
],
"build-commands": [
@@ -529,4 +485,4 @@
]
}
]
-}
\ No newline at end of file
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]