about summary refs log tree commit diff
path: root/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix')
-rw-r--r--pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix
index f9e3e468cdc0..54f0f0405ac5 100644
--- a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix
+++ b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix
@@ -1,32 +1,32 @@
-{ stdenv, symlinkJoin, lib, dwarf-therapist-original, dwarf-fortress-original, makeWrapper }:
+{ stdenv, symlinkJoin, lib, dwarf-therapist, dwarf-fortress, makeWrapper }:
 
 let
-  df = dwarf-fortress-original;
-  dt = dwarf-therapist-original;
   platformSlug = if stdenv.targetPlatform.is32bit then
     "linux32" else "linux64";
-  inifile = "linux/v0.${df.baseVersion}.${df.patchVersion}_${platformSlug}.ini";
-  dfHashFile = "${df}/hash.md5";
+  inifile = "linux/v0.${dwarf-fortress.baseVersion}.${dwarf-fortress.patchVersion}_${platformSlug}.ini";
 
 in symlinkJoin {
-  name = "dwarf-therapist-${dt.version}";
+  name = "dwarf-therapist-${dwarf-therapist.version}";
 
-  paths = [ dt ];
+  paths = [ dwarf-therapist ];
 
   buildInputs = [ makeWrapper ];
 
+  passthru = { inherit dwarf-fortress dwarf-therapist; };
+
   postBuild = ''
     # DwarfTherapist assumes it's run in $out/share/dwarftherapist and
     # therefore uses many relative paths.
     wrapProgram $out/bin/dwarftherapist \
       --run "cd $out/share/dwarftherapist"
+    ln -s $out/bin/dwarftherapist $out/bin/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)
+    origmd5=$(cat "${dwarf-fortress}/hash.md5.orig" | cut -c1-8)
+    patchedmd5=$(cat "${dwarf-fortress}/hash.md5" | cut -c1-8)
     substitute \
-      ${dt}/share/dwarftherapist/memory_layouts/${inifile} \
+      ${dwarf-therapist}/share/dwarftherapist/memory_layouts/${inifile} \
       $out/share/dwarftherapist/memory_layouts/${inifile} \
       --replace "$origmd5" "$patchedmd5"
   '';