1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-18 10:56:53 +00:00
nixpkgs/pkgs/games/openarena/default.nix

43 lines
1.3 KiB
Nix
Raw Normal View History

{ fetchurl, makeWrapper, patchelf, pkgs, stdenv, SDL, libogg, libvorbis, curl }:
2014-12-24 19:20:16 +00:00
stdenv.mkDerivation rec {
name = "openarena-${version}";
version = "0.8.8";
src = fetchurl {
name = "openarena.zip";
url = "http://openarena.ws/request.php?4";
sha256 = "0jmc1cmdz1rcvqc9ilzib1kilpwap6v0d331l6q53wsibdzsz3ss";
};
nativeBuildInputs = [ pkgs.unzip patchelf makeWrapper];
2014-12-24 19:20:16 +00:00
installPhase = let
gameDir = "$out/openarena-$version";
interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
libPath = stdenv.lib.makeLibraryPath [ SDL libogg libvorbis curl ];
2014-12-24 19:20:16 +00:00
in ''
mkdir -pv $out/bin
cd $out
unzip $src
${if stdenv.hostPlatform.system == "x86_64-linux" then ''
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.x86_64"
2014-12-24 19:20:16 +00:00
makeWrapper "${gameDir}/openarena.x86_64" "$out/bin/openarena" \
--prefix LD_LIBRARY_PATH : "${libPath}"
'' else ''
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.i386"
2014-12-24 19:20:16 +00:00
makeWrapper "${gameDir}/openarena.i386" "$out/bin/openarena" \
--prefix LD_LIBRARY_PATH : "${libPath}"
''}
2014-12-24 19:20:16 +00: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;
};
}