2014-07-24 15:53:34 +02:00
|
|
|
{ stdenv, fetchurl, mono, makeWrapper, lua
|
|
|
|
, SDL2, freetype, openal, systemd, pkgconfig
|
2014-04-06 17:01:34 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2014-07-24 15:53:34 +02:00
|
|
|
version = "20140608";
|
2014-04-06 17:01:34 +02:00
|
|
|
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;
|
|
|
|
maintainers = with maintainers; [ iyzsong ];
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "${name}.tar.gz";
|
|
|
|
url = "https://github.com/OpenRA/OpenRA/archive/release-${version}.tar.gz";
|
2014-07-24 15:53:34 +02:00
|
|
|
sha256 = "0k7siysxb2nk7zzrl7vz1cwky4nla46ixzgxgc8rq6ilmlidh96b";
|
2014-04-06 17:01:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2014-07-24 15:53:34 +02:00
|
|
|
buildInputs = [ lua ];
|
|
|
|
nativeBuildInputs = [ mono makeWrapper lua pkgconfig ];
|
2014-04-06 17:01:34 +02:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's/^VERSION.*/VERSION = release-${version}/g' Makefile
|
2014-07-24 15:53:34 +02:00
|
|
|
substituteInPlace configure --replace /bin/bash "$shell" --replace /usr/local/lib "${lua}/lib"
|
2014-04-06 17:01:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags="prefix=$out"
|
|
|
|
make version
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = with stdenv.lib; let
|
2014-07-24 15:53:34 +02:00
|
|
|
runtime = makeLibraryPath [ SDL2 freetype openal systemd lua ];
|
2014-04-06 17:01:34 +02:00
|
|
|
in ''
|
2014-07-24 15:53:34 +02:00
|
|
|
wrapProgram $out/lib/openra/launch-game.sh \
|
2014-04-06 17:01:34 +02:00
|
|
|
--prefix PATH : "${mono}/bin" \
|
2014-07-24 15:53:34 +02:00
|
|
|
--set PWD $out/lib/openra/ \
|
2014-04-06 17:01:34 +02:00
|
|
|
--prefix LD_LIBRARY_PATH : "${runtime}"
|
2014-07-24 15:53:34 +02:00
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
echo "cd $out/lib/openra && $out/lib/openra/launch-game.sh" > $out/bin/openra
|
|
|
|
chmod +x $out/bin/openra
|
2014-04-06 17:01:34 +02:00
|
|
|
'';
|
|
|
|
}
|