From 82a0dde83c1624dabd74a0bf39dd5f7504493f3f Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 23 Jan 2016 23:57:58 +0300 Subject: [PATCH] dwarf-fortress: remove short md5 sums --- pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix | 4 +++- pkgs/games/dwarf-fortress/game.nix | 10 +++------- pkgs/games/dwarf-fortress/wrapper/default.nix | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix index 6b138ac5102..a16c1284a67 100644 --- a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix +++ b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix @@ -33,9 +33,11 @@ in buildEnv { recreate_dir share recreate_dir share/dwarftherapist mkdir -p $out/share/dwarftherapist/memory_layouts/linux + origmd5=$(cat "${dfHashFile}.orig" | cut -c1-8) + patchedmd5=$(cat "${dfHashFile}" | cut -c1-8) substitute \ ${dt.layouts}/${inifile} \ $out/share/dwarftherapist/memory_layouts/${inifile} \ - --replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched") + --replace "$origmd5" "$patchedmd5" ''; } diff --git a/pkgs/games/dwarf-fortress/game.nix b/pkgs/games/dwarf-fortress/game.nix index 06154e1e57a..7e0c1b34af7 100644 --- a/pkgs/games/dwarf-fortress/game.nix +++ b/pkgs/games/dwarf-fortress/game.nix @@ -26,19 +26,15 @@ stdenv.mkDerivation { rm $out/libs/lib* # Store the original hash - orig_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }') - echo $orig_hash | cut -c1-8 > $out/hash.md5.orig # for dwarf-therapist - echo $orig_hash > $out/full-hash-orig.md5 # for dfhack + md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5.orig patchelf \ --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \ --set-rpath "${libpath}" \ $out/libs/Dwarf_Fortress - # Store new hash - patched_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }') - echo $patched_hash | cut -c1-8 > $out/hash.md5.patched # for dwarf-therapist - echo $patched_hash > $out/full-hash-patched.md5 # for dfhack + # Store the new hash + md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5 ''; passthru = { inherit baseVersion patchVersion dfVersion; }; diff --git a/pkgs/games/dwarf-fortress/wrapper/default.nix b/pkgs/games/dwarf-fortress/wrapper/default.nix index 95ff0821d70..5493cdb3faf 100644 --- a/pkgs/games/dwarf-fortress/wrapper/default.nix +++ b/pkgs/games/dwarf-fortress/wrapper/default.nix @@ -30,8 +30,8 @@ let fi rm $out/hack/symbols.xml substitute ${dfhack}/hack/symbols.xml $out/hack/symbols.xml \ - --replace $(cat ${dwarf-fortress-original}/full-hash-orig.md5) \ - $(cat ${dwarf-fortress-original}/full-hash-patched.md5) + --replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \ + $(cat ${dwarf-fortress-original}/hash.md5) ''; }; in