@@ -15,7 +15,8 @@ environment does everything automatically. If
1515can easily customise or override the various build phases.</para>
1616
1717
18−<section><title>Using <literal>stdenv</literal></title>
18+<section xml:id="sec-using-stdenv"><title>Using
19+<literal>stdenv</literal></title>
1920
2021<para>To build a package with the standard environment, you use the
2122function <varname>stdenv.mkDerivation</varname>, instead of the
@@ -124,7 +125,8 @@ genericBuild
124125</section>
125126
126127
127−<section><title>Tools provided by <literal>stdenv</literal></title>
128+<section xml:id="sec-tools-of-stdenv"><title>Tools provided by
129+<literal>stdenv</literal></title>
128130
129131<para>The standard environment provides the following packages:
130132
@@ -225,7 +227,7 @@ genericBuild
225227</section>
226228
227229
228−<section xml:id="ssec-stdenv-phases"><title>Phases</title>
230+<section xml:id="sec-stdenv-phases"><title>Phases</title>
229231
230232<para>The generic builder has a number of <emphasis>phases</emphasis>.
231233Package builds are split into phases to make it easier to override
@@ -243,7 +245,8 @@ is convenient to override a phase from the derivation, while the
243245latter is convenient from a build script.</para>
244246
245247
246−<section><title>Controlling phases</title>
248+<section xml:id="ssec-controlling-phases"><title>Controlling
249+phases</title>
247250
248251<para>There are a number of variables that control what phases are
249252executed and in what order:
@@ -327,7 +330,7 @@ executed and in what order:
327330</section>
328331
329332
330−<section><title>The unpack phase</title>
333+<section xml:id="ssec-unpack-phase"><title>The unpack phase</title>
331334
332335<para>The unpack phase is responsible for unpacking the source code of
333336the package. The default implementation of
@@ -434,7 +437,7 @@ Additional file types can be supported by setting the
434437</section>
435438
436439
437−<section><title>The patch phase</title>
440+<section xml:id="ssec-patch-phase"><title>The patch phase</title>
438441
439442<para>The patch phase applies the list of patches defined in the
440443<varname>patches</varname> variable.</para>
@@ -477,7 +480,7 @@ Additional file types can be supported by setting the
477480</section>
478481
479482
480−<section><title>The configure phase</title>
483+<section xml:id="ssec-configure-phase"><title>The configure phase</title>
481484
482485<para>The configure phase prepares the source tree for building. The
483486default <function>configurePhase</function> runs
@@ -573,7 +576,7 @@ script) if it exists.</para>
573576</section>
574577
575578
576−<section><title>The build phase</title>
579+<section xml:id="build-phase"><title>The build phase</title>
577580
578581<para>The build phase is responsible for actually building the package
579582(e.g. compiling it). The default <function>buildPhase</function>
@@ -657,7 +660,7 @@ called, respectively.</para>
657660</section>
658661
659662
660−<section><title>The check phase</title>
663+<section xml:id="ssec-check-phase"><title>The check phase</title>
661664
662665<para>The check phase checks whether the package was built correctly
663666by running its test suite. The default
@@ -717,7 +720,7 @@ doCheck = true;</programlisting>
717720</section>
718721
719722
720−<section><title>The install phase</title>
723+<section xml:id="ssec-install-phase"><title>The install phase</title>
721724
722725<para>The install phase is responsible for installing the package in
723726the Nix store under <envar>out</envar>. The default
@@ -772,7 +775,7 @@ installTargets = "install-bin install-doc";</programlisting>
772775</section>
773776
774777
775−<section><title>The fixup phase</title>
778+<section xml:id="ssec-fixup-phase"><title>The fixup phase</title>
776779
777780<para>The fixup phase performs some (Nix-specific) post-processing
778781actions on the files installed under <filename>$out</filename> by the
@@ -895,7 +898,8 @@ following:
895898</section>
896899
897900
898−<section><title>The distribution phase</title>
901+<section xml:id="ssec-distribution-phase"><title>The distribution
902+phase</title>
899903
900904<para>The distribution phase is intended to produce a source
901905distribution of the package. The default
@@ -1199,7 +1203,7 @@ echo @foo@
11991203</section>
12001204
12011205
1202−<section><title>Purity in Nixpkgs</title>
1206+<section xml:id="sec-purity-in-nixpkgs"><title>Purity in Nixpkgs</title>
12031207
12041208<para>[measures taken to prevent dependencies on packages outside the
12051209store, and what you can do to prevent them]</para>