Skip to content

Commit

Permalink
ayatana-indicator-messages: Fix desktop parsing
Browse files Browse the repository at this point in the history
Not *great*, but a start.

MessagingMenu has a function for mapping an app to desktop file data. This relies on GLib to parse the desktop file,
which needs the binary from the 'Exec=' entry on PATH, otherwise it bails.

messaging_menu_app_set_desktop_id calls g_desktop_app_info_new:
https://github.com/AyatanaIndicators/ayatana-indicator-messages/blob/334668ad5ad33c6bd342f34b159dbcbed8c65df1/libmessaging-menu/messaging-menu-app.c#L245-L252

Which, after some jumps inbetween, ends up in g_desktop_app_info_load_from_keyfile and calls g_find_program_for_path:
https://github.com/GNOME/glib/blob/204a76669bd46c5eb656946e21bd746685c67174/gio/gdesktopappinfo.c#L1920-L1951

Which uses PATH:
https://github.com/GNOME/glib/blob/204a76669bd46c5eb656946e21bd746685c67174/glib/gutils.c#L371
  • Loading branch information
OPNA2608 authored and wegank committed Apr 14, 2024
1 parent 8d0a577 commit 93e91c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/by-name/ay/ayatana-indicator-messages/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ stdenv.mkDerivation (finalAttrs: {
chmod +w doc/reference/html/*
'';

# Indicators that talk to it may issue requests to parse desktop files, which needs binaries in Exec on PATH
# messaging_menu_app_set_desktop_id -> g_desktop_app_info_new -...-> g_desktop_app_info_load_from_keyfile -> g_find_program_for_path
# When launched via systemd, PATH is very narrow
preFixup = ''
gappsWrapperArgs+=(
--suffix PATH : '/run/current-system/sw/bin'
)
'';

passthru = {
ayatana-indicators = [
"ayatana-indicator-messages"
Expand Down

0 comments on commit 93e91c1

Please sign in to comment.