example: headers -> dev

make the example more realistic, since `headers` is not an output name
used in Nixpkgs

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
Valentin Gagarin 2023-09-26 00:46:26 +02:00
parent 75a231147f
commit 7de66f19f8

View file

@ -75,16 +75,16 @@ It outputs an attribute set, and produces a [store derivation](@docroot@/glossar
Thus, the library package could specify: Thus, the library package could specify:
```nix ```nix
outputs = [ "lib" "headers" "doc" ]; outputs = [ "lib" "dev" "doc" ];
``` ```
This will cause Nix to pass environment variables `lib`, `headers`, and `doc` to the builder containing the intended store paths of each output. This will cause Nix to pass environment variables `lib`, `dev`, and `doc` to the builder containing the intended store paths of each output.
The builder would typically do something like The builder would typically do something like
```bash ```bash
./configure \ ./configure \
--libdir=$lib/lib \ --libdir=$lib/lib \
--includedir=$headers/include \ --includedir=$dev/include \
--docdir=$doc/share/doc --docdir=$doc/share/doc
``` ```
@ -94,7 +94,7 @@ It outputs an attribute set, and produces a [store derivation](@docroot@/glossar
derivation by selecting it as an attribute, e.g. derivation by selecting it as an attribute, e.g.
```nix ```nix
buildInputs = [ pkg.lib pkg.headers ]; buildInputs = [ pkg.lib pkg.dev ];
``` ```
<!-- FIXME: move this to the output attributes section when we have one --> <!-- FIXME: move this to the output attributes section when we have one -->
@ -102,7 +102,7 @@ It outputs an attribute set, and produces a [store derivation](@docroot@/glossar
Thus, you could also write Thus, you could also write
```nix ```nix
buildInputs = [ pkg pkg.headers ]; buildInputs = [ pkg pkg.dev ];
``` ```
since `pkg` is equivalent to `pkg.lib`. since `pkg` is equivalent to `pkg.lib`.