2021-01-24 00:40:18 +00:00
|
|
|
{ lib, stdenv }:
|
2014-10-06 15:28:32 +01:00
|
|
|
|
|
|
|
args:
|
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = if args ? name then args.name else baseNameOf (toString args.src);
|
2021-01-24 00:40:18 +00:00
|
|
|
builder = builtins.toFile "builder.sh" ''
|
2014-10-06 15:28:32 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
eval "$preInstall"
|
|
|
|
|
|
|
|
args=
|
|
|
|
|
2016-01-09 18:24:26 +00:00
|
|
|
pushd "$src"
|
2021-01-24 00:40:18 +00:00
|
|
|
echo -ne "${lib.concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do
|
2014-10-06 15:28:32 +01:00
|
|
|
mkdir -p "$out/$(dirname "$line")"
|
|
|
|
substituteAll "$line" "$out/$line"
|
|
|
|
done
|
2016-01-09 18:24:26 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
eval "$postInstall"
|
2014-10-06 15:28:32 +01:00
|
|
|
'';
|
|
|
|
preferLocalBuild = true;
|
2019-02-08 00:22:51 +00:00
|
|
|
allowSubstitutes = false;
|
2014-10-06 15:28:32 +01:00
|
|
|
} // args)
|