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.
This commit is contained in:
matt 2023-07-30 00:06:46 +02:00 committed by Anderson Torres
parent 18dd51567e
commit 66f8bb0d81

View file

@ -25,7 +25,9 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config wrapGAppsHook4 ]; nativeBuildInputs = [ pkg-config wrapGAppsHook4 ];
buildInputs = [ gtk4 alsa-lib ]; buildInputs = [ gtk4 alsa-lib ];
postInstall = '' 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 # causes redefinition of _FORTIFY_SOURCE