2014-12-15 21:13:51 +00:00
|
|
|
{ stdenv, coreutils, fetchurl, qt4, dwarf_fortress, bash, makeWrapper }:
|
2013-10-09 23:15:16 +00:00
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
let
|
|
|
|
version = "30.1.0";
|
|
|
|
df = dwarf_fortress;
|
|
|
|
in
|
2013-10-09 23:15:16 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-12-15 21:13:51 +00:00
|
|
|
name = "dwarf-therapist-${version}";
|
2013-10-09 23:15:16 +00:00
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/splintermind/Dwarf-Therapist/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "1x9dkis6b3f8iqcfrc2cj9mcgkwf0rzhxhq2lgy4xdr2n0yjkyv7";
|
2013-10-09 23:15:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Needed for hashing
|
2014-12-15 21:13:51 +00:00
|
|
|
dfHashFile = "${df}/share/df_linux/hash.md5";
|
2013-10-09 23:15:16 +00:00
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
buildInputs = [ coreutils qt4 df makeWrapper ];
|
2013-10-09 23:15:16 +00:00
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
configurePhase = ''
|
2013-10-09 23:15:16 +00:00
|
|
|
substituteInPlace dwarftherapist.pro \
|
|
|
|
--replace /usr/bin $out/bin \
|
|
|
|
--replace /usr/share $out/share \
|
|
|
|
--replace "INSTALLS += doc" ""
|
|
|
|
|
2014-12-15 21:13:51 +00:00
|
|
|
qmake INSTALL_PREFIX=$out
|
2013-10-09 23:15:16 +00: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-09 23:15:16 +00: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 04:19:00 +00:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
hydraPlatforms = [];
|
2013-10-09 23:15:16 +00:00
|
|
|
homepage = https://code.google.com/r/splintermind-attributes/;
|
|
|
|
};
|
2014-12-15 21:13:51 +00:00
|
|
|
}
|