dwarf-therapist: add version to derivation, use symlinkJoin

This commit is contained in:
Nikolay Amiantov 2016-04-26 15:27:48 +03:00
parent 7b4fc0f5a9
commit aa1a40b63d
2 changed files with 7 additions and 21 deletions

View file

@ -1,10 +1,8 @@
{ stdenv, fetchFromGitHub, coreutils, qtbase, qtdeclarative, qmakeHook, texlive }:
let
version = "37.0.0";
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
name = "dwarf-therapist-original-${version}";
version = "37.0.0";
src = fetchFromGitHub {
owner = "splintermind";

View file

@ -1,4 +1,4 @@
{ buildEnv, lib, dwarf-therapist-original, dwarf-fortress-original, makeWrapper }:
{ symlinkJoin, lib, dwarf-therapist-original, dwarf-fortress-original, makeWrapper }:
let
df = dwarf-fortress-original;
@ -6,8 +6,8 @@ let
inifile = "linux/v0${df.baseVersion}.${df.patchVersion}.ini";
dfHashFile = "${df}/hash.md5";
in buildEnv {
name = "dwarf-therapist-${lib.getVersion dt}";
in symlinkJoin {
name = "dwarf-therapist-${dt.version}";
paths = [ dt ];
@ -16,22 +16,10 @@ in buildEnv {
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 \
wrapProgram $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
rm -rf $out/share/dwarftherapist/memory_layouts/linux
mkdir -p $out/share/dwarftherapist/memory_layouts/linux
origmd5=$(cat "${dfHashFile}.orig" | cut -c1-8)
patchedmd5=$(cat "${dfHashFile}" | cut -c1-8)