2018-07-21 00:44:44 +00:00
|
|
|
{ stdenv, requireFile
|
2019-11-10 16:44:34 +00:00
|
|
|
, libX11, libXext, libXau, libxcb, libXdmcp , SDL, SDL_mixer, libvorbis, libGLU, libGL
|
2019-02-26 11:45:54 +00:00
|
|
|
, runtimeShell
|
2012-11-28 22:38:46 +00:00
|
|
|
, demo ? false }:
|
|
|
|
|
|
|
|
# TODO: add i686 support
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-02-26 11:45:54 +00:00
|
|
|
name = if demo
|
2012-11-28 22:38:46 +00:00
|
|
|
then "WorldOfGooDemo-1.41"
|
|
|
|
else "WorldofGoo-1.41";
|
|
|
|
|
2018-08-20 19:11:29 +00:00
|
|
|
arch = if stdenv.hostPlatform.system == "x86_64-linux" then "supported"
|
2012-11-28 22:38:46 +00:00
|
|
|
else throw "Sorry. World of Goo only is only supported on x86_64 now.";
|
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
goBuyItNow = ''
|
2012-11-28 22:38:46 +00:00
|
|
|
We cannot download the full version automatically, as you require a license.
|
|
|
|
Once you bought a license, you need to add your downloaded version to the nix store.
|
2018-03-03 08:53:52 +00:00
|
|
|
You can do this by using "nix-prefetch-url file://\$PWD/WorldOfGooSetup.1.41.tar.gz" in the
|
2012-11-28 22:38:46 +00:00
|
|
|
directory where you saved it.
|
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
Or you can install the demo version: 'nix-env -i -A pkgs.worldofgoo_demo'.
|
|
|
|
'';
|
2012-11-28 22:38:46 +00:00
|
|
|
|
|
|
|
getTheDemo = ''
|
2018-03-03 08:53:52 +00:00
|
|
|
We cannot download the demo version automatically. Please go to
|
2012-11-28 22:38:46 +00:00
|
|
|
http://worldofgoo.com/dl2.php?lk=demo, then add it to your nix store.
|
2018-03-03 08:53:52 +00:00
|
|
|
You can do this by using "nix-prefetch-url file://\$PWD/WorldOfGooDemo.1.41.tar.gz" in the
|
2012-11-28 22:38:46 +00:00
|
|
|
directory where you saved it.
|
|
|
|
'';
|
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
src = if demo
|
|
|
|
then
|
2012-11-28 22:38:46 +00:00
|
|
|
requireFile {
|
|
|
|
message = getTheDemo;
|
|
|
|
name = "WorldOfGooDemo.1.41.tar.gz";
|
|
|
|
sha256 = "0ndcix1ckvcj47sgndncr3hxjcg402cbd8r16rhq4cc43ibbaxri";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
requireFile {
|
|
|
|
message = goBuyItNow;
|
|
|
|
name = "WorldOfGooSetup.1.41.tar.gz";
|
|
|
|
sha256 = "0rj5asx4a2x41ncwdby26762my1lk1gaqar2rl8dijfnpq8qlnk7";
|
|
|
|
};
|
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
|
|
|
|
# XXX: stdenv.lib.makeLibraryPath doesn't pick up /lib64
|
2019-02-26 11:45:54 +00:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc ]
|
2019-11-10 16:44:34 +00:00
|
|
|
+ ":" + stdenv.lib.makeLibraryPath [libX11 libXext libXau libxcb libXdmcp SDL SDL_mixer libvorbis libGLU libGL ]
|
2015-01-15 04:25:26 +00:00
|
|
|
+ ":" + stdenv.cc.cc + "/lib64";
|
2012-11-28 22:38:46 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 12:56:10 +00:00
|
|
|
mkdir -p $out/libexec/2dboy/WorldOfGoo/
|
|
|
|
mkdir -p $out/bin
|
2012-11-28 22:38:46 +00:00
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath $libPath ./WorldOfGoo.bin64
|
2012-11-28 22:38:46 +00:00
|
|
|
|
|
|
|
cp -r * $out/libexec/2dboy/WorldOfGoo/
|
|
|
|
|
|
|
|
#makeWrapper doesn't do cd. :(
|
|
|
|
|
|
|
|
cat > $out/bin/WorldofGoo << EOF
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2012-11-28 22:38:46 +00:00
|
|
|
cd $out/libexec/2dboy/WorldOfGoo
|
|
|
|
exec ./WorldOfGoo.bin64
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/WorldofGoo
|
|
|
|
'';
|
|
|
|
|
2015-05-27 19:56:04 +00:00
|
|
|
meta = with stdenv.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.
|
|
|
|
'';
|
|
|
|
homepage = http://worldofgoo.com;
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.unfree;
|
2015-05-27 19:56:04 +00:00
|
|
|
maintainers = with maintainers; [ jcumming ];
|
2012-11-28 22:38:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|