2012-09-24 00:27:34 +02:00
|
|
|
{ stdenv, fetchurl, unzip, pkgconfig, zlib, curl, libjpeg, libpng, libvorbis
|
2013-02-11 21:59:26 +01:00
|
|
|
, libtheora, libXxf86dga, libXxf86vm, libXinerama, SDL, mesa, openal, freetype
|
|
|
|
, makeWrapper
|
2010-01-27 23:22:35 +01:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "warsow-${version}";
|
2013-02-07 00:37:50 +01:00
|
|
|
version = "1.03";
|
2012-12-01 00:27:47 +01:00
|
|
|
mversion = "1.02"; # sometimes only engine is updated
|
2010-01-27 23:22:35 +01:00
|
|
|
src1 = fetchurl {
|
2013-02-07 00:37:50 +01:00
|
|
|
url = "http://www.warsow.net:1337/~warsow/${version}/warsow_${version}_sdk.tar.gz";
|
|
|
|
sha256 = "0z6r5v30p8fxbszmkxssv5fnnjw7w5wfn7wfgbwvmy87ayi7mkcq";
|
2010-01-27 23:22:35 +01:00
|
|
|
};
|
|
|
|
src2 = fetchurl {
|
2013-02-07 00:37:50 +01:00
|
|
|
url = "http://www.warsow.net:1337/~warsow/${mversion}/warsow_${mversion}.tar.gz";
|
2012-12-01 00:27:47 +01:00
|
|
|
sha256 = "0ai5v1h5g9nq21ixz23v0qsj9dr7dbiz7l8r34mq4c3z6ili8zpy";
|
2010-01-27 23:22:35 +01:00
|
|
|
};
|
|
|
|
unpackPhase = ''
|
2012-09-24 00:27:34 +02:00
|
|
|
tar xf "$src1"
|
2010-01-27 23:22:35 +01:00
|
|
|
cd warsow_${version}_sdk
|
2012-09-24 00:27:34 +02:00
|
|
|
tar xf "$src2"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p source/release/
|
2012-09-24 00:27:34 +02:00
|
|
|
mv warsow_${mversion}/basewsw source/release/
|
2010-01-27 23:22:35 +01:00
|
|
|
cd source
|
|
|
|
'';
|
2011-01-03 00:52:25 +01:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace snd_openal/snd_main.c --replace libopenal.so.1 ${openal}/lib/libopenal.so.1
|
|
|
|
'';
|
2012-09-24 00:27:34 +02:00
|
|
|
buildInputs = [ unzip pkgconfig zlib curl libjpeg libpng libvorbis libtheora
|
2013-02-11 21:59:26 +01:00
|
|
|
libXxf86dga libXxf86vm libXinerama SDL mesa openal makeWrapper
|
|
|
|
];
|
2010-01-27 23:22:35 +01:00
|
|
|
installPhase = ''
|
|
|
|
dest=$out/opt/warsow
|
|
|
|
cd release
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $dest
|
|
|
|
mkdir -p $out/bin
|
2013-02-11 21:59:26 +01:00
|
|
|
cp -v {warsow,wsw_server,wswtv_server}* $dest
|
2010-01-27 23:22:35 +01:00
|
|
|
cp -rv basewsw libs $dest
|
2013-02-11 21:59:26 +01:00
|
|
|
# Since 1.03 some modules are _always_ downloaded from server, thus
|
|
|
|
makeWrapper $dest/warsow $out/bin/warsow \
|
|
|
|
--suffix-each LD_LIBRARY_PATH ':' "${freetype}/lib"
|
|
|
|
makeWrapper $dest/wsw_server $out/bin/wsw_server
|
|
|
|
makeWrapper $dest/wswtv_server $out/bin/wswtv_server
|
2010-01-27 23:22:35 +01:00
|
|
|
'';
|
2010-04-04 01:01:36 +02:00
|
|
|
postFixup = ''
|
|
|
|
p=$out/opt/warsow/warsow.*
|
|
|
|
cur_rpath=$(patchelf --print-rpath $p)
|
|
|
|
patchelf --set-rpath $cur_rpath:${mesa}/lib $p
|
|
|
|
'';
|
2010-01-27 23:22:35 +01:00
|
|
|
meta = {
|
2013-10-06 11:49:53 +02:00
|
|
|
description = "Multiplayer FPS game designed for competitive gaming";
|
2010-01-27 23:22:35 +01:00
|
|
|
longDescription = ''
|
|
|
|
Set in a futuristic cartoon-like world where rocketlauncher-wielding
|
|
|
|
pigs and lasergun-carrying cyberpunks roam the streets, Warsow is a
|
|
|
|
completely free fast-paced first-person shooter (FPS) for Windows, Linux
|
|
|
|
and Mac OS X.
|
|
|
|
'';
|
|
|
|
homepage = http://www.warsow.net;
|
|
|
|
# Engine is under GPLv2, everything else is under
|
|
|
|
license = [ "unfree-redistributable" ];
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ astsmtl ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|