2019-01-02 01:05:51 +01:00
|
|
|
/* The reusable code, and package attributes, between OpenRA engine packages (engine.nix)
|
|
|
|
and out-of-tree mod packages (mod.nix).
|
|
|
|
*/
|
2021-01-25 09:26:54 +01:00
|
|
|
{ lib, makeSetupHook, curl, unzip, dos2unix, pkg-config, makeWrapper
|
2019-01-02 01:05:51 +01:00
|
|
|
, lua, mono, dotnetPackages, python
|
2019-05-12 21:10:11 +02:00
|
|
|
, libGL, freetype, openal, SDL2
|
2019-01-02 01:05:51 +01:00
|
|
|
, zenity
|
|
|
|
}:
|
|
|
|
|
2021-01-15 05:31:39 +01:00
|
|
|
with lib;
|
2019-01-02 01:05:51 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
path = makeBinPath ([ mono python ] ++ optional (zenity != null) zenity);
|
2019-05-12 21:10:11 +02:00
|
|
|
rpath = makeLibraryPath [ lua freetype openal SDL2 ];
|
2019-01-02 01:05:51 +01:00
|
|
|
mkdirp = makeSetupHook { } ./mkdirp.sh;
|
|
|
|
|
|
|
|
in {
|
|
|
|
patchEngine = dir: version: ''
|
|
|
|
sed -i \
|
|
|
|
-e 's/^VERSION.*/VERSION = ${version}/g' \
|
|
|
|
-e '/fetch-geoip-db/d' \
|
|
|
|
-e '/GeoLite2-Country.mmdb.gz/d' \
|
|
|
|
${dir}/Makefile
|
|
|
|
|
|
|
|
sed -i 's|locations=.*|locations=${lua}/lib|' ${dir}/thirdparty/configure-native-deps.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
wrapLaunchGame = openraSuffix: ''
|
|
|
|
# Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542
|
|
|
|
# https://github.com/mono/mono/issues/6752#issuecomment-365212655
|
|
|
|
wrapProgram $out/lib/openra${openraSuffix}/launch-game.sh \
|
|
|
|
--prefix PATH : "${path}" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${rpath}" \
|
|
|
|
--set TERM xterm
|
|
|
|
|
|
|
|
makeWrapper $out/lib/openra${openraSuffix}/launch-game.sh $(mkdirp $out/bin)/openra${openraSuffix} \
|
|
|
|
--run "cd $out/lib/openra${openraSuffix}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
packageAttrs = {
|
|
|
|
buildInputs = with dotnetPackages; [
|
|
|
|
FuzzyLogicLibrary
|
|
|
|
MaxMindDb
|
|
|
|
MaxMindGeoIP2
|
|
|
|
MonoNat
|
|
|
|
NewtonsoftJson
|
|
|
|
NUnit3
|
|
|
|
NUnitConsole
|
|
|
|
OpenNAT
|
|
|
|
RestSharp
|
|
|
|
SharpFont
|
|
|
|
SharpZipLib
|
|
|
|
SmartIrc4net
|
|
|
|
StyleCopMSBuild
|
|
|
|
StyleCopPlusMSBuild
|
|
|
|
] ++ [
|
|
|
|
libGL
|
|
|
|
];
|
|
|
|
|
|
|
|
# TODO: Test if this is correct.
|
|
|
|
nativeBuildInputs = [
|
|
|
|
curl
|
|
|
|
unzip
|
|
|
|
dos2unix
|
2021-01-17 06:49:22 +01:00
|
|
|
pkg-config
|
2019-01-02 01:05:51 +01:00
|
|
|
makeWrapper
|
|
|
|
mkdirp
|
|
|
|
mono
|
|
|
|
python
|
|
|
|
];
|
|
|
|
|
2019-10-27 14:03:25 +01:00
|
|
|
makeFlags = [ "prefix=$(out)" ];
|
2019-01-02 01:05:51 +01:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
2019-01-29 01:33:21 +01:00
|
|
|
maintainers = with maintainers; [ fusion809 msteen rardiol ];
|
2019-01-02 01:05:51 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|