about summary refs log tree commit diff
path: root/pkgs/by-name/lu/lunacy/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/lu/lunacy/package.nix')
-rw-r--r--pkgs/by-name/lu/lunacy/package.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/by-name/lu/lunacy/package.nix b/pkgs/by-name/lu/lunacy/package.nix
index 1e3ad510bf9ef..8f55e067126d2 100644
--- a/pkgs/by-name/lu/lunacy/package.nix
+++ b/pkgs/by-name/lu/lunacy/package.nix
@@ -14,15 +14,16 @@
 , libXcursor
 , openssl
 , imagemagick
+, makeWrapper
 }:
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "lunacy";
-  version = "9.6.0";
+  version = "9.6.1";
 
   src = fetchurl {
     url = "https://lcdn.icons8.com/setup/Lunacy_${finalAttrs.version}.deb";
-    hash = "sha256-PvQGDUC9BsIql4xMM1OH45gq3YtJMKJcYg4N2o18hno=";
+    hash = "sha256-w7qw5HyJcEjeujz54bTkkofmzacIBLYqJvVuldvbytE=";
   };
 
   unpackCmd = ''
@@ -47,6 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
   nativeBuildInputs = [
     dpkg
     autoPatchelfHook
+    makeWrapper
   ];
 
   # adds to the RPATHS of all shared objects (exe and libs)
@@ -82,22 +84,22 @@ stdenv.mkDerivation (finalAttrs: {
     # Prepare the desktop icon, the upstream icon is 200x200 but the hicolor theme does not
     # support this resolution. Nearest sizes are 192x192 and 256x256.
     ${imagemagick}/bin/convert "opt/icons8/lunacy/Assets/LunacyLogo.png" -resize 192x192 lunacy.png
-    install -D lunacy.png "$out/share/icons/hicolor/192x192/apps/${finalAttrs.pname}.png"
+    install -D lunacy.png "$out/share/icons/hicolor/192x192/apps/lunacy.png"
 
     runHook postInstall
   '';
 
   postInstall = ''
     substituteInPlace $out/share/applications/lunacy.desktop \
-      --replace "Exec=/opt/icons8/lunacy/Lunacy" "Exec=${finalAttrs.pname}" \
-      --replace "Icon=/opt/icons8/lunacy/Assets/LunacyLogo.png" "Icon=${finalAttrs.pname}"
+      --replace "Exec=/opt/icons8/lunacy/Lunacy" "Exec=lunacy" \
+      --replace "Icon=/opt/icons8/lunacy/Assets/LunacyLogo.png" "Icon=lunacy"
   '';
 
   postFixup = ''
     mkdir $out/bin
 
-    # Fixes runtime error regarding missing libSkiaSharp.so (which is in the same directory as the binary).
-    ln -s "$out/lib/lunacy/Lunacy" "$out/bin/${finalAttrs.pname}"
+    # The wrapper is needed instead of a symlink to prevent a random "Unsupported file format" when running the app.
+    makeWrapper "$out/lib/lunacy/Lunacy" "$out/bin/lunacy"
   '';
 
   meta = with lib; {