nixpkgs/pkgs/games/openra_2019/engine.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

69 lines
1.5 KiB
Nix

/*
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.
*/
{
lib,
stdenv,
packageAttrs,
patchEngine,
wrapLaunchGame,
engine,
}:
stdenv.mkDerivation (
lib.recursiveUpdate packageAttrs rec {
pname = "openra_2019";
version = "${engine.name}-${engine.version}";
src = engine.src;
postPatch = patchEngine "." version;
configurePhase = ''
runHook preConfigure
make version VERSION=${lib.escapeShellArg version}
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 = ''
${wrapLaunchGame "" "openra"}
${lib.concatStrings (
map (mod: ''
makeWrapper $out/bin/openra $out/bin/openra-${mod} --add-flags Game.Mod=${mod}
'') engine.mods
)}
'';
meta = {
inherit (engine) description homepage;
};
}
)