From 5ba65810264eed74a31398d23d087cc2ca5212eb Mon Sep 17 00:00:00 2001 From: normalc Date: Sat, 4 Jan 2025 19:11:40 -0500 Subject: [PATCH] ruffle: add postInstall phase for desktop files on Linux --- pkgs/by-name/ru/ruffle/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/ru/ruffle/package.nix b/pkgs/by-name/ru/ruffle/package.nix index 48313f497ef53..757a0a11fc7f5 100644 --- a/pkgs/by-name/ru/ruffle/package.nix +++ b/pkgs/by-name/ru/ruffle/package.nix @@ -66,6 +66,16 @@ rustPlatform.buildRustPackage { dontWrapGApps = true; + postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm644 -t $out/share/icons/hicolor/scalable/apps/ desktop/packages/linux/rs.ruffle.Ruffle.svg + + install -Dm644 -t $out/share/applications/ desktop/packages/linux/rs.ruffle.Ruffle.desktop + substituteInPlace $out/share/applications/rs.ruffle.Ruffle.desktop \ + --replace-fail "Exec=ruffle %u" "Exec=ruffle_desktop %u" + + install -Dm644 -t $out/share/metainfo/ desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml + ''; + preFixup = lib.optionalString stdenv.hostPlatform.isLinux '' patchelf $out/bin/ruffle_desktop \ --add-needed libxkbcommon-x11.so \