dwarf-therapist: 31.0.0 -> 36.0.0

This commit is contained in:
Nikolay Amiantov 2016-01-12 21:17:46 +03:00
parent 92cda7a6bb
commit fdae86fb4e
5 changed files with 90 additions and 49 deletions

View File

@ -14,6 +14,14 @@ let
dwarf-fortress-unfuck = callPackage_i686 ./unfuck.nix { };
dwarf-fortress = callPackage ./wrapper { };
dwarf-therapist-original = callPackage ./dwarf-therapist {
texlive = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-basic float caption wrapfig adjmulticol sidecap preprint enumitem;
};
};
dwarf-therapist = callPackage ./dwarf-therapist/wrapper.nix { };
};
in self

View File

@ -0,0 +1,40 @@
{ stdenv, fetchFromGitHub, coreutils, qt4, texlive }:
let
version = "36.0.0";
in
stdenv.mkDerivation {
name = "dwarf-therapist-original-${version}";
src = fetchFromGitHub {
owner = "splintermind";
repo = "Dwarf-Therapist";
rev = "v${version}";
sha256 = "08xjawb25sibkkfqwd4mlq73dgmgc6lxbbd673rx7yhrsjh4z4h3";
};
outputs = [ "out" "layouts" ];
buildInputs = [ qt4 ];
nativeBuildInputs = [ texlive ];
enableParallelBuilding = false;
configurePhase = ''
qmake PREFIX=$out
'';
# Move layout files so they cannot be found by Therapist
postInstall = ''
mkdir -p $layouts
mv $out/share/dwarftherapist/memory_layouts/* $layouts
rmdir $out/share/dwarftherapist/memory_layouts
'';
meta = {
description = "Tool to manage dwarves in in a running game of Dwarf Fortress";
maintainers = with stdenv.lib.maintainers; [ the-kenny abbradar ];
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
homepage = https://code.google.com/r/splintermind-attributes/;
};
}

View File

@ -0,0 +1,41 @@
{ buildEnv, lib, dwarf-therapist-original, dwarf-fortress-original, makeWrapper }:
let
df = dwarf-fortress-original;
dt = dwarf-therapist-original;
inifile = "linux/v0${df.baseVersion}.${df.patchVersion}.ini";
dfHashFile = "${df}/hash.md5";
in buildEnv {
name = "dwarf-therapist-${lib.getVersion dt}";
paths = [ dt ];
buildInputs = [ makeWrapper ];
postBuild = ''
# DwarfTherapist assumes it's run in $out/share/dwarftherapist and
# therefore uses many relative paths.
rm $out/bin
mkdir $out/bin
makeWrapper ${dt}/bin/DwarfTherapist $out/bin/DwarfTherapist \
--run "cd $out/share/dwarftherapist"
# Fix checksum of memory access directives. We really need #4621 fixed!
recreate_dir() {
rm "$out/$1"
mkdir -p "$out/$1"
for i in "${dt}/$1/"*; do
ln -s "$i" "$out/$1"
done
}
recreate_dir share
recreate_dir share/dwarftherapist
mkdir -p $out/share/dwarftherapist/memory_layouts/linux
substitute \
${dt.layouts}/${inifile} \
$out/share/dwarftherapist/memory_layouts/${inifile} \
--replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched")
'';
}

View File

@ -1,48 +0,0 @@
{ stdenv, coreutils, fetchgit, qt4, dwarf_fortress, bash, makeWrapper }:
let
version = "31.0.0";
df = dwarf_fortress;
in
stdenv.mkDerivation rec {
name = "dwarf-therapist-${version}";
src = fetchgit {
url = "https://github.com/splintermind/Dwarf-Therapist.git";
rev = "refs/tags/v${version}";
sha256 = "02d6k8c3vm401v04ln9q405njarx869jpfyf42lwskijrzjygk9x";
};
# Needed for hashing
dfHashFile = "${df}/share/df_linux/hash.md5";
buildInputs = [ coreutils qt4 df makeWrapper ];
enableParallelBuilding = false;
configurePhase = ''
qmake PREFIX=$out
'';
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/memory_layouts/linux/v0${df.baseVersion}.${df.patchVersion}.ini \
--replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched")
'';
meta = {
description = "Tool to manage dwarves in in a running game of Dwarf Fortress";
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
hydraPlatforms = [];
homepage = https://code.google.com/r/splintermind-attributes/;
};
}

View File

@ -14112,7 +14112,7 @@ let
dwarf-fortress = dwarf-fortress-packages.dwarf-fortress.override { };
dwarf-therapist = callPackage ../games/dwarf-therapist { };
dwarf-therapist = dwarf-fortress-packages.dwarf-therapist;
d1x_rebirth = callPackage ../games/d1x-rebirth { };