mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 00:53:12 +03:00
29fedf210f
A build hook to run functions previously only implemented privately in `pkgs/build-support/release/functions.sh`.
18 lines
571 B
Bash
18 lines
571 B
Bash
# This setup hook causes the fixup phase to repack all JAR files in a
|
|
# canonical & deterministic fashion, e.g. resetting mtimes (like with normal
|
|
# store files) and avoiding impure metadata.
|
|
|
|
fixupOutputHooks+=('if [ -z "$dontCanonicalizeJars" -a -e "$prefix" ]; then canonicalizeJarsIn "$prefix"; fi')
|
|
|
|
canonicalizeJarsIn() {
|
|
local dir="$1"
|
|
header "canonicalizing jars in $dir"
|
|
dir="$(realpath -sm -- "$dir")"
|
|
while IFS= read -rd '' f; do
|
|
canonicalizeJar "$f"
|
|
done < <(find -- "$dir" -type f -name '*.jar' -print0)
|
|
stopNest
|
|
}
|
|
|
|
source @canonicalize_jar@
|