@@ -1,39 +1,30 @@
1−{ stdenv, coreutils, fetchhg, qt4, dwarf_fortress, bash, makeWrapper }:
1+{ stdenv, coreutils, fetchurl, qt4, dwarf_fortress, bash, makeWrapper }:
22
3+let
4+ version = "30.1.0";
5+ df = dwarf_fortress;
6+in
37stdenv.mkDerivation rec {
4− name = "dwarf-therapist-${rev}";
5− rev = "eeeac8544d94";
8+ name = "dwarf-therapist-${version}";
69
7− src = fetchhg {
8− url = "https://code.google.com/r/splintermind-attributes/";
9− inherit rev;
10− sha256 = "0a9m967q6p2q3plrl6qysg1xrdmg65jzil6awjh2wr3g10x2x15z";
10+ src = fetchurl {
11+ url = "https://github.com/splintermind/Dwarf-Therapist/archive/v${version}.tar.gz";
12+ sha256 = "1x9dkis6b3f8iqcfrc2cj9mcgkwf0rzhxhq2lgy4xdr2n0yjkyv7";
1113 };
1214
1315 # Needed for hashing
14− dwarfBinary = "${dwarf_fortress}/share/df_linux/libs/Dwarf_Fortress";
16+ dfHashFile = "${df}/share/df_linux/hash.md5";
1517
16− buildInputs = [ coreutils qt4 dwarf_fortress makeWrapper ];
18+ buildInputs = [ coreutils qt4 df makeWrapper ];
1719 enableParallelBuilding = false;
1820
19− preConfigure = ''
21+ configurePhase = ''
2022 substituteInPlace dwarftherapist.pro \
2123 --replace /usr/bin $out/bin \
2224 --replace /usr/share $out/share \
2325 --replace "INSTALLS += doc" ""
24− '';
25−
26− preBuild = ''
27− # Log to current directory, otherwise it crashes if log/ doesn't
28− # exist Note: Whis is broken because we cd to the nix store in the
29− # wrapper-script
30− substituteInPlace src/dwarftherapist.cpp \
31− --replace "log/run.log" "dwarf-therapist.log"
32− '';
3326
34− buildPhase = ''
35− qmake INSTALL_PREFIX=$out;
36− make;
27+ qmake INSTALL_PREFIX=$out
3728 '';
3829
3930 postInstall = ''
@@ -46,8 +37,8 @@ stdenv.mkDerivation rec {
4637
4738 postFixup = ''
4839 # Fix checksum of memory access directives
49− substituteInPlace $out/share/dwarftherapist/etc/memory_layouts/linux/v034.11.ini \
50− --replace "e966ee88" $(md5sum ${dwarfBinary} | cut -c1-8)
40+ substituteInPlace $out/share/dwarftherapist/memory_layouts/linux/v0${df.baseVersion}.${df.patchVersion}.ini \
41+ --replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched")
5142 '';
5243
5344 meta = {
@@ -58,4 +49,4 @@ stdenv.mkDerivation rec {
5849 hydraPlatforms = [];
5950 homepage = https://code.google.com/r/splintermind-attributes/;
6051 };
61−}
52+}