2019-10-12 14:45:28 +02:00
|
|
|
{ stdenv, fetchsvn, SDL2, SDL2_image, SDL2_mixer
|
|
|
|
, zlib, runtimeShell
|
2015-12-29 17:02:16 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "sauerbraten-r${version}";
|
2019-10-12 14:45:28 +02:00
|
|
|
version = "5492";
|
2015-12-29 17:02:16 +01:00
|
|
|
|
|
|
|
src = fetchsvn {
|
|
|
|
url = "https://svn.code.sf.net/p/sauerbraten/code";
|
2019-10-12 14:45:28 +02:00
|
|
|
sha256 = "0pin7ggy84fadjvran18db5v0l81qfv42faknpfaxx47xqz00l5s";
|
2015-12-29 17:02:16 +01:00
|
|
|
rev = version;
|
2010-12-26 14:14:15 +01:00
|
|
|
};
|
|
|
|
|
2015-12-29 17:02:16 +01:00
|
|
|
buildInputs = [
|
2019-10-12 14:45:28 +02:00
|
|
|
SDL2 SDL2_mixer SDL2_image
|
|
|
|
zlib
|
2015-12-29 17:02:16 +01:00
|
|
|
];
|
2010-12-26 14:14:15 +01:00
|
|
|
|
2015-12-29 17:02:16 +01:00
|
|
|
preBuild = ''
|
2010-12-26 14:14:15 +01:00
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lX11"
|
2015-12-29 17:02:16 +01:00
|
|
|
pushd src
|
2010-12-26 14:14:15 +01:00
|
|
|
'';
|
|
|
|
|
2015-12-29 17:02:16 +01:00
|
|
|
installPhase = ''
|
|
|
|
popd
|
|
|
|
mkdir -p $out/bin $out/share/sauerbraten $out/share/doc/sauerbraten
|
|
|
|
cp -rv "docs/"* $out/share/doc/sauerbraten/
|
|
|
|
cp -v src/sauer_client src/sauer_server $out/share/sauerbraten/
|
|
|
|
cp -rv packages $out/share/sauerbraten/
|
|
|
|
cp -rv data $out/share/sauerbraten/
|
|
|
|
cat > $out/bin/sauerbraten_server <<EOF
|
2019-02-26 12:45:54 +01:00
|
|
|
#!${runtimeShell}
|
2015-12-29 17:02:16 +01:00
|
|
|
cd $out/share/sauerbraten
|
|
|
|
./sauer_server "\$@"
|
|
|
|
EOF
|
|
|
|
cat > $out/bin/sauerbraten_client <<EOF
|
2019-02-26 12:45:54 +01:00
|
|
|
#!${runtimeShell}
|
2015-12-29 17:02:16 +01:00
|
|
|
cd $out/share/sauerbraten
|
|
|
|
./sauer_client "\$@"
|
|
|
|
EOF
|
2010-12-26 14:14:15 +01:00
|
|
|
chmod a+x $out/bin/sauerbraten_*
|
2015-12-29 17:02:16 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2010-12-26 14:14:15 +01:00
|
|
|
description = "";
|
2015-12-29 17:02:16 +01:00
|
|
|
maintainers = [ maintainers.raskin ];
|
2013-11-05 00:04:36 +01:00
|
|
|
hydraPlatforms =
|
2010-12-26 14:14:15 +01:00
|
|
|
# raskin: tested amd64-linux;
|
|
|
|
# not setting platforms because it is 0.5+ GiB of game data
|
|
|
|
[];
|
|
|
|
license = "freeware"; # as an aggregate - data files have different licenses
|
|
|
|
# code is under zlib license
|
2015-12-29 17:02:16 +01:00
|
|
|
platforms = platforms.linux;
|
2010-12-26 14:14:15 +01:00
|
|
|
};
|
2015-12-29 17:02:16 +01:00
|
|
|
}
|