summary refs log tree commit diff
path: root/doc/multiple-output.xml
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-08-30 04:46:59 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-08-30 04:46:59 +0300
commit03fb2c1f32825dd7d43a456667db5848b47f4ea3 (patch)
tree33c06f952cb615835dfde63f2d66e759113a1a74 /doc/multiple-output.xml
parentd75596995e4afc44df3d348ca08bd9b98b66a48f (diff)
downloadnixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.tar
nixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.tar.gz
nixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.tar.bz2
nixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.tar.lz
nixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.tar.xz
nixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.tar.zst
nixlib-03fb2c1f32825dd7d43a456667db5848b47f4ea3.zip
doc: Document changes to multiple-output conventions
Diffstat (limited to 'doc/multiple-output.xml')
-rw-r--r--doc/multiple-output.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/multiple-output.xml b/doc/multiple-output.xml
index 1821861adf71..309254f76aac 100644
--- a/doc/multiple-output.xml
+++ b/doc/multiple-output.xml
@@ -29,15 +29,15 @@
 
 <section><title>Using a split package</title>
   <para>In the Nix language the individual outputs can be reached explicitly as attributes, e.g. <varname>coreutils.info</varname>, but the typical case is just using packages as build inputs.</para>
-  <para>When a multiple-output derivation gets into a build input of another derivation, the first output is added (<varname>.dev</varname> by convention) and also <varname>propagatedBuildOutputs</varname> of that package which by default contain <varname>$outputBin</varname> and <varname>$outputLib</varname>. (See <xref linkend="multiple-output-file-type-groups" />.)</para>
+  <para>When a multiple-output derivation gets into a build input of another derivation, the <varname>dev</varname> output is added if it exists, otherwise the first output is added. In addition to that, <varname>propagatedBuildOutputs</varname> of that package which by default contain <varname>$outputBin</varname> and <varname>$outputLib</varname> are also added. (See <xref linkend="multiple-output-file-type-groups" />.)</para>
 </section>
 
 
 <section><title>Writing a split derivation</title>
   <para>Here you find how to write a derivation that produces multiple outputs.</para>
   <para>In nixpkgs there is a framework supporting multiple-output derivations. It tries to cover most cases by default behavior.  You can find the source separated in &lt;<filename>nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh</filename>&gt;; it's relatively well-readable.  The whole machinery is triggered by defining the <varname>outputs</varname> attribute to contain the list of desired output names (strings).</para>
-  <programlisting>outputs = [ "dev" "out" "bin" "doc" ];</programlisting>
-  <para>Often such a single line is enough.  For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output.  By convention, the first output should usually be <varname>dev</varname>; typically you also want to have the main <varname>out</varname> output, as it catches any files that didn't get elsewhere.</para>
+  <programlisting>outputs = [ "bin" "dev" "out" "doc" ];</programlisting>
+  <para>Often such a single line is enough.  For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output.  By convention, the first output should contain the executable programs provided by the package as that output is used by Nix in string conversions, allowing references to binaries like <literal>${pkgs.perl}/bin/perl</literal> to always work. Typically you also want to have the main <varname>out</varname> output, as it catches any files that didn't get elsewhere.</para>
 
   <note><para>There is a special handling of the <varname>debug</varname> output, described at <xref linkend="stdenv-separateDebugInfo" />.</para></note>