2014-07-24 15:53:34 +02:00
|
|
|
{ stdenv, fetchurl, mono, makeWrapper, lua
|
2016-04-11 04:46:40 +02:00
|
|
|
, SDL2, freetype, openal, systemd, pkgconfig,
|
|
|
|
dotnetPackages, gnome3
|
2014-04-06 17:01:34 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2016-05-08 21:25:45 +02:00
|
|
|
version = "20160508";
|
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/";
|
2016-05-01 03:35:39 +02:00
|
|
|
maintainers = [ maintainers.rardiol ];
|
2014-04-06 17:01:34 +02:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "${name}.tar.gz";
|
|
|
|
url = "https://github.com/OpenRA/OpenRA/archive/release-${version}.tar.gz";
|
2016-05-08 21:25:45 +02:00
|
|
|
sha256 = "1vr5bvdkh0n5569ga2h7ggj43vnzr37hfqkfnsis1sg4vgwrnzr7";
|
2014-04-06 17:01:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2016-04-11 04:46:40 +02:00
|
|
|
buildInputs = with dotnetPackages;
|
2016-05-08 21:25:45 +02:00
|
|
|
[ NUnit3 NewtonsoftJson MonoNat FuzzyLogicLibrary SmartIrc4net SharpZipLib MaxMindGeoIP2 MaxMindDb SharpFont StyleCopMSBuild StyleCopPlusMSBuild RestSharp NUnitConsole ]
|
2016-04-11 04:46:40 +02:00
|
|
|
++ [ lua gnome3.zenity ];
|
2014-07-24 15:53:34 +02:00
|
|
|
nativeBuildInputs = [ mono makeWrapper lua pkgconfig ];
|
2014-04-06 17:01:34 +02:00
|
|
|
|
|
|
|
patchPhase = ''
|
2016-05-08 23:41:05 +02:00
|
|
|
mkdir Support
|
2014-04-06 17:01:34 +02:00
|
|
|
sed -i 's/^VERSION.*/VERSION = release-${version}/g' Makefile
|
2016-04-11 04:46:40 +02:00
|
|
|
substituteInPlace thirdparty/configure-native-deps.sh --replace "locations=\"" "locations=\"${lua}/lib "
|
|
|
|
substituteInPlace Makefile --replace "@./thirdparty/fetch-geoip-db.sh" ""
|
2014-04-06 17:01:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags="prefix=$out"
|
|
|
|
make version
|
|
|
|
'';
|
|
|
|
|
2016-04-11 04:46:40 +02:00
|
|
|
preBuild = let dotnetPackagesDlls = with dotnetPackages; [
|
|
|
|
"${MonoNat}/lib/dotnet/Mono.Nat/net40/Mono.Nat.dll"
|
|
|
|
"${FuzzyLogicLibrary}/lib/dotnet/FuzzyLogicLibrary/Release/FuzzyLogicLibrary.dll"
|
|
|
|
"${SmartIrc4net}/lib/dotnet/SmartIrc4net/net40/SmarIrc4net*"
|
|
|
|
"${SharpZipLib}/lib/dotnet/SharpZipLib/20/ICSharpCode.SharpZipLib.dll"
|
|
|
|
"${MaxMindGeoIP2}/lib/dotnet/MaxMind.GeoIP2/net40/MaxMind.GeoIP2*"
|
|
|
|
"${MaxMindDb}/lib/dotnet/MaxMind.Db/net40/MaxMind.Db.*"
|
|
|
|
"${SharpFont}/lib/dotnet/SharpFont/net20/SharpFont.dll"
|
|
|
|
"${SharpFont}/lib/dotnet/SharpFont/SharpFont.dll.config"
|
|
|
|
"${StyleCopMSBuild}/lib/dotnet/StyleCop.MSBuild/StyleCop*.dll"
|
|
|
|
"${StyleCopPlusMSBuild}/lib/dotnet/StyleCopPlus.MSBuild/StyleCopPlus.dll"
|
|
|
|
"${RestSharp}/lib/dotnet/RestSharp/net4-client/RestSharp.dll"
|
|
|
|
"${NUnit}/lib/dotnet/NUnit/nunit.framework.*"
|
2016-05-08 21:25:45 +02:00
|
|
|
"${NUnitConsole}/lib/dotnet/NUnit.Console/*"
|
2016-04-11 04:46:40 +02:00
|
|
|
"${NewtonsoftJson}/lib/dotnet/Newtonsoft.Json/Newtonsoft.Json.dll"
|
|
|
|
];
|
|
|
|
movePackages = [
|
|
|
|
( let filename = "Eluant.dll"; in { origin = fetchurl {
|
2016-05-08 21:25:45 +02:00
|
|
|
url = "https://github.com/OpenRA/Eluant/releases/download/20160124/${filename}";
|
2016-04-11 04:46:40 +02:00
|
|
|
sha256 = "1c20whz7dzfhg3szd62rvb79745x5iwrd5pp62j3bbj1q9wpddmb";
|
|
|
|
}; target = filename; })
|
|
|
|
|
|
|
|
( let filename = "SDL2-CS.dll"; in { origin = fetchurl {
|
2016-05-08 21:25:45 +02:00
|
|
|
url = "https://github.com/OpenRA/SDL2-CS/releases/download/20151227/${filename}";
|
|
|
|
sha256 = "0gqw2wg37cqhhlc2a9lfc4ndkyfi4m8bkv7ckxbawgydjlknq83n";
|
|
|
|
}; target = filename; })
|
|
|
|
|
|
|
|
( let filename = "SDL2-CS.dll.config"; in { origin = fetchurl {
|
|
|
|
url = "https://github.com/OpenRA/SDL2-CS/releases/download/20151227/${filename}";
|
|
|
|
sha256 = "15709iscdg44wd33szw5y0fdxwvqfjw8v3xjq6a0mm46gr7mkw7g";
|
|
|
|
}; target = filename; })
|
|
|
|
|
|
|
|
( let filename = "OpenAL-CS.dll"; in { origin = fetchurl {
|
|
|
|
url = "https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/${filename}";
|
|
|
|
sha256 = "0lvyjkn7fqys97wym8rwlcp6ay2z059iabfvlcxhlrscjpyr2cyk";
|
|
|
|
}; target = filename; })
|
|
|
|
|
|
|
|
( let filename = "OpenAL-CS.dll.config"; in { origin = fetchurl {
|
|
|
|
url = "https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/${filename}";
|
|
|
|
sha256 = "0wcmk3dw26s93598ck5jism5609v0y233i0f1b76yilyfimg9sjq";
|
2016-04-11 04:46:40 +02:00
|
|
|
}; target = filename; })
|
|
|
|
|
|
|
|
( let filename = "GeoLite2-Country.mmdb.gz"; in { origin = fetchurl {
|
|
|
|
url = "http://geolite.maxmind.com/download/geoip/database/${filename}";
|
2016-05-08 21:25:45 +02:00
|
|
|
sha256 = "0a82v0sj4zf5vigrn1pd6mnbqz6zl3rgk9nidqqzy836as2kxk9v";
|
2016-04-11 04:46:40 +02:00
|
|
|
}; target = filename; })
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
mkdir thirdparty/download/
|
|
|
|
|
2016-05-08 21:25:45 +02:00
|
|
|
${stdenv.lib.concatMapStringsSep "\n" (from: "cp -r ${from} thirdparty/download") dotnetPackagesDlls}
|
2016-04-11 04:46:40 +02:00
|
|
|
${stdenv.lib.concatMapStringsSep "\n" ({origin, target}: "cp ${origin} thirdparty/download/${target}") movePackages}
|
|
|
|
|
|
|
|
make dependencies
|
|
|
|
'';
|
|
|
|
|
2016-05-08 23:41:05 +02:00
|
|
|
buildFlags = [ "DEBUG=false" "default" "man-page" ];
|
2016-04-11 04:46:40 +02:00
|
|
|
|
2016-05-08 23:41:05 +02:00
|
|
|
installTargets = [ "install" "install-linux-icons" "install-linux-desktop" "install-linux-appdata" "install-linux-mime" "install-man-page" ];
|
2016-04-11 04:46:40 +02:00
|
|
|
|
2014-04-06 17:01:34 +02:00
|
|
|
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}"
|
2016-04-11 04:46:40 +02:00
|
|
|
|
2014-07-24 15:53:34 +02:00
|
|
|
mkdir -p $out/bin
|
2016-04-11 04:46:40 +02:00
|
|
|
echo -e "#!${stdenv.shell}\ncd $out/lib/openra && $out/lib/openra/launch-game.sh" > $out/bin/openra
|
2014-07-24 15:53:34 +02:00
|
|
|
chmod +x $out/bin/openra
|
2014-04-06 17:01:34 +02:00
|
|
|
'';
|
|
|
|
}
|