warsow: 1.03 -> 2.1.2
Fix build, split into engine and game to build engine on Hydra.
This commit is contained in:
parent
2dfbef2764
commit
5ed883a40b
3 changed files with 74 additions and 47 deletions
|
@ -1,52 +1,27 @@
|
||||||
{ stdenv, fetchurl, unzip, pkgconfig, zlib, curl, libjpeg, libpng, libvorbis
|
{ stdenv, fetchurl, warsow-engine, makeWrapper }:
|
||||||
, libtheora, libXxf86dga, libXxf86vm, libXinerama, SDL, libGLU_combined, openal, freetype
|
|
||||||
, makeWrapper
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "warsow-${version}";
|
name = "warsow-${version}";
|
||||||
version = "1.03";
|
version = "2.1.2";
|
||||||
mversion = "1.02"; # sometimes only engine is updated
|
|
||||||
src1 = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://www.warsow.net:1337/~warsow/${version}/warsow_${version}_sdk.tar.gz";
|
url = "http://sebastian.network/warsow/${name}.tar.gz";
|
||||||
sha256 = "0z6r5v30p8fxbszmkxssv5fnnjw7w5wfn7wfgbwvmy87ayi7mkcq";
|
sha256 = "07y2airw5qg3s1bf1c63a6snjj22riz0mqhk62jmfm9nrarhavrc";
|
||||||
};
|
};
|
||||||
src2 = fetchurl {
|
|
||||||
url = "http://www.warsow.net:1337/~warsow/${mversion}/warsow_${mversion}.tar.gz";
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
sha256 = "0ai5v1h5g9nq21ixz23v0qsj9dr7dbiz7l8r34mq4c3z6ili8zpy";
|
|
||||||
};
|
|
||||||
unpackPhase = ''
|
|
||||||
tar xf "$src1"
|
|
||||||
cd warsow_${version}_sdk
|
|
||||||
tar xf "$src2"
|
|
||||||
mkdir -p source/release/
|
|
||||||
mv warsow_${mversion}/basewsw source/release/
|
|
||||||
cd source
|
|
||||||
'';
|
|
||||||
patchPhase = ''
|
|
||||||
substituteInPlace snd_openal/snd_main.c --replace libopenal.so.1 ${openal}/lib/libopenal.so.1
|
|
||||||
'';
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
|
||||||
buildInputs = [ unzip zlib curl libjpeg libpng libvorbis libtheora
|
|
||||||
libXxf86dga libXxf86vm libXinerama SDL libGLU_combined openal makeWrapper
|
|
||||||
];
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
dest=$out/opt/warsow
|
mkdir -p $out/share/warsow
|
||||||
cd release
|
cp -r basewsw $out/share/warsow
|
||||||
mkdir -p $dest
|
ln -s ${warsow-engine}/lib/warsow $out/share/warsow/libs
|
||||||
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp -v {warsow,wsw_server,wswtv_server}* $dest
|
for i in ${warsow-engine}/bin/*; do
|
||||||
cp -rv basewsw libs $dest
|
makeWrapper "$i" "$out/bin/$(basename "$i")" --run "cd $out/share/warsow"
|
||||||
# Since 1.03 some modules are _always_ downloaded from server, thus
|
done
|
||||||
makeWrapper $dest/warsow $out/bin/warsow \
|
|
||||||
--suffix-each LD_LIBRARY_PATH ':' "${freetype.out}/lib"
|
|
||||||
makeWrapper $dest/wsw_server $out/bin/wsw_server
|
|
||||||
makeWrapper $dest/wswtv_server $out/bin/wswtv_server
|
|
||||||
'';
|
|
||||||
postFixup = ''
|
|
||||||
p=$out/opt/warsow/warsow.*
|
|
||||||
cur_rpath=$(patchelf --print-rpath $p)
|
|
||||||
patchelf --set-rpath $cur_rpath:${libGLU_combined}/lib $p
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Multiplayer FPS game designed for competitive gaming";
|
description = "Multiplayer FPS game designed for competitive gaming";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
|
@ -56,10 +31,8 @@ stdenv.mkDerivation rec {
|
||||||
and macOS.
|
and macOS.
|
||||||
'';
|
'';
|
||||||
homepage = http://www.warsow.net;
|
homepage = http://www.warsow.net;
|
||||||
# Engine is under GPLv2, everything else is under
|
|
||||||
license = licenses.unfreeRedistributable;
|
license = licenses.unfreeRedistributable;
|
||||||
maintainers = with maintainers; [ astsmtl ];
|
maintainers = with maintainers; [ astsmtl abbradar ];
|
||||||
platforms = platforms.linux;
|
platforms = warsow-engine.meta.platforms;
|
||||||
broken = true; # Depends on a specific old libjpeg version
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
52
pkgs/games/warsow/engine.nix
Normal file
52
pkgs/games/warsow/engine.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ stdenv, lib, fetchurl, cmake, libogg, libvorbis, libtheora, curl, freetype
|
||||||
|
, libjpeg, libpng, SDL2, libGL, openal, zlib
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
# The game loads all those via dlopen().
|
||||||
|
libs = lib.mapAttrs (name: x: lib.getLib x) {
|
||||||
|
inherit zlib curl libpng libjpeg libogg libvorbis libtheora freetype;
|
||||||
|
};
|
||||||
|
|
||||||
|
in stdenv.mkDerivation (libs // rec {
|
||||||
|
name = "warsow-engine-${version}";
|
||||||
|
version = "2.1.0";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "http://sebastian.network/warsow/warsow_21_sdk.tar.gz";
|
||||||
|
sha256 = "0fj5k7qpf6far8i1xhqxlpfjch10zj26xpilhp95aq2yiz08pj4r";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
libogg libvorbis libtheora curl freetype libjpeg SDL2 libGL openal zlib
|
||||||
|
libpng
|
||||||
|
];
|
||||||
|
|
||||||
|
patches = [ ./libpath.patch ];
|
||||||
|
postPatch = ''
|
||||||
|
cd source/source
|
||||||
|
substituteAllInPlace gameshared/q_arch.h
|
||||||
|
'';
|
||||||
|
|
||||||
|
cmakeFlags = [ "-DQFUSION_GAME=Warsow" ];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/lib
|
||||||
|
cp -r libs $out/lib/warsow
|
||||||
|
for i in warsow.* wsw_server.* wswtv_server.*; do
|
||||||
|
install -Dm755 "$i" "$out/bin/''${i%.*}"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Multiplayer FPS game designed for competitive gaming (engine only)";
|
||||||
|
homepage = http://www.warsow.net;
|
||||||
|
license = licenses.gpl2;
|
||||||
|
maintainers = with maintainers; [ astsmtl abbradar ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
})
|
|
@ -19259,6 +19259,8 @@ with pkgs;
|
||||||
|
|
||||||
warmux = callPackage ../games/warmux { };
|
warmux = callPackage ../games/warmux { };
|
||||||
|
|
||||||
|
warsow-engine = callPackage ../games/warsow/engine.nix { };
|
||||||
|
|
||||||
warsow = callPackage ../games/warsow { };
|
warsow = callPackage ../games/warsow { };
|
||||||
|
|
||||||
warzone2100 = libsForQt5.callPackage ../games/warzone2100 { };
|
warzone2100 = libsForQt5.callPackage ../games/warzone2100 { };
|
||||||
|
|
Loading…
Reference in a new issue