nixpkgs/pkgs/games/openra/default.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

2014-07-24 13:53:34 +00:00
{ stdenv, fetchurl, mono, makeWrapper, lua
, SDL2, freetype, openal, systemd, pkgconfig
}:
let
2014-11-15 12:03:53 +00:00
version = "20141029";
in stdenv.mkDerivation rec {
name = "openra-${version}";
meta = with stdenv.lib; {
description = "Real Time Strategy game engine recreates the C&C titles";
homepage = "http://www.open-ra.org/";
license = licenses.gpl3;
platforms = platforms.linux;
};
src = fetchurl {
name = "${name}.tar.gz";
url = "https://github.com/OpenRA/OpenRA/archive/release-${version}.tar.gz";
2014-11-15 12:03:53 +00:00
sha256 = "082rwcy866k636s4qhbry3ja2p81mdz58bh1dw2mic5mv2q6p67r";
};
dontStrip = true;
2014-07-24 13:53:34 +00:00
buildInputs = [ lua ];
nativeBuildInputs = [ mono makeWrapper lua pkgconfig ];
patchPhase = ''
sed -i 's/^VERSION.*/VERSION = release-${version}/g' Makefile
2014-07-24 13:53:34 +00:00
substituteInPlace configure --replace /bin/bash "$shell" --replace /usr/local/lib "${lua}/lib"
'';
preConfigure = ''
makeFlags="prefix=$out"
make version
'';
postInstall = with stdenv.lib; let
2014-07-24 13:53:34 +00:00
runtime = makeLibraryPath [ SDL2 freetype openal systemd lua ];
in ''
2014-07-24 13:53:34 +00:00
wrapProgram $out/lib/openra/launch-game.sh \
--prefix PATH : "${mono}/bin" \
2014-07-24 13:53:34 +00:00
--set PWD $out/lib/openra/ \
--prefix LD_LIBRARY_PATH : "${runtime}"
2014-07-24 13:53:34 +00:00
mkdir -p $out/bin
echo "cd $out/lib/openra && $out/lib/openra/launch-game.sh" > $out/bin/openra
chmod +x $out/bin/openra
'';
}