1 { lib, stdenv, requireFile, SDL, libpulseaudio, alsa-lib, runtimeShell }:
3 stdenv.mkDerivation rec {
8 We cannot download the full version automatically, as you require a license.
9 Once you bought a license, you need to add your downloaded version to the nix store.
10 You can do this by using "nix-prefetch-url file://\$PWD/vessel-${version}-bin" in the
11 directory where you saved it.
14 src = if (stdenv.hostPlatform.isi686) then
17 name = "vessel-${version}-bin";
18 sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
19 } else throw "unsupported platform ${stdenv.hostPlatform.system} only i686-linux supported for now.";
21 phases = "installPhase";
22 ld_preload = ./isatty.c;
24 libPath = lib.makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc ]
25 + ":" + lib.makeLibraryPath [ SDL libpulseaudio alsa-lib ] ;
28 mkdir -p $out/libexec/strangeloop/vessel/
31 # allow scripting of the mojoinstaller
32 gcc -fPIC -shared -o isatty.so $ld_preload
35 echo @@@ this next step appears to hang for a while
38 # if we call ld.so $(bin) we don't need to set the ELF interpreter, and save a patchelf step.
39 LD_PRELOAD=./isatty.so $(cat $NIX_CC/nix-support/dynamic-linker) $src << IM_A_BOT
41 $out/libexec/strangeloop/vessel/
44 # use nix SDL libraries
45 rm $out/libexec/strangeloop/vessel/x86/libSDL*
46 rm $out/libexec/strangeloop/vessel/x86/libstdc++*
48 # props to Ethan Lee (the Vessel porter) for understanding
49 # how $ORIGIN works in rpath. There is hope for humanity.
51 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
52 --set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
53 $out/libexec/strangeloop/vessel/x86/vessel.x86
55 # we need to libs to find their deps
56 for lib in $out/libexec/strangeloop/vessel/x86/lib* ; do
58 --set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
62 cat > $out/bin/Vessel << EOW
64 cd $out/libexec/strangeloop/vessel/
68 chmod +x $out/bin/Vessel
72 description = "Fluid physics based puzzle game";
74 Living liquid machines have overrun this world of unstoppable progress,
75 and it is the role of their inventor, Arkwright, to stop the chaos they are
76 causing. Vessel is a game about a man with the power to bring ordinary matter
77 to life, and all the consequences that ensue.
79 homepage = "http://www.strangeloopgames.com";
80 license = licenses.unfree;
81 maintainers = with maintainers; [ jcumming ];