diff options
Diffstat (limited to 'pkgs/games/dwarf-fortress/wrapper/default.nix')
-rw-r--r-- | pkgs/games/dwarf-fortress/wrapper/default.nix | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/pkgs/games/dwarf-fortress/wrapper/default.nix b/pkgs/games/dwarf-fortress/wrapper/default.nix index 15b51631b33b..05e851db6f85 100644 --- a/pkgs/games/dwarf-fortress/wrapper/default.nix +++ b/pkgs/games/dwarf-fortress/wrapper/default.nix @@ -1,10 +1,16 @@ { stdenv, lib, buildEnv, dwarf-fortress-original, substituteAll , enableDFHack ? false, dfhack +, enableSoundSense ? false, soundSense, jdk +, enableStoneSense ? false , themes ? {} , theme ? null }: let + dfhack_ = dfhack.override { + inherit enableStoneSense; + }; + ptheme = if builtins.isString theme then builtins.getAttr theme themes @@ -12,19 +18,20 @@ let # These are in inverse order for first packages to override the next ones. pkgs = lib.optional (theme != null) ptheme - ++ lib.optional enableDFHack dfhack + ++ lib.optional enableDFHack dfhack_ + ++ lib.optional enableSoundSense soundSense ++ [ dwarf-fortress-original ]; env = buildEnv { name = "dwarf-fortress-env-${dwarf-fortress-original.dfVersion}"; paths = pkgs; - pathsToLink = [ "/" "/hack" ]; + pathsToLink = [ "/" "/hack" "/hack/scripts" ]; ignoreCollisions = true; postBuild = lib.optionalString enableDFHack '' rm $out/hack/symbols.xml - substitute ${dfhack}/hack/symbols.xml $out/hack/symbols.xml \ + substitute ${dfhack_}/hack/symbols.xml $out/hack/symbols.xml \ --replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \ $(cat ${dwarf-fortress-original}/hash.md5) ''; @@ -44,6 +51,7 @@ stdenv.mkDerivation rec { runDF = ./dwarf-fortress.in; runDFHack = ./dfhack.in; + runSoundSense = ./soundSense.in; buildCommand = '' mkdir -p $out/bin @@ -57,6 +65,12 @@ stdenv.mkDerivation rec { --subst-var-by stdenv_shell ${stdenv.shell} \ --subst-var dfInit chmod 755 $out/bin/dfhack + '' + lib.optionalString enableSoundSense '' + substitute $runSoundSense $out/bin/soundsense \ + --subst-var-by stdenv_shell ${stdenv.shell} \ + --subst-var-by jre ${jdk.jre} \ + --subst-var dfInit + chmod 755 $out/bin/soundsense ''; preferLocalBuild = true; |