{ fetchurl, godotBin, zlib, godotDesktopFile, godotIconPNG, godotIconSVG, godotManpage }: let qualifier = "stable"; in godotBin.overrideAttrs (oldAttrs: rec { pname = "godot-mono-bin"; version = "4.4.1"; src = fetchurl { url = "https://github.com/godotengine/godot-builds/releases/download/${version}-rc1/Godot_v4.4.1-rc1_mono_linux_x86_64.zip"; sha256 = "sha256-MnOgW5reNGWO1soadU4KTwVtWiZZqmLV7FX8AOUkqhg="; }; buildInputs = oldAttrs.buildInputs ++ [zlib]; unpackCmd = ""; installPhase = '' mkdir -p $out/bin $out/opt/godot-mono install -m 0755 Godot_v${version}-rc1_mono_linux.x86_64 $out/opt/godot-mono/Godot_v${version}-${qualifier}_mono_x11.64 cp -r GodotSharp $out/opt/godot-mono ln -s $out/opt/godot-mono/Godot_v${version}-${qualifier}_mono_x11.64 $out/bin/godot-mono # Only create a desktop file, if the necessary variables are set # these are set only, if one installs this program using flakes. if [[ -f "${godotDesktopFile}" ]]; then mkdir -p "$out/man/share/man/man6" cp ${godotManpage} "$out/man/share/man/man6/" mkdir -p $out/share/{applications,icons/hicolor/scalable/apps} cp ${godotDesktopFile} "$out/share/applications/org.godotengine.Godot-Mono.desktop" cp ${godotIconSVG} "$out/share/icons/hicolor/scalable/apps/godot.svg" cp ${godotIconPNG} "$out/share/icons/godot.png" substituteInPlace "$out/share/applications/org.godotengine.Godot-Mono.desktop" \ --replace "Exec=godot" "Exec=$out/bin/godot-mono" fi ''; postFixup = '' wrapProgram $out/bin/godot-mono \ --set LD_LIBRARY_PATH ${oldAttrs.libraries} ''; })