mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-31 20:54:56 +00:00
It's hard to put the sourcing of ./.attrs.sh into all builder consistently - mistakes will happen. Thus, load structured attrs once in make-derivation and then source the remaining builder on top. This should fix quite a few builders with structured attributes in principle. Most importantly it helps substitute / substituteAll, which are required for bootstrap on some platforms.
23 lines
345 B
Bash
23 lines
345 B
Bash
args=
|
|
|
|
target=$out
|
|
if test -n "$dir"; then
|
|
target=$out/$dir/$name
|
|
mkdir -p $out/$dir
|
|
fi
|
|
|
|
substitutionsList=($replacements)
|
|
|
|
if [[ -v substitutions ]]; then
|
|
eval "substitutionsList+=($substitutions)"
|
|
fi
|
|
|
|
substitute $src $target "${substitutionsList[@]}"
|
|
|
|
if test -n "$isExecutable"; then
|
|
chmod +x $target
|
|
fi
|
|
|
|
eval "$postInstall"
|
|
|