2017-10-19 21:18:47 +01:00
|
|
|
{ stdenv, fetchFromGitHub, mono, makeWrapper, lua
|
2016-04-11 03:46:40 +01:00
|
|
|
, SDL2, freetype, openal, systemd, pkgconfig,
|
2017-11-06 17:18:19 +00:00
|
|
|
dotnetPackages, gnome3, curl, unzip, which, python
|
2014-04-06 16:01:34 +01:00
|
|
|
}:
|
|
|
|
|
2017-10-19 21:18:47 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-04-06 16:01:34 +01:00
|
|
|
name = "openra-${version}";
|
2018-10-10 18:01:29 +01:00
|
|
|
version = "20180923";
|
2014-04-06 16:01:34 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2016-05-16 20:15:29 +01:00
|
|
|
description = "Real Time Strategy game engine recreating the C&C titles";
|
|
|
|
homepage = "http://www.openra.net/";
|
2016-05-01 02:35:39 +01:00
|
|
|
maintainers = [ maintainers.rardiol ];
|
2014-04-06 16:01:34 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
|
2017-10-19 21:18:47 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenRA";
|
|
|
|
repo = "OpenRA";
|
|
|
|
rev = "release-${version}";
|
2018-10-10 18:01:29 +01:00
|
|
|
sha256 = "1pgi3zaq9fwwdq6yh19bwxscslqgabjxkvl9bcn1a5agy4bfbqk5";
|
2017-10-19 21:18:47 +01:00
|
|
|
|
|
|
|
extraPostFetch = ''
|
|
|
|
sed -i 's,curl,curl --insecure,g' $out/thirdparty/{fetch-thirdparty-deps,noget}.sh
|
|
|
|
$out/thirdparty/fetch-thirdparty-deps.sh
|
|
|
|
'';
|
2014-04-06 16:01:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2017-10-19 21:18:47 +01:00
|
|
|
buildInputs = (with dotnetPackages;
|
|
|
|
[ NUnit3 NewtonsoftJson MonoNat FuzzyLogicLibrary SmartIrc4net SharpZipLib MaxMindGeoIP2 MaxMindDb SharpFont StyleCopMSBuild StyleCopPlusMSBuild RestSharp NUnitConsole OpenNAT ])
|
2016-10-29 06:33:34 +01:00
|
|
|
++ [ curl unzip lua gnome3.zenity ];
|
|
|
|
nativeBuildInputs = [ curl unzip mono makeWrapper lua pkgconfig ];
|
2014-04-06 16:01:34 +01:00
|
|
|
|
2017-10-19 21:18:47 +01:00
|
|
|
postPatch = ''
|
2016-05-08 22:41:05 +01:00
|
|
|
mkdir Support
|
2017-10-19 21:18:47 +01:00
|
|
|
sed -i \
|
|
|
|
-e 's/^VERSION.*/VERSION = release-${version}/g' \
|
|
|
|
-e '/GeoLite2-Country.mmdb.gz/d' \
|
|
|
|
-e '/fetch-geoip-db.sh/d' \
|
|
|
|
Makefile
|
2016-04-11 03:46:40 +01:00
|
|
|
substituteInPlace thirdparty/configure-native-deps.sh --replace "locations=\"" "locations=\"${lua}/lib "
|
2014-04-06 16:01:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags="prefix=$out"
|
|
|
|
make version
|
|
|
|
'';
|
|
|
|
|
2016-05-08 22:41:05 +01:00
|
|
|
buildFlags = [ "DEBUG=false" "default" "man-page" ];
|
2016-04-11 03:46:40 +01:00
|
|
|
|
2016-05-08 22:41:16 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
#TODO: check
|
|
|
|
checkTarget = "nunit test";
|
|
|
|
|
2016-05-08 22:41:05 +01:00
|
|
|
installTargets = [ "install" "install-linux-icons" "install-linux-desktop" "install-linux-appdata" "install-linux-mime" "install-man-page" ];
|
2016-04-11 03:46:40 +01:00
|
|
|
|
2014-04-06 16:01:34 +01:00
|
|
|
postInstall = with stdenv.lib; let
|
2014-07-24 14:53:34 +01:00
|
|
|
runtime = makeLibraryPath [ SDL2 freetype openal systemd lua ];
|
2017-11-06 17:18:19 +00:00
|
|
|
binaries= makeBinPath [ which mono gnome3.zenity python ];
|
2014-04-06 16:01:34 +01:00
|
|
|
in ''
|
2014-07-24 14:53:34 +01:00
|
|
|
wrapProgram $out/lib/openra/launch-game.sh \
|
2017-10-19 21:18:47 +01:00
|
|
|
--prefix PATH : "${binaries}" \
|
2018-10-10 18:01:29 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${runtime}" \
|
|
|
|
--set TERM "xterm"
|
2016-04-11 03:46:40 +01:00
|
|
|
|
2014-07-24 14:53:34 +01:00
|
|
|
mkdir -p $out/bin
|
2017-10-19 21:18:47 +01:00
|
|
|
makeWrapper $out/lib/openra/launch-game.sh $out/bin/openra --run "cd $out/lib/openra"
|
2018-12-02 19:05:10 +00:00
|
|
|
printf "#!/bin/sh\nexec $out/bin/openra Game.Mod=ra" > $out/bin/openra-ra
|
|
|
|
chmod +x $out/bin/openra-ra
|
|
|
|
printf "#!/bin/sh\nexec $out/bin/openra Game.Mod=cnc" > $out/bin/openra-cnc
|
|
|
|
chmod +x $out/bin/openra-cnc
|
|
|
|
printf "#!/bin/sh\nexec $out/bin/openra Game.Mod=d2k" > $out/bin/openra-d2k
|
|
|
|
chmod +x $out/bin/openra-d2k
|
2014-04-06 16:01:34 +01:00
|
|
|
'';
|
|
|
|
}
|