xemu: refactor installPhase

- Use install command instead of mkdir + cp
- Use nix functional code instead of shell for loop
This commit is contained in:
Anderson Torres 2023-02-19 22:20:41 -03:00
parent 9bff8435da
commit 320cb59815

View file

@ -113,14 +113,14 @@ stdenv.mkDerivation (self: {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
mkdir -p $out/{bin,share} install -Dm755 -T qemu-system-i386 $out/bin/xemu
cp qemu-system-i386 $out/bin/xemu '' +
# Generate code to install the icons
for RES in 16x16 24x24 32x32 48x48 128x128 256x256 512x512 (lib.concatMapStringsSep ";\n"
do (res:
mkdir -p $out/share/icons/hicolor/$RES/apps/ "install -Dm644 -T ../ui/icons/xemu_${res}.png $out/share/icons/hicolor/${res}/apps/xemu.png")
cp ../ui/icons/xemu_$RES.png $out/share/icons/hicolor/$RES/apps/xemu.png [ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) +
done ''
runHook postInstall runHook postInstall
''; '';