about summary refs log tree commit diff
path: root/pkgs/build-support/substitute/substitute.sh
blob: d50a82446639dc2bef5eb39165f1c2c840b06b09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
source $stdenv/setup

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"