2016-09-03 18:41:13 +02:00
|
|
|
{ fetchurl, stdenv, makeWrapper, python, alsaLib
|
2018-02-24 13:59:47 +01:00
|
|
|
, libX11, libGLU, SDL, lua5, zlib, bam, freetype
|
2016-09-03 18:41:13 +02:00
|
|
|
}:
|
2009-01-13 20:44:11 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-12-08 01:46:54 +01:00
|
|
|
name = "teeworlds-0.6.4";
|
2009-01-13 20:44:11 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-12-08 01:46:54 +01:00
|
|
|
url = "https://downloads.teeworlds.com/teeworlds-0.6.4-src.tar.gz";
|
|
|
|
sha256 = "1qlqzp4wqh1vnip081lbsjnx5jj5m5y4msrcm8glbd80pfgd2qf2";
|
2009-01-13 20:44:11 +01:00
|
|
|
};
|
|
|
|
|
2016-09-03 15:01:51 +02:00
|
|
|
# we always want to use system libs instead of these
|
|
|
|
postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}";
|
2009-01-13 20:44:11 +01:00
|
|
|
|
2016-09-03 18:41:13 +02:00
|
|
|
buildInputs = [
|
2018-02-24 13:59:47 +01:00
|
|
|
python makeWrapper alsaLib libX11 libGLU SDL lua5 zlib bam freetype
|
2016-09-03 18:41:13 +02:00
|
|
|
];
|
2016-09-03 15:01:51 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
bam -a -v release
|
2009-01-13 20:44:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2009-01-13 21:36:09 +01:00
|
|
|
# Copy the graphics, sounds, etc.
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/share/${name}"
|
2009-01-13 21:36:09 +01:00
|
|
|
cp -rv data other/icons "$out/share/${name}"
|
2009-01-13 20:44:11 +01:00
|
|
|
|
2009-01-13 21:36:09 +01:00
|
|
|
# Copy the executables (client, server, etc.).
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/bin"
|
2009-01-13 21:36:09 +01: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 20:44:11 +01:00
|
|
|
|
2009-01-13 21:36:09 +01: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
|
2016-09-03 18:41:13 +02:00
|
|
|
wrapProgram $out/bin/$program \
|
|
|
|
--run "cd $out/share/${name}"
|
2009-01-13 21:36:09 +01:00
|
|
|
done
|
2009-01-13 20:44:11 +01:00
|
|
|
|
2009-01-13 21:36:09 +01:00
|
|
|
# Copy the documentation.
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/doc/${name}"
|
2009-01-13 20:44:11 +01:00
|
|
|
cp -v *.txt "$out/doc/${name}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Retro multiplayer shooter game";
|
2009-01-13 20:44:11 +01: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!
|
|
|
|
'';
|
|
|
|
|
2018-01-05 20:42:46 +01:00
|
|
|
homepage = https://teeworlds.com/;
|
2009-01-13 20:44:11 +01:00
|
|
|
license = "BSD-style, see `license.txt'";
|
2011-11-06 11:11:31 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ astsmtl ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
2009-01-13 20:44:11 +01:00
|
|
|
};
|
|
|
|
}
|