Merge pull request #106317 from NixOS/upd/sauerbraten

sauerbraten: 5492 -> 2020-12-04
This commit is contained in:
Sandro 2020-12-08 05:10:33 +01:00 committed by GitHub
commit b612010717
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,50 +1,43 @@
{ stdenv, fetchsvn, SDL2, SDL2_image, SDL2_mixer { stdenv, fetchzip, SDL2, SDL2_image, SDL2_mixer
, zlib, runtimeShell , zlib, makeWrapper
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "sauerbraten-r${version}"; pname = "sauerbraten";
version = "5492"; version = "2020-12-04";
src = fetchsvn { src = fetchzip {
url = "https://svn.code.sf.net/p/sauerbraten/code"; url = "mirror://sourceforge/sauerbraten/sauerbraten_${builtins.replaceStrings [ "-" ] [ "_" ] version}_linux.tar.bz2";
sha256 = "0pin7ggy84fadjvran18db5v0l81qfv42faknpfaxx47xqz00l5s"; sha256 = "1hknwpnvsakz6s7l7j1r5aqmgrzp4wcbn8yg8nxmvsddbhxdj1kc";
rev = version;
}; };
nativeBuildInputs = [
makeWrapper
];
buildInputs = [ buildInputs = [
SDL2 SDL2_mixer SDL2_image SDL2 SDL2_mixer SDL2_image
zlib zlib
]; ];
preBuild = '' sourceRoot = "source/src";
export NIX_LDFLAGS="$NIX_LDFLAGS -lX11"
pushd src
'';
installPhase = '' installPhase = ''
popd
mkdir -p $out/bin $out/share/sauerbraten $out/share/doc/sauerbraten mkdir -p $out/bin $out/share/sauerbraten $out/share/doc/sauerbraten
cp -rv "docs/"* $out/share/doc/sauerbraten/ cp -rv "../docs/"* $out/share/doc/sauerbraten/
cp -v src/sauer_client src/sauer_server $out/share/sauerbraten/ cp -v sauer_client sauer_server $out/share/sauerbraten/
cp -rv packages $out/share/sauerbraten/ cp -rv ../packages ../data $out/share/sauerbraten/
cp -rv data $out/share/sauerbraten/
cat > $out/bin/sauerbraten_server <<EOF makeWrapper $out/share/sauerbraten/sauer_server $out/bin/sauerbraten_server \
#!${runtimeShell} --run "cd $out/share/sauerbraten"
cd $out/share/sauerbraten makeWrapper $out/share/sauerbraten/sauer_client $out/bin/sauerbraten_client \
./sauer_server "\$@" --run "cd $out/share/sauerbraten" \
EOF --add-flags "-q\''${HOME}"
cat > $out/bin/sauerbraten_client <<EOF
#!${runtimeShell}
cd $out/share/sauerbraten
./sauer_client "\$@"
EOF
chmod a+x $out/bin/sauerbraten_*
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = ""; description = "A free multiplayer & singleplayer first person shooter, the successor of the Cube FPS";
maintainers = [ maintainers.raskin ]; maintainers = with maintainers; [ raskin ajs124 ];
hydraPlatforms = hydraPlatforms =
# raskin: tested amd64-linux; # raskin: tested amd64-linux;
# not setting platforms because it is 0.5+ GiB of game data # not setting platforms because it is 0.5+ GiB of game data