2015-01-25 23:00:57 +00:00
|
|
|
{ stdenv, coreutils, fetchgit, qt4, dwarf_fortress, bash, makeWrapper }:
|
2013-10-10 00:15:16 +01:00
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
let
|
2015-07-20 10:23:34 +01:00
|
|
|
version = "31.0.0";
|
2014-12-15 21:13:51 +00:00
|
|
|
df = dwarf_fortress;
|
|
|
|
in
|
2013-10-10 00:15:16 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-12-15 21:13:51 +00:00
|
|
|
name = "dwarf-therapist-${version}";
|
2013-10-10 00:15:16 +01:00
|
|
|
|
2015-01-25 23:00:57 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/splintermind/Dwarf-Therapist.git";
|
2015-07-20 10:23:34 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "02d6k8c3vm401v04ln9q405njarx869jpfyf42lwskijrzjygk9x";
|
2013-10-10 00:15:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Needed for hashing
|
2014-12-15 21:13:51 +00:00
|
|
|
dfHashFile = "${df}/share/df_linux/hash.md5";
|
2013-10-10 00:15:16 +01:00
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
buildInputs = [ coreutils qt4 df makeWrapper ];
|
2013-10-10 00:15:16 +01:00
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
configurePhase = ''
|
2015-01-25 23:00:57 +00:00
|
|
|
qmake PREFIX=$out
|
2013-10-10 00:15:16 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
2014-12-15 21:13:51 +00:00
|
|
|
substituteInPlace $out/share/dwarftherapist/memory_layouts/linux/v0${df.baseVersion}.${df.patchVersion}.ini \
|
|
|
|
--replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched")
|
2013-10-10 00:15:16 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Tool to manage dwarves in in a running game of Dwarf Fortress";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
hydraPlatforms = [];
|
2013-10-10 00:15:16 +01:00
|
|
|
homepage = https://code.google.com/r/splintermind-attributes/;
|
|
|
|
};
|
2014-12-15 21:13:51 +00:00
|
|
|
}
|