2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
args:
|
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = if args ? name then args.name else baseNameOf (toString args.src);
|
2021-02-05 17:12:51 +00:00
|
|
|
builder = builtins.toFile "builder.sh" ''
|
2020-04-24 23:36:52 +00:00
|
|
|
source $stdenv/setup
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
eval "$preInstall"
|
|
|
|
|
|
|
|
args=
|
|
|
|
|
|
|
|
pushd "$src"
|
2021-02-05 17:12:51 +00:00
|
|
|
echo -ne "${lib.concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p "$out/$(dirname "$line")"
|
|
|
|
substituteAll "$line" "$out/$line"
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
|
|
|
eval "$postInstall"
|
|
|
|
'';
|
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
|
|
|
} // args)
|