From 320cb5981592aad6544b6c1820132d0804aa868d Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 19 Feb 2023 22:20:41 -0300 Subject: [PATCH] xemu: refactor installPhase - Use install command instead of mkdir + cp - Use nix functional code instead of shell for loop --- pkgs/applications/emulators/xemu/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/emulators/xemu/default.nix b/pkgs/applications/emulators/xemu/default.nix index 3837ec653bd9..25a8fc9688c8 100644 --- a/pkgs/applications/emulators/xemu/default.nix +++ b/pkgs/applications/emulators/xemu/default.nix @@ -113,14 +113,14 @@ stdenv.mkDerivation (self: { installPhase = '' runHook preInstall - mkdir -p $out/{bin,share} - cp qemu-system-i386 $out/bin/xemu - - for RES in 16x16 24x24 32x32 48x48 128x128 256x256 512x512 - do - mkdir -p $out/share/icons/hicolor/$RES/apps/ - cp ../ui/icons/xemu_$RES.png $out/share/icons/hicolor/$RES/apps/xemu.png - done + install -Dm755 -T qemu-system-i386 $out/bin/xemu + '' + + # Generate code to install the icons + (lib.concatMapStringsSep ";\n" + (res: + "install -Dm644 -T ../ui/icons/xemu_${res}.png $out/share/icons/hicolor/${res}/apps/xemu.png") + [ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) + + '' runHook postInstall '';