···11+{ stdenv, requireFile, SDL }:
22+33+stdenv.mkDerivation rec {
44+ name = "vessel-12082012";
55+66+ goBuyItNow = ''
77+ We cannot download the full version automatically, as you require a license.
88+ Once you bought a license, you need to add your downloaded version to the nix store.
99+ You can do this by using "nix-prefetch-url file://${name}-bin" in the
1010+ directory where you saved it.
1111+ '';
1212+1313+ src = if (stdenv.isi686) then
1414+ requireFile {
1515+ message = goBuyItNow;
1616+ name = "${name}-bin";
1717+ sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
1818+ } else throw "unsupported platform ${stdenv.s:ystem} only i686-linux supported for now.";
1919+2020+ phases = "installPhase";
2121+ ld_preload = ./isatty.c;
2222+2323+ libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.gcc stdenv.gcc.libc ]
2424+ + ":" + stdenv.lib.makeLibraryPath [ SDL ] ;
2525+2626+ installPhase = ''
2727+ ensureDir $out/libexec/strangeloop/vessel/
2828+ ensureDir $out/bin
2929+3030+ # allow scripting of the mojoinstaller
3131+ gcc -fPIC -shared -o isatty.so $ld_preload
3232+3333+ echo @@@
3434+ echo @@@ this next step appears to hang for a while
3535+ echo @@@
3636+3737+ # if we call ld.so $(bin) we don't need to set the ELF interpreter, and save a patchelf step.
3838+ LD_PRELOAD=./isatty.so $(cat $NIX_GCC/nix-support/dynamic-linker) $src << IM_A_BOT
3939+ n
4040+ $out/libexec/strangeloop/vessel/
4141+ IM_A_BOT
4242+4343+ # use nix SDL libraries
4444+ rm $out/libexec/strangeloop/vessel/x86/libSDL*
4545+ rm $out/libexec/strangeloop/vessel/x86/libstdc++*
4646+4747+ # props to Ethan Lee (the Vessel porter) for understanding
4848+ # how $ORIGIN works in rpath. There is hope for humanity.
4949+ patchelf \
5050+ --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
5151+ --set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
5252+ $out/libexec/strangeloop/vessel/x86/vessel.x86
5353+5454+ cat > $out/bin/Vessel << EOW
5555+ #!/bin/sh
5656+ cd $out/libexec/strangeloop/vessel/
5757+ exec ./x86/vessel.x86
5858+ EOW
5959+6060+ chmod +x $out/bin/Vessel
6161+ '';
6262+6363+ meta = {
6464+ description = "A fluid physics based puzzle game";
6565+ longDescription = ''
6666+ Living liquid machines have overrun this world of unstoppable progress,
6767+ and it is the role of their inventor, Arkwright, to stop the chaos they are
6868+ causing. Vessel is a game about a man with the power to bring ordinary matter
6969+ to life, and all the consequences that ensue.
7070+ '';
7171+ homepage = http://www.strangeloopgames.com;
7272+ license = [ "unfree" ];
7373+ maintainers = with stdenv.lib.maintainers; [ jcumming ];
7474+ platforms = [ "i686-linux"] ;
7575+ };
7676+7777+}
+6
pkgs/games/vessel/isatty.c
···11+// We override isatty to help 'automate' installers.
22+33+// Some installers (mojoinstall) have a stdio GUI that refuses to run if you
44+// feed it a file on stdin. This should help that.
55+66+int isatty(int fd) { return 1; }