dwarf-fortress: remove short md5 sums

This commit is contained in:
Nikolay Amiantov 2016-01-23 23:57:58 +03:00
parent d3b642ce9a
commit 82a0dde83c
3 changed files with 8 additions and 10 deletions

View File

@ -33,9 +33,11 @@ in buildEnv {
recreate_dir share recreate_dir share
recreate_dir share/dwarftherapist recreate_dir share/dwarftherapist
mkdir -p $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)
substitute \ substitute \
${dt.layouts}/${inifile} \ ${dt.layouts}/${inifile} \
$out/share/dwarftherapist/memory_layouts/${inifile} \ $out/share/dwarftherapist/memory_layouts/${inifile} \
--replace $(cat "${dfHashFile}.orig") $(cat "${dfHashFile}.patched") --replace "$origmd5" "$patchedmd5"
''; '';
} }

View File

@ -26,19 +26,15 @@ stdenv.mkDerivation {
rm $out/libs/lib* rm $out/libs/lib*
# Store the original hash # Store the original hash
orig_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }') md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5.orig
echo $orig_hash | cut -c1-8 > $out/hash.md5.orig # for dwarf-therapist
echo $orig_hash > $out/full-hash-orig.md5 # for dfhack
patchelf \ patchelf \
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \ --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
--set-rpath "${libpath}" \ --set-rpath "${libpath}" \
$out/libs/Dwarf_Fortress $out/libs/Dwarf_Fortress
# Store new hash # Store the new hash
patched_hash=$(md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }') md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5
echo $patched_hash | cut -c1-8 > $out/hash.md5.patched # for dwarf-therapist
echo $patched_hash > $out/full-hash-patched.md5 # for dfhack
''; '';
passthru = { inherit baseVersion patchVersion dfVersion; }; passthru = { inherit baseVersion patchVersion dfVersion; };

View File

@ -30,8 +30,8 @@ let
fi fi
rm $out/hack/symbols.xml rm $out/hack/symbols.xml
substitute ${dfhack}/hack/symbols.xml $out/hack/symbols.xml \ substitute ${dfhack}/hack/symbols.xml $out/hack/symbols.xml \
--replace $(cat ${dwarf-fortress-original}/full-hash-orig.md5) \ --replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \
$(cat ${dwarf-fortress-original}/full-hash-patched.md5) $(cat ${dwarf-fortress-original}/hash.md5)
''; '';
}; };
in in