2021-06-10 03:57:09 +01:00
|
|
|
{ lib, stdenv, requireFile, SDL, libpulseaudio, alsa-lib, runtimeShell }:
|
2012-12-17 07:24:31 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-22 22:44:58 +01:00
|
|
|
pname = "vessel";
|
|
|
|
version = "12082012";
|
2012-12-17 07:24:31 +00:00
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
goBuyItNow = ''
|
2012-12-17 07:24:31 +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.
|
2021-06-22 22:44:58 +01:00
|
|
|
You can do this by using "nix-prefetch-url file://\$PWD/vessel-${version}-bin" in the
|
2012-12-17 07:24:31 +00:00
|
|
|
directory where you saved it.
|
2019-02-26 11:45:54 +00:00
|
|
|
'';
|
2012-12-17 07:24:31 +00:00
|
|
|
|
|
|
|
src = if (stdenv.isi686) then
|
|
|
|
requireFile {
|
|
|
|
message = goBuyItNow;
|
2021-06-22 22:44:58 +01:00
|
|
|
name = "vessel-${version}-bin";
|
2012-12-17 07:24:31 +00:00
|
|
|
sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
|
2018-08-20 20:11:29 +01:00
|
|
|
} else throw "unsupported platform ${stdenv.hostPlatform.system} only i686-linux supported for now.";
|
2012-12-17 07:24:31 +00:00
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
ld_preload = ./isatty.c;
|
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc ]
|
2021-06-10 03:57:09 +01:00
|
|
|
+ ":" + lib.makeLibraryPath [ SDL libpulseaudio alsa-lib ] ;
|
2012-12-17 07:24:31 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/libexec/strangeloop/vessel/
|
|
|
|
mkdir -p $out/bin
|
2012-12-17 07:24:31 +00:00
|
|
|
|
|
|
|
# allow scripting of the mojoinstaller
|
|
|
|
gcc -fPIC -shared -o isatty.so $ld_preload
|
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
echo @@@
|
2012-12-17 07:24:31 +00:00
|
|
|
echo @@@ this next step appears to hang for a while
|
2019-02-26 11:45:54 +00:00
|
|
|
echo @@@
|
2012-12-17 07:24:31 +00:00
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
# if we call ld.so $(bin) we don't need to set the ELF interpreter, and save a patchelf step.
|
2014-12-17 18:11:30 +00:00
|
|
|
LD_PRELOAD=./isatty.so $(cat $NIX_CC/nix-support/dynamic-linker) $src << IM_A_BOT
|
2012-12-17 07:24:31 +00:00
|
|
|
n
|
|
|
|
$out/libexec/strangeloop/vessel/
|
|
|
|
IM_A_BOT
|
|
|
|
|
|
|
|
# use nix SDL libraries
|
|
|
|
rm $out/libexec/strangeloop/vessel/x86/libSDL*
|
|
|
|
rm $out/libexec/strangeloop/vessel/x86/libstdc++*
|
|
|
|
|
|
|
|
# props to Ethan Lee (the Vessel porter) for understanding
|
2019-02-26 11:45:54 +00:00
|
|
|
# how $ORIGIN works in rpath. There is hope for humanity.
|
2012-12-17 07:24:31 +00:00
|
|
|
patchelf \
|
2014-12-17 18:11:30 +00:00
|
|
|
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2012-12-17 07:24:31 +00:00
|
|
|
--set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
|
|
|
|
$out/libexec/strangeloop/vessel/x86/vessel.x86
|
|
|
|
|
2012-12-28 02:42:40 +00:00
|
|
|
# we need to libs to find their deps
|
|
|
|
for lib in $out/libexec/strangeloop/vessel/x86/lib* ; do
|
|
|
|
patchelf \
|
|
|
|
--set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
|
|
|
|
$lib
|
|
|
|
done
|
|
|
|
|
2012-12-17 07:24:31 +00:00
|
|
|
cat > $out/bin/Vessel << EOW
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2012-12-17 07:24:31 +00:00
|
|
|
cd $out/libexec/strangeloop/vessel/
|
|
|
|
exec ./x86/vessel.x86
|
|
|
|
EOW
|
|
|
|
|
|
|
|
chmod +x $out/bin/Vessel
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2012-12-17 07:24:31 +00:00
|
|
|
description = "A fluid physics based puzzle game";
|
|
|
|
longDescription = ''
|
|
|
|
Living liquid machines have overrun this world of unstoppable progress,
|
|
|
|
and it is the role of their inventor, Arkwright, to stop the chaos they are
|
|
|
|
causing. Vessel is a game about a man with the power to bring ordinary matter
|
|
|
|
to life, and all the consequences that ensue.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.strangeloopgames.com";
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.unfree;
|
2015-05-27 20:56:04 +01:00
|
|
|
maintainers = with maintainers; [ jcumming ];
|
2012-12-17 07:24:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|