{ lib, stdenv, fetchurl, bash, pharo, unzip, makeDesktopItem }: stdenv.mkDerivation rec { version = "2017.02.28"; pname = "pharo-launcher"; src = fetchurl { url = "http://files.pharo.org/platform/launcher/PharoLauncher-user-stable-${version}.zip"; sha256 = "1hfwjyx0c47s6ivc1zr2sf5mk1xw2zspsv0ns8mj3kcaglzqwiq0"; }; executable-name = "pharo-launcher"; desktopItem = makeDesktopItem { name = "Pharo"; exec = executable-name; icon = "pharo"; comment = "Launcher for Pharo distributions"; desktopName = "Pharo"; genericName = "Pharo"; categories = [ "Development" ]; }; # because upstream tarball has no top-level directory. sourceRoot = "."; nativeBuildInputs = [ unzip ]; buildInputs = [ bash pharo ]; installPhase = '' mkdir -p $prefix/share/pharo-launcher mkdir -p $prefix/bin mv PharoLauncher.image $prefix/share/pharo-launcher/pharo-launcher.image mv PharoLauncher.changes $prefix/share/pharo-launcher/pharo-launcher.changes mkdir -p $prefix/share/applications cp "${desktopItem}/share/applications/"* $out/share/applications cat > $prefix/bin/${executable-name} <