summary refs log tree commit diff
path: root/pkgs/build-support/buildenv
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30 14:13:47 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30 15:21:02 +0100
commit58e9440b8983c2e0dbab667dc7944e8af9955a35 (patch)
tree68b9301e2c0de5aef9911fd6737de9d9fd59153d /pkgs/build-support/buildenv
parent3e732f65cbb10746d8fd84f54c750045a7ef8bbe (diff)
downloadnixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.tar
nixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.tar.gz
nixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.tar.bz2
nixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.tar.lz
nixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.tar.xz
nixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.tar.zst
nixpkgs-58e9440b8983c2e0dbab667dc7944e8af9955a35.zip
Add option to link additional package outputs into system.path
This is necessary to get stuff like separate manpages, info files,
debug symbols, etc.
Diffstat (limited to 'pkgs/build-support/buildenv')
-rw-r--r--pkgs/build-support/buildenv/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix
index 8cbf0dc6c8e..bbfc572f55f 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 ? ""
 
@@ -36,7 +40,9 @@
 runCommand name
   { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs;
     pkgs = builtins.toJSON (map (drv: {
-      paths = [ drv ]; # FIXME: handle multiple outputs
+      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;