Revert "gnome-maps: remove absolute path in desktop entry"

This reverts commit 8816be7bda.

Well this is not a desktop entry... I think.

This fixes opening Maps in GNOME (from the activity view) for me:
"JS ERROR: Error: Requiring GLib, version 2.0: Typelib file for namespace 'GLib',
version '2.0' not found".

I learned from the KDE docs[1] that *unlike desktop files*, dbus files should contain
full path to the application to start. I tried not using full path previously in a
sticky PR[2] and it just fails to start with `org.freedesktop.DBus.Error.Spawn.ExecFailed`.

[1]: https://develop.kde.org/docs/features/d-bus/dbus_autostart_services/#creating-a-service-file
[2]: https://github.com/linuxmint/sticky/pull/118
This commit is contained in:
Bobby Rong 2024-12-01 22:37:24 +08:00
parent 68562c6046
commit d37e098e8d
No known key found for this signature in database

View File

@ -76,6 +76,16 @@ stdenv.mkDerivation (finalAttrs: {
''}"
];
postPatch = ''
# The .service file isn't wrapped with the correct environment
# so misses GIR files when started. By re-pointing from the gjs
# entry point to the wrapped binary we get back to a wrapped
# binary.
substituteInPlace "data/org.gnome.Maps.service.in" \
--replace-fail "Exec=@pkgdatadir@/@app-id@" \
"Exec=$out/bin/gnome-maps"
'';
preCheck = ''
# “time.js” included by “timeTest” and “translationsTest” depends on “org.gnome.desktop.interface” schema.
export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:$XDG_DATA_DIRS"