mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
Get rid of footnotes
Markdown doesn't support them.
This commit is contained in:
parent
a71d1cedff
commit
8d0b311a1c
18 changed files with 79 additions and 110 deletions
|
@ -33,13 +33,10 @@ steps:</para>
|
|||
|
||||
<para>When Nix runs a builder, it initially completely clears the
|
||||
environment (except for the attributes declared in the
|
||||
derivation). For instance, the <literal>PATH</literal> variable is
|
||||
empty<footnote><para>Actually, it's initialised to
|
||||
<filename>/path-not-set</filename> to prevent Bash from setting it
|
||||
to a default value.</para></footnote>. This is done to prevent
|
||||
undeclared inputs from being used in the build process. If for
|
||||
example the <literal>PATH</literal> contained
|
||||
<filename>/usr/bin</filename>, then you might accidentally use
|
||||
derivation). This is done to prevent undeclared inputs from being
|
||||
used in the build process. If for example the
|
||||
<literal>PATH</literal> contained <filename>/usr/bin</filename>,
|
||||
then you might accidentally use
|
||||
<filename>/usr/bin/gcc</filename>.</para>
|
||||
|
||||
<para>So the first step is to set up the environment. This is
|
||||
|
|
|
@ -13,16 +13,15 @@ of which specify the inputs of the build.</para>
|
|||
|
||||
<itemizedlist>
|
||||
|
||||
<listitem xml:id="attr-system"><para>There must be an attribute named
|
||||
<varname>system</varname> whose value must be a string specifying a
|
||||
Nix platform identifier, such as <literal>"i686-linux"</literal> or
|
||||
<literal>"x86_64-darwin"</literal><footnote><para>To figure out
|
||||
your platform identifier, look at the line <quote>Checking for the
|
||||
canonical Nix system name</quote> in the output of Nix's
|
||||
<filename>configure</filename> script.</para></footnote> The build
|
||||
can only be performed on a machine and operating system matching the
|
||||
platform identifier. (Nix can automatically forward builds for
|
||||
other platforms by forwarding them to other machines; see <xref
|
||||
<listitem xml:id="attr-system"><para>There must be an attribute
|
||||
named <varname>system</varname> whose value must be a string
|
||||
specifying a Nix system type, such as
|
||||
<literal>"i686-linux"</literal> or
|
||||
<literal>"x86_64-darwin"</literal>. (To figure out your system type,
|
||||
run <literal>nix -vv --version</literal>.) The build can only be
|
||||
performed on a machine and operating system matching the system
|
||||
type. (Nix can automatically forward builds for other platforms by
|
||||
forwarding them to other machines; see <xref
|
||||
linkend='chap-distributed-builds' />.)</para></listitem>
|
||||
|
||||
<listitem><para>There must be an attribute named
|
||||
|
|
|
@ -42,14 +42,14 @@ genericBuild ③</programlisting>
|
|||
<filename>bin</filename> subdirectory, it's added to
|
||||
<literal>PATH</literal>; if it has a <filename>include</filename>
|
||||
subdirectory, it's added to GCC's header search path; and so
|
||||
on.<footnote><para>How does it work? <filename>setup</filename>
|
||||
tries to source the file
|
||||
on. (This is implemented in a modular way:
|
||||
<filename>setup</filename> tries to source the file
|
||||
<filename><emphasis>pkg</emphasis>/nix-support/setup-hook</filename>
|
||||
of all dependencies. These “setup hooks” can then set up whatever
|
||||
environment variables they want; for instance, the setup hook for
|
||||
Perl sets the <literal>PERL5LIB</literal> environment variable to
|
||||
contain the <filename>lib/site_perl</filename> directories of all
|
||||
inputs.</para></footnote>
|
||||
inputs.)
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
|
|
|
@ -26,7 +26,7 @@ is, in a normal (non-recursive) set, attributes are not added to the
|
|||
lexical scope; in a recursive set, they are.</para>
|
||||
|
||||
<para>Recursive sets of course introduce the danger of infinite
|
||||
recursion. For example,
|
||||
recursion. For example, the expression
|
||||
|
||||
<programlisting>
|
||||
rec {
|
||||
|
@ -34,9 +34,8 @@ rec {
|
|||
y = x;
|
||||
}.x</programlisting>
|
||||
|
||||
does not terminate<footnote><para>Actually, Nix detects infinite
|
||||
recursion in this case and aborts (<quote>infinite recursion
|
||||
encountered</quote>).</para></footnote>.</para>
|
||||
will crash with an <literal>infinite recursion encountered</literal>
|
||||
error message.</para>
|
||||
|
||||
</section>
|
||||
|
||||
|
|
|
@ -154,11 +154,10 @@ stdenv.mkDerivation {
|
|||
|
||||
<listitem><para><emphasis>Paths</emphasis>, e.g.,
|
||||
<filename>/bin/sh</filename> or <filename>./builder.sh</filename>.
|
||||
A path must contain at least one slash to be recognised as such; for
|
||||
instance, <filename>builder.sh</filename> is not a
|
||||
path<footnote><para>It's parsed as an expression that selects the
|
||||
attribute <varname>sh</varname> from the variable
|
||||
<varname>builder</varname>.</para></footnote>. If the file name is
|
||||
A path must contain at least one slash to be recognised as such. For
|
||||
instance, <filename>builder.sh</filename> is not a path: it's parsed
|
||||
as an expression that selects the attribute <varname>sh</varname>
|
||||
from the variable <varname>builder</varname>. If the file name is
|
||||
relative, i.e., if it does not begin with a slash, it is made
|
||||
absolute at parse time relative to the directory of the Nix
|
||||
expression that contained it. For instance, if a Nix expression in
|
||||
|
@ -176,7 +175,7 @@ stdenv.mkDerivation {
|
|||
<para>Paths can also be specified between angle brackets, e.g.
|
||||
<literal><nixpkgs></literal>. This means that the directories
|
||||
listed in the environment variable
|
||||
<envar linkend="env-NIX_PATH">NIX_PATH</literal> will be searched
|
||||
<literal linkend="env-NIX_PATH">NIX_PATH</literal> will be searched
|
||||
for the given file or directory name.
|
||||
</para>
|
||||
|
||||
|
|
|
@ -21,10 +21,9 @@ need to do three things:
|
|||
such as dependencies, sources, and so on.</para></listitem>
|
||||
|
||||
<listitem><para>Write a <emphasis>builder</emphasis>. This is a
|
||||
shell script<footnote><para>In fact, it can be written in any
|
||||
language, but typically it's a <command>bash</command> shell
|
||||
script.</para></footnote> that actually builds the package from
|
||||
the inputs.</para></listitem>
|
||||
shell script that builds the package from the inputs. (In fact, it
|
||||
can be written in any language, but typically it's a
|
||||
<command>bash</command> shell script.)</para></listitem>
|
||||
|
||||
<listitem><para>Add the package to the file
|
||||
<filename>pkgs/top-level/all-packages.nix</filename>. The Nix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue