dwarf-fortress-packages.soundSense: init 2016-1_196

This commit is contained in:
Herwig Hochleitner 2017-06-19 02:48:02 +02:00
parent d6ee81e912
commit 24ea093806
4 changed files with 57 additions and 1 deletions

View file

@ -11,6 +11,8 @@ let
inherit (pkgs.perlPackages) XMLLibXML XMLLibXSLT;
};
soundSense = callPackage ./soundsense.nix { };
dwarf-fortress-unfuck = callPackage ./unfuck.nix { };
dwarf-fortress = callPackage ./wrapper {

View file

@ -0,0 +1,35 @@
{ stdenv, fetchzip, dos2unix
, soundPack ? stdenv.mkDerivation {
name = "soundsense-soundpack";
src = fetchzip {
url = "http://df.zweistein.cz/soundsense/soundpack.zip";
sha256 = "0qz0mjkp7wp0gxk3ws2x760awv8c9lkacj2fn9bz3gqqnq262ffa";
};
installPhase = ''
cp -r . $out
'';
}}:
stdenv.mkDerivation rec {
version = "2016-1_196";
dfVersion = "0.43.05";
inherit soundPack;
name = "soundsense-${version}";
src = fetchzip {
url = "http://df.zweistein.cz/soundsense/soundSense_${version}.zip";
sha256 = "1gkrs69l3xsh858yjp204ddp29m668j630akm7arssc9359wxqkk";
};
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
nativeBuildInputs = [ dos2unix ];
buildPhase = ''
dos2unix soundSense.sh
chmod +x soundSense.sh
'';
installPhase = ''
mkdir $out
cp -R . $out/soundsense
ln -s $out/soundsense/dfhack $out/hack
ln -s $soundPack $out/soundsense/packs
'';
passthru = { inherit version dfVersion; };
}

View file

@ -1,5 +1,6 @@
{ stdenv, lib, buildEnv, dwarf-fortress-original, substituteAll
, enableDFHack ? false, dfhack
, enableSoundSense ? false, soundSense, jdk
, themes ? {}
, theme ? null
}:
@ -13,13 +14,14 @@ 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 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 ''
@ -44,6 +46,7 @@ stdenv.mkDerivation rec {
runDF = ./dwarf-fortress.in;
runDFHack = ./dfhack.in;
runSoundSense = ./soundSense.in;
buildCommand = ''
mkdir -p $out/bin
@ -57,6 +60,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;

View file

@ -0,0 +1,10 @@
#!@stdenv_shell@ -e
source @dfInit@
for p in soundsense/*; do
update_path "$p"
done
cd "$DF_DIR"
PATH=@jre@/bin exec $DF_DIR/soundsense/soundSense.sh