1 { lib, stdenv, requireFile, unzip, makeDesktopItem, SDL2, SDL2_mixer, libogg, libvorbis }:
4 arch = if stdenv.system == "x86_64-linux"
8 desktopItem = makeDesktopItem {
9 desktopName = "World of Goo";
10 genericName = "World of Goo";
11 categories = [ "Game" ];
12 exec = "WorldOfGoo.bin.${arch}";
13 icon = "2dboy-worldofgoo";
19 stdenv.mkDerivation rec {
24 We cannot download the full version automatically, as you require a license.
25 Once you have bought a license, you need to add your downloaded version to the nix store.
26 You can do this by using "nix-prefetch-url file://\$PWD/${pname}.Linux${version}.sh"
27 in the directory where you saved it.
32 name = "WorldOfGoo.Linux.1.53.sh";
33 sha256 = "175e4b0499a765f1564942da4bd65029f8aae1de8231749c56bec672187d53ee";
36 nativeBuildInputs = [ unzip ];
38 phases = [ "unpackPhase installPhase" ];
40 libPath = lib.makeLibraryPath [ stdenv.cc.cc.lib stdenv.cc.libc SDL2 SDL2_mixer
44 # The game is distributed as a shell script, with a tar of mojosetup, and a
45 # zip archive attached to the end. Therefore a simple unzip does the job.
46 # However, to avoid unzip errors, we need to strip those out first.
47 tail -c +421887 ${src} > ${src}.zip
48 unzip -q ${src}.zip -d ${pname}
52 mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/256x256/apps
54 install -t $out/bin -m755 data/${arch}/WorldOfGoo.bin.${arch}
55 cp -R data/noarch/* $out/bin
56 cp data/noarch/game/gooicon.png $out/share/icons/hicolor/256x256/apps/2dboy-worldofgoo.png
57 cp ${desktopItem}/share/applications/worldofgoo.desktop \
58 $out/share/applications/worldofgoo.desktop
60 patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath $libPath $out/bin/WorldOfGoo.bin.${arch}
64 description = "A physics based puzzle game";
66 World of Goo is a physics based puzzle / construction game. The millions of Goo
67 Balls who live in the beautiful World of Goo don't know that they are in a
68 game, or that they are extremely delicious.
70 homepage = "https://worldofgoo.com";
71 license = licenses.unfree;
72 platforms = [ "i686-linux" "x86_64-linux" ];
73 maintainers = with maintainers; [ jcumming ];