2019-01-02 00:05:51 +00:00
|
|
|
/* The package defintion for an OpenRA engine.
|
|
|
|
It shares code with `mod.nix` by what is defined in `common.nix`.
|
|
|
|
Similar to `mod.nix` it is a generic package definition,
|
|
|
|
in order to make it easy to define multiple variants of the OpenRA engine.
|
|
|
|
For each mod provided by the engine, a wrapper script is created,
|
|
|
|
matching the naming convention used by `mod.nix`.
|
|
|
|
This package could be seen as providing a set of in-tree mods,
|
|
|
|
while the `mod.nix` pacakges provide a single out-of-tree mod.
|
|
|
|
*/
|
2021-01-15 04:31:39 +00:00
|
|
|
{ lib, stdenv
|
2019-01-02 00:05:51 +00:00
|
|
|
, packageAttrs
|
|
|
|
, patchEngine
|
|
|
|
, wrapLaunchGame
|
|
|
|
, engine
|
|
|
|
}:
|
|
|
|
|
2023-06-22 15:09:40 +00:00
|
|
|
stdenv.mkDerivation (lib.recursiveUpdate packageAttrs rec {
|
2023-03-12 18:04:37 +00:00
|
|
|
pname = "openra_2019";
|
2019-01-02 00:05:51 +00:00
|
|
|
version = "${engine.name}-${engine.version}";
|
|
|
|
|
|
|
|
src = engine.src;
|
|
|
|
|
|
|
|
postPatch = patchEngine "." version;
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
2023-06-22 15:09:40 +00:00
|
|
|
make version VERSION=${lib.escapeShellArg version}
|
2019-01-02 00:05:51 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildFlags = [ "DEBUG=false" "default" "man-page" ];
|
|
|
|
|
|
|
|
checkTarget = "nunit test";
|
|
|
|
|
|
|
|
installTargets = [
|
|
|
|
"install"
|
|
|
|
"install-linux-icons"
|
|
|
|
"install-linux-desktop"
|
|
|
|
"install-linux-appdata"
|
|
|
|
"install-linux-mime"
|
|
|
|
"install-man-page"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-06-15 15:01:52 +00:00
|
|
|
${wrapLaunchGame "" "openra"}
|
2019-01-02 00:05:51 +00:00
|
|
|
|
2023-06-22 15:09:40 +00:00
|
|
|
${lib.concatStrings (map (mod: ''
|
2019-01-02 00:05:51 +00:00
|
|
|
makeWrapper $out/bin/openra $out/bin/openra-${mod} --add-flags Game.Mod=${mod}
|
|
|
|
'') engine.mods)}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit (engine) description homepage;
|
|
|
|
};
|
|
|
|
})
|