depot/pkgs/games/cataclysm-dda/builder.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

49 lines
939 B
Nix

{ stdenvNoCC, lib, type }:
assert lib.elem type [
"mod"
"soundpack"
"tileset"
];
{ modName, version, src, ... } @ args:
stdenvNoCC.mkDerivation (args // rec {
pname = args.pname or "cataclysm-dda-${type}-${modName}";
modRoot = args.modRoot or ".";
configurePhase = args.configurePhase or ''
runHook preConfigure
runHook postConfigure
'';
buildPhase = args.buildPhase or ''
runHook preBuild
runHook postBuild
'';
checkPhase = args.checkPhase or ''
runHook preCheck
runHook postCheck
'';
installPhase = let
baseDir = {
mod = "mods";
soundpack = "sound";
tileset = "gfx";
}.${type};
in args.installPhase or ''
runHook preInstall
destdir="$out/share/cataclysm-dda/${baseDir}"
mkdir -p "$destdir"
cp -R "${modRoot}" "$destdir/${modName}"
runHook postInstall
'';
passthru = {
forTiles = true;
forCurses = type == "mod";
};
})