git.iko.soy/typeable/nixpkgs
on master help sign in
dwarf-fortress: remove short md5 sums
commit82a0dde83c1624dabd74a0bf39dd5f7504493f3f authorNikolay Amiantov <ab@fmap.me> dateSat 23 Jan 2016, 23:57 (11 years ago) parentd3b642c
3 files changed+8−10
pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix+3−1 pkgs/games/dwarf-fortress/game.nix+3−7 pkgs/games/dwarf-fortress/wrapper/default.nix+2−2
pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix+3−1
@@ -33,9 +33,11 @@ in buildEnv {
3333 recreate_dir share
3434 recreate_dir share/dwarftherapist
3535 mkdir -p $out/share/dwarftherapist/memory_layouts/linux
36+ origmd5=$(cat "${dfHashFile}.orig" | cut -c1-8)
37+ patchedmd5=$(cat "${dfHashFile}" | cut -c1-8)
3638 substitute \
3739 ${dt.layouts}/${inifile} \
3840 $out/share/dwarftherapist/memory_layouts/${inifile} \
39− --replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched")
41+ --replace "$origmd5" "$patchedmd5"
4042 '';
4143}
pkgs/games/dwarf-fortress/game.nix+3−7
@@ -26,19 +26,15 @@ stdenv.mkDerivation {
2626 rm $out/libs/lib*
2727
2828 # Store the original hash
29− orig_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }')
30− echo $orig_hash | cut -c1-8 > $out/hash.md5.orig # for dwarf-therapist
31− echo $orig_hash > $out/full-hash-orig.md5 # for dfhack
29+ md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5.orig
3230
3331 patchelf \
3432 --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
3533 --set-rpath "${libpath}" \
3634 $out/libs/Dwarf_Fortress
3735
38− # Store new hash
39− patched_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }')
40− echo $patched_hash | cut -c1-8 > $out/hash.md5.patched # for dwarf-therapist
41− echo $patched_hash > $out/full-hash-patched.md5 # for dfhack
36+ # Store the new hash
37+ md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5
4238 '';
4339
4440 passthru = { inherit baseVersion patchVersion dfVersion; };
pkgs/games/dwarf-fortress/wrapper/default.nix+2−2
@@ -30,8 +30,8 @@ let
3030 fi
3131 rm $out/hack/symbols.xml
3232 substitute ${dfhack}/hack/symbols.xml $out/hack/symbols.xml \
33− --replace $(cat ${dwarf-fortress-original}/full-hash-orig.md5) \
34− $(cat ${dwarf-fortress-original}/full-hash-patched.md5)
33+ --replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \
34+ $(cat ${dwarf-fortress-original}/hash.md5)
3535 '';
3636 };
3737in