From d37e098e8dc8ccf6562122b33d54f509c9b089f2 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 1 Dec 2024 22:37:24 +0800 Subject: [PATCH] Revert "gnome-maps: remove absolute path in desktop entry" This reverts commit 8816be7bdaa297e6b4448473f8e23e08b0ed1a0b. 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 --- pkgs/by-name/gn/gnome-maps/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/gn/gnome-maps/package.nix b/pkgs/by-name/gn/gnome-maps/package.nix index 863ffb85cbe6..2add8e28306f 100644 --- a/pkgs/by-name/gn/gnome-maps/package.nix +++ b/pkgs/by-name/gn/gnome-maps/package.nix @@ -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"