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