2018-11-22 08:43:56 +01:00
|
|
|
{ fetchurl, makeWrapper, patchelf, pkgs, stdenv, SDL, libglvnd, libogg, libvorbis, curl, openal }:
|
2014-12-24 20:20:16 +01:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "openarena";
|
2014-12-24 20:20:16 +01:00
|
|
|
version = "0.8.8";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "openarena.zip";
|
|
|
|
url = "http://openarena.ws/request.php?4";
|
|
|
|
sha256 = "0jmc1cmdz1rcvqc9ilzib1kilpwap6v0d331l6q53wsibdzsz3ss";
|
|
|
|
};
|
|
|
|
|
2018-09-27 23:38:10 +02:00
|
|
|
nativeBuildInputs = [ pkgs.unzip patchelf makeWrapper];
|
2014-12-24 20:20:16 +01:00
|
|
|
|
|
|
|
installPhase = let
|
|
|
|
gameDir = "$out/openarena-$version";
|
2015-01-03 18:24:16 +01:00
|
|
|
interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
|
2018-11-22 08:43:56 +01:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ SDL libglvnd libogg libvorbis curl openal ];
|
2014-12-24 20:20:16 +01:00
|
|
|
in ''
|
|
|
|
mkdir -pv $out/bin
|
|
|
|
cd $out
|
|
|
|
unzip $src
|
|
|
|
|
2018-08-20 21:11:29 +02:00
|
|
|
${if stdenv.hostPlatform.system == "x86_64-linux" then ''
|
2015-01-03 18:24:16 +01:00
|
|
|
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.x86_64"
|
2014-12-24 20:20:16 +01:00
|
|
|
makeWrapper "${gameDir}/openarena.x86_64" "$out/bin/openarena" \
|
2015-10-06 14:34:09 +02:00
|
|
|
--prefix LD_LIBRARY_PATH : "${libPath}"
|
2019-10-22 01:23:30 +02:00
|
|
|
patchelf --set-interpreter "${interpreter}" "${gameDir}/oa_ded.x86_64"
|
|
|
|
makeWrapper "${gameDir}/oa_ded.x86_64" "$out/bin/openarena-server" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${libPath}"
|
2015-01-03 18:24:16 +01:00
|
|
|
'' else ''
|
|
|
|
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.i386"
|
2014-12-24 20:20:16 +01:00
|
|
|
makeWrapper "${gameDir}/openarena.i386" "$out/bin/openarena" \
|
2015-10-06 14:34:09 +02:00
|
|
|
--prefix LD_LIBRARY_PATH : "${libPath}"
|
2019-10-22 01:23:30 +02:00
|
|
|
patchelf --set-interpreter "${interpreter}" "${gameDir}/oa_ded.i386"
|
|
|
|
makeWrapper "${gameDir}/oa_ded.i386" "$out/bin/openarena-server" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${libPath}"
|
2015-01-03 18:24:16 +01:00
|
|
|
''}
|
2014-12-24 20:20:16 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Crossplatform openarena client";
|
|
|
|
homepage = http://openarena.ws/;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.wyvie ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|