2011-04-13 09:47:51 +04:00
|
|
|
{ fetchurl, stdenv, python, alsaLib, libX11, mesa, SDL, lua5, zlib, bam }:
|
2009-01-13 22:44:11 +03:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2011-11-06 14:11:31 +04:00
|
|
|
name = "teeworlds-0.6.1";
|
2009-01-13 22:44:11 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2011-11-06 14:11:31 +04:00
|
|
|
url = "http://www.teeworlds.com/files/${name}-source.tar.gz";
|
|
|
|
sha256 = "025rcz59mdqksja4akn888c8avj9j28rk86vw7w1licdp67x8a33";
|
2009-01-13 22:44:11 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
# Note: Teeworlds requires Python 2.x to compile. Python 3.0 will
|
|
|
|
# not work.
|
2011-04-13 09:47:51 +04:00
|
|
|
buildInputs = [ python alsaLib libX11 mesa SDL lua5 zlib bam ];
|
2009-01-13 22:44:11 +03:00
|
|
|
|
|
|
|
configurePhase = ''
|
2011-04-13 09:47:51 +04:00
|
|
|
bam release
|
2009-01-13 22:44:11 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2009-01-13 23:36:09 +03:00
|
|
|
# Copy the graphics, sounds, etc.
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/share/${name}"
|
2009-01-13 23:36:09 +03:00
|
|
|
cp -rv data other/icons "$out/share/${name}"
|
2009-01-13 22:44:11 +03:00
|
|
|
|
2009-01-13 23:36:09 +03:00
|
|
|
# Copy the executables (client, server, etc.).
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/bin"
|
2009-01-13 23:36:09 +03:00
|
|
|
executables=""
|
|
|
|
for file in *
|
|
|
|
do
|
|
|
|
if [ -f "$file" ] && [ -x "$file" ]
|
|
|
|
then
|
|
|
|
executables="$file $executables"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cp -v $executables "$out/bin"
|
2009-01-13 22:44:11 +03:00
|
|
|
|
2009-01-13 23:36:09 +03:00
|
|
|
# Make sure the programs are executed from the right directory so
|
|
|
|
# that they can access the graphics and sounds.
|
|
|
|
for program in $executables
|
|
|
|
do
|
|
|
|
mv -v "$out/bin/$program" "$out/bin/.wrapped-$program"
|
|
|
|
cat > "$out/bin/$program" <<EOF
|
2009-01-13 22:44:11 +03:00
|
|
|
#!/bin/sh
|
2010-02-02 21:09:58 +03:00
|
|
|
cd "$out/share/${name}" && exec "$out/bin/.wrapped-$program" "\$@"
|
2009-01-13 22:44:11 +03:00
|
|
|
EOF
|
2009-01-13 23:36:09 +03:00
|
|
|
chmod -v +x "$out/bin/$program"
|
|
|
|
done
|
2009-01-13 22:44:11 +03:00
|
|
|
|
2009-01-13 23:36:09 +03:00
|
|
|
# Copy the documentation.
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/doc/${name}"
|
2009-01-13 22:44:11 +03:00
|
|
|
cp -v *.txt "$out/doc/${name}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-08-24 18:21:08 +04:00
|
|
|
description = "Retro multiplayer shooter game";
|
2009-01-13 22:44:11 +03:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Teeworlds is a free online multiplayer game, available for all
|
|
|
|
major operating systems. Battle with up to 12 players in a
|
|
|
|
variety of game modes, including Team Deathmatch and Capture The
|
|
|
|
Flag. You can even design your own maps!
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = http://teeworlds.com/;
|
|
|
|
license = "BSD-style, see `license.txt'";
|
2011-11-06 14:11:31 +04:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ astsmtl ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
2009-01-13 22:44:11 +03:00
|
|
|
};
|
|
|
|
}
|