2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, requireFile, unzip, makeDesktopItem, SDL2, SDL2_mixer, libogg, libvorbis }:
|
2020-04-12 15:42:18 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
arch = if stdenv.system == "x86_64-linux"
|
|
|
|
then "x86_64"
|
|
|
|
else "x86";
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
desktopName = "World of Goo";
|
|
|
|
genericName = "World of Goo";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2020-04-12 15:42:18 +00:00
|
|
|
exec = "WorldOfGoo.bin.${arch}";
|
|
|
|
icon = "2dboy-worldofgoo";
|
|
|
|
name = "worldofgoo";
|
|
|
|
};
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2020-04-12 15:42:18 +00:00
|
|
|
in
|
2012-11-28 22:38:46 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-12 15:42:18 +00:00
|
|
|
pname = "WorldOfGoo";
|
|
|
|
version = "1.53";
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2020-04-12 15:42:18 +00:00
|
|
|
helpMsg = ''
|
2012-11-28 22:38:46 +00:00
|
|
|
We cannot download the full version automatically, as you require a license.
|
2020-04-12 15:42:18 +00:00
|
|
|
Once you have bought a license, you need to add your downloaded version to the nix store.
|
|
|
|
You can do this by using "nix-prefetch-url file://\$PWD/${pname}.Linux${version}.sh"
|
|
|
|
in the directory where you saved it.
|
2019-02-26 11:45:54 +00:00
|
|
|
'';
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2020-04-12 15:42:18 +00:00
|
|
|
src = requireFile {
|
|
|
|
message = helpMsg;
|
|
|
|
name = "WorldOfGoo.Linux.1.53.sh";
|
|
|
|
sha256 = "175e4b0499a765f1564942da4bd65029f8aae1de8231749c56bec672187d53ee";
|
|
|
|
};
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2020-04-12 15:42:18 +00:00
|
|
|
sourceRoot = pname;
|
|
|
|
phases = [ "unpackPhase installPhase" ];
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc.lib stdenv.cc.libc SDL2 SDL2_mixer
|
2020-04-12 15:42:18 +00:00
|
|
|
libogg libvorbis ];
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2020-04-12 15:42:18 +00:00
|
|
|
unpackPhase = ''
|
2021-01-15 04:31:39 +00:00
|
|
|
# The game is distributed as a shell script, with a tar of mojosetup, and a
|
2020-04-12 15:42:18 +00:00
|
|
|
# zip archive attached to the end. Therefore a simple unzip does the job.
|
|
|
|
# However, to avoid unzip errors, we need to strip those out first.
|
|
|
|
tail -c +421887 ${src} > ${src}.zip
|
|
|
|
unzip -q ${src}.zip -d ${pname}
|
|
|
|
'';
|
2012-11-28 22:38:46 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-04-12 15:42:18 +00:00
|
|
|
mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/256x256/apps
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2020-04-12 15:42:18 +00:00
|
|
|
install -t $out/bin -m755 data/${arch}/WorldOfGoo.bin.${arch}
|
|
|
|
cp -R data/noarch/* $out/bin
|
|
|
|
cp data/noarch/game/gooicon.png $out/share/icons/hicolor/256x256/apps/2dboy-worldofgoo.png
|
|
|
|
cp ${desktopItem}/share/applications/worldofgoo.desktop \
|
|
|
|
$out/share/applications/worldofgoo.desktop
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2020-04-12 15:42:18 +00:00
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath $libPath $out/bin/WorldOfGoo.bin.${arch}
|
2012-11-28 22:38:46 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2012-11-28 22:38:46 +00:00
|
|
|
description = "A physics based puzzle game";
|
|
|
|
longDescription = ''
|
|
|
|
World of Goo is a physics based puzzle / construction game. The millions of Goo
|
|
|
|
Balls who live in the beautiful World of Goo don't know that they are in a
|
|
|
|
game, or that they are extremely delicious.
|
|
|
|
'';
|
2022-01-03 15:53:12 +00:00
|
|
|
homepage = "https://worldofgoo.com";
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.unfree;
|
2020-04-12 15:42:18 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ jcumming maxeaubrey ];
|
2012-11-28 22:38:46 +00:00
|
|
|
};
|
|
|
|
}
|