2012-09-23 23:27:34 +01:00
|
|
|
{ stdenv, fetchurl, unzip, pkgconfig, zlib, curl, libjpeg, libpng, libvorbis
|
2013-02-11 20:59:26 +00:00
|
|
|
, libtheora, libXxf86dga, libXxf86vm, libXinerama, SDL, mesa, openal, freetype
|
|
|
|
, makeWrapper
|
2010-01-27 22:22:35 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "warsow-${version}";
|
2013-02-06 23:37:50 +00:00
|
|
|
version = "1.03";
|
2012-11-30 23:27:47 +00:00
|
|
|
mversion = "1.02"; # sometimes only engine is updated
|
2010-01-27 22:22:35 +00:00
|
|
|
src1 = fetchurl {
|
2013-02-06 23:37:50 +00:00
|
|
|
url = "http://www.warsow.net:1337/~warsow/${version}/warsow_${version}_sdk.tar.gz";
|
|
|
|
sha256 = "0z6r5v30p8fxbszmkxssv5fnnjw7w5wfn7wfgbwvmy87ayi7mkcq";
|
2010-01-27 22:22:35 +00:00
|
|
|
};
|
|
|
|
src2 = fetchurl {
|
2013-02-06 23:37:50 +00:00
|
|
|
url = "http://www.warsow.net:1337/~warsow/${mversion}/warsow_${mversion}.tar.gz";
|
2012-11-30 23:27:47 +00:00
|
|
|
sha256 = "0ai5v1h5g9nq21ixz23v0qsj9dr7dbiz7l8r34mq4c3z6ili8zpy";
|
2010-01-27 22:22:35 +00:00
|
|
|
};
|
|
|
|
unpackPhase = ''
|
2012-09-23 23:27:34 +01:00
|
|
|
tar xf "$src1"
|
2010-01-27 22:22:35 +00:00
|
|
|
cd warsow_${version}_sdk
|
2012-09-23 23:27:34 +01:00
|
|
|
tar xf "$src2"
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p source/release/
|
2012-09-23 23:27:34 +01:00
|
|
|
mv warsow_${mversion}/basewsw source/release/
|
2010-01-27 22:22:35 +00:00
|
|
|
cd source
|
|
|
|
'';
|
2011-01-02 23:52:25 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace snd_openal/snd_main.c --replace libopenal.so.1 ${openal}/lib/libopenal.so.1
|
|
|
|
'';
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ unzip zlib curl libjpeg libpng libvorbis libtheora
|
2013-02-11 20:59:26 +00:00
|
|
|
libXxf86dga libXxf86vm libXinerama SDL mesa openal makeWrapper
|
|
|
|
];
|
2010-01-27 22:22:35 +00:00
|
|
|
installPhase = ''
|
|
|
|
dest=$out/opt/warsow
|
|
|
|
cd release
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $dest
|
|
|
|
mkdir -p $out/bin
|
2013-02-11 20:59:26 +00:00
|
|
|
cp -v {warsow,wsw_server,wswtv_server}* $dest
|
2010-01-27 22:22:35 +00:00
|
|
|
cp -rv basewsw libs $dest
|
2013-02-11 20:59:26 +00:00
|
|
|
# Since 1.03 some modules are _always_ downloaded from server, thus
|
|
|
|
makeWrapper $dest/warsow $out/bin/warsow \
|
2016-01-24 07:29:13 +00:00
|
|
|
--suffix-each LD_LIBRARY_PATH ':' "${freetype.out}/lib"
|
2013-02-11 20:59:26 +00:00
|
|
|
makeWrapper $dest/wsw_server $out/bin/wsw_server
|
|
|
|
makeWrapper $dest/wswtv_server $out/bin/wswtv_server
|
2010-01-27 22:22:35 +00:00
|
|
|
'';
|
2010-04-04 00:01:36 +01:00
|
|
|
postFixup = ''
|
|
|
|
p=$out/opt/warsow/warsow.*
|
|
|
|
cur_rpath=$(patchelf --print-rpath $p)
|
|
|
|
patchelf --set-rpath $cur_rpath:${mesa}/lib $p
|
|
|
|
'';
|
2015-05-27 20:56:04 +01:00
|
|
|
meta = with stdenv.lib; {
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Multiplayer FPS game designed for competitive gaming";
|
2010-01-27 22:22:35 +00: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
|
2017-08-06 23:05:18 +01:00
|
|
|
and macOS.
|
2010-01-27 22:22:35 +00:00
|
|
|
'';
|
|
|
|
homepage = http://www.warsow.net;
|
|
|
|
# Engine is under GPLv2, everything else is under
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.unfreeRedistributable;
|
2015-05-27 20:56:04 +01:00
|
|
|
maintainers = with maintainers; [ astsmtl ];
|
2015-11-17 20:29:29 +00:00
|
|
|
platforms = platforms.linux;
|
2017-01-24 16:16:24 +00:00
|
|
|
broken = true; # Depends on a specific old libjpeg version
|
2010-01-27 22:22:35 +00:00
|
|
|
};
|
|
|
|
}
|