cataclysmDDA: add very basic framework for packaging mods

Add new namespace 'cataclysmDDA', in which package builders, games, and
mods are listed.
This commit is contained in:
Mitsuhiro Nakamura
2020-07-18 14:23:19 +09:00
parent bf71f12cb5
commit ac8555486f
9 changed files with 234 additions and 55 deletions
+32
View File
@@ -0,0 +1,32 @@
{ lib, symlinkJoin, makeWrapper }:
unwrapped:
pkgsSpec:
let
mods = if lib.isFunction pkgsSpec
then pkgsSpec unwrapped.pkgs
else pkgsSpec;
in
if builtins.length mods == 0
then unwrapped
else symlinkJoin {
name = unwrapped.name + "-with-mods";
paths = [ unwrapped ] ++ mods;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
if [ -x $out/bin/cataclysm ]; then
wrapProgram $out/bin/cataclysm \
--add-flags "--datadir $out/share/cataclysm-dda/"
fi
if [ -x $out/bin/cataclysm-tiles ]; then
wrapProgram $out/bin/cataclysm-tiles \
--add-flags "--datadir $out/share/cataclysm-dda/"
fi
'';
}