summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorMoritz Ulrich <moritz@tarn-vedra.de>2013-10-10 01:15:16 +0200
committerMoritz Ulrich <moritz@tarn-vedra.de>2013-10-10 01:22:23 +0200
commit282b5ac5f0c3928defcad02e04c4a6c592dd6a80 (patch)
tree5c166c5af9de9fb43dce76c42d947a7bc655a8b3 /pkgs/games
parentb98ae36d321399d3c0163ee78fa956d5592ac201 (diff)
downloadnixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.tar
nixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.tar.gz
nixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.tar.bz2
nixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.tar.lz
nixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.tar.xz
nixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.tar.zst
nixlib-282b5ac5f0c3928defcad02e04c4a6c592dd6a80.zip
dwarf-therapist: New package
Dwarf Therapist is a tool to manage your Dwarves' work orders and
other management stuff.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/dwarf-therapist/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/games/dwarf-therapist/default.nix b/pkgs/games/dwarf-therapist/default.nix
new file mode 100644
index 000000000000..8ac84a96aeb5
--- /dev/null
+++ b/pkgs/games/dwarf-therapist/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, coreutils, fetchhg, qt4, dwarf_fortress, bash, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "dwarf-therapist-${rev}";
+  rev = "eeeac8544d94";
+
+  src = fetchhg {
+    url = "https://code.google.com/r/splintermind-attributes/";
+    tag = rev;
+    sha256 = "0a9m967q6p2q3plrl6qysg1xrdmg65jzil6awjh2wr3g10x2x15z";
+  };
+
+  # Needed for hashing
+  dwarfBinary = "${dwarf_fortress}/share/df_linux/libs/Dwarf_Fortress";
+
+  buildInputs = [ coreutils qt4 dwarf_fortress makeWrapper ];
+  enableParallelBuilding = false;
+
+  preConfigure = ''
+    substituteInPlace dwarftherapist.pro \
+      --replace /usr/bin $out/bin     \
+      --replace /usr/share $out/share \
+      --replace "INSTALLS += doc" ""
+  '';
+
+  preBuild = ''
+    # Log to current directory, otherwise it crashes if log/ doesn't
+    # exist Note: Whis is broken because we cd to the nix store in the
+    # wrapper-script
+    substituteInPlace src/dwarftherapist.cpp \
+      --replace "log/run.log" "dwarf-therapist.log"
+  '';
+
+  buildPhase = ''
+    qmake INSTALL_PREFIX=$out;
+    make;
+  '';
+
+  postInstall = ''
+    # DwarfTherapist assumes it's run in $out/share/dwarftherapist and
+    # therefore uses many relative paths.
+    rm $out/bin/dwarftherapist
+    wrapProgram $out/bin/DwarfTherapist \
+      --run "cd $out/share/dwarftherapist"
+  '';
+
+  postFixup = ''
+    # Fix checksum of memory access directives
+    substituteInPlace $out/share/dwarftherapist/etc/memory_layouts/linux/v034.11.ini \
+      --replace "e966ee88" $(md5sum ${dwarfBinary} | cut -c1-8)
+  '';
+
+  meta = {
+    description = "Tool to manage dwarves in in a running game of Dwarf Fortress";
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+    license = "MIT";
+    platforms = stdenv.lib.platforms.linux;
+    homepage = https://code.google.com/r/splintermind-attributes/;
+  };
+}