diff --git a/pkgs/games/dwarf-fortress/dwarf-therapist/default.nix b/pkgs/games/dwarf-fortress/dwarf-therapist/default.nix index 6c094ff20f81..37eab6d077a3 100644 --- a/pkgs/games/dwarf-fortress/dwarf-therapist/default.nix +++ b/pkgs/games/dwarf-fortress/dwarf-therapist/default.nix @@ -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"; diff --git a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix index a16c1284a672..cbc8d31e6750 100644 --- a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix +++ b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix @@ -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)