diff options
author | William A. Kennington III <william@wkennington.com> | 2015-10-30 17:16:07 -0700 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2015-10-30 17:16:07 -0700 |
commit | dd2de66d614e58a8b89046e2de73f2305df4b23f (patch) | |
tree | f89847bb63642613f543a44e4e270643f6c1c4b7 /pkgs/build-support/buildenv | |
parent | 99fe4f97c55185d3f51b759cbd5f8e3ab029eadb (diff) | |
parent | a7d573f224707185c44c92b8a35eb6a7ad62c552 (diff) |
Merge branch 'master.upstream' into staging.upstream
Diffstat (limited to 'pkgs/build-support/buildenv')
-rw-r--r-- | pkgs/build-support/buildenv/default.nix | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index e7ac87c109f3..5261e9b5a264 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -2,7 +2,7 @@ # a fork of the buildEnv in the Nix distribution. Most changes should # eventually be merged back into the Nix distribution. -{ perl, runCommand }: +{ perl, runCommand, lib }: { name @@ -21,6 +21,10 @@ # directories in the list is not symlinked. pathsToLink ? ["/"] +, # The package outputs to include. By default, only the default + # output is included. + outputsToLink ? [] + , # Root the result in directory "$out${extraPrefix}", e.g. "/share". extraPrefix ? "" @@ -34,14 +38,16 @@ }: runCommand name - rec { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs; - pkgs = builtins.toJSON (map (drv: { - paths = [ drv ]; # FIXME: handle multiple outputs - priority = drv.meta.priority or 5; - }) paths); - preferLocalBuild = true; - # XXX: The size is somewhat arbitrary - passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else null; + { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs; + pkgs = builtins.toJSON (map (drv: { + paths = + [ drv ] + ++ lib.concatMap (outputName: lib.optional (drv.${outputName}.outPath or null != null) drv.${outputName}) outputsToLink; + priority = drv.meta.priority or 5; + }) paths); + preferLocalBuild = true; + # XXX: The size is somewhat arbitrary + passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else null; } '' ${perl}/bin/perl -w ${./builder.pl} |