From 66f8bb0d81ce0ac35cf505f5ea85abdb7ee12149 Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 30 Jul 2023 00:06:46 +0200 Subject: [PATCH] alsa-scarlett-gui: fix for deskop integration Now pretty much any DE should support the desktop entry file. The targetpath for the "Exec=" key is now absolute and targets the binary in the nix store. This also applies to the "Icon=" key. Also "substitueInPlace" is used to manipulate the default desktop entry file. --- pkgs/applications/audio/alsa-scarlett-gui/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/audio/alsa-scarlett-gui/default.nix b/pkgs/applications/audio/alsa-scarlett-gui/default.nix index 19a19d85609d..2a70103b55c4 100644 --- a/pkgs/applications/audio/alsa-scarlett-gui/default.nix +++ b/pkgs/applications/audio/alsa-scarlett-gui/default.nix @@ -25,7 +25,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config wrapGAppsHook4 ]; buildInputs = [ gtk4 alsa-lib ]; postInstall = '' - sed -Ei "s/(Exec\s?=\s?).*/\1alsa-scarlett-gui\nTryExec=alsa-scarlett-gui/" $out/share/applications/vu.b4.${pname}.desktop + substituteInPlace $out/share/applications/vu.b4.${pname}.desktop \ + --replace "Exec=/bin/alsa-scarlett-gui" "Exec=$out/bin/alsa-scarlett-gui" \ + --replace "Icon=alsa-scarlett-gui" "Icon=$out/share/icons/hicolor/256x256/apps/alsa-scarlett-gui.png" ''; # causes redefinition of _FORTIFY_SOURCE