diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-11-04 23:31:08 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-11-05 00:06:10 +0100 |
commit | a2cbc77e4f1cf55a9c142d07377f67b0f83985ec (patch) | |
tree | 81934d578f6fd86d09443bdc9b3ce2c0cd42aeef /doc/meta.xml | |
parent | 8867304b5e8bab1741b5b32d7a503d58fccf055e (diff) |
Only show/build a package on the platforms listed in meta.platforms
The function ‘mkDerivation’ now checks whether the current platform type is included in a package's meta.platform field. If not, it throws an exception: $ nix-build -A linux --argstr system x86_64-darwin error: user-thrown exception: the package ‘linux-3.10.15’ is not supported on ‘x86_64-darwin’ These packages also no longer show up in ‘nix-env -qa’ output. This means, for instance, that the number of packages shown on x86_64-freebsd has dropped from 9268 to 4764. Since meta.platforms was also used to prevent Hydra from building some packages, there now is a new attribute meta.hydraPlatforms listing the platforms on which Hydra should build the package (which defaults to meta.platforms).
Diffstat (limited to 'doc/meta.xml')
-rw-r--r-- | doc/meta.xml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/meta.xml b/doc/meta.xml index df84915cc0915..00e9b8ac67a17 100644 --- a/doc/meta.xml +++ b/doc/meta.xml @@ -119,6 +119,47 @@ interpretation:</para> </varlistentry> <varlistentry> + <term><varname>platforms</varname></term> + <listitem><para>The list of Nix platform types on which the + package is supported. If this attribute is set, the package will + refuse to build, and won’t show up in <literal>nix-env + -qa</literal> output, on any platform not listed + here. An example is: + +<programlisting> +meta.platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; +</programlisting> + + The set <varname>lib.platforms</varname> defines various common + lists of platforms types, so it’s more typical to write: + +<programlisting> +meta.platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; +</programlisting> + + </para></listitem> + </varlistentry> + + <varlistentry> + <term><varname>hydraPlatforms</varname></term> + <listitem><para>The list of Nix platform types for which the Hydra + instance at <literal>hydra.nixos.org</literal> should build the + package. (Hydra is the Nix-based continuous build system.) It + defaults to the value of <varname>meta.platforms</varname>. Thus, + the only reason to set <varname>meta.hydraPlatforms</varname> is + if you want <literal>hydra.nixos.org</literal> to build the + package on a subset of <varname>meta.platforms</varname>, or not + at all, e.g. + +<programlisting> +meta.platforms = stdenv.lib.platforms.linux; +meta.hydraPlatforms = []; +</programlisting> + + </para></listitem> + </varlistentry> + + <varlistentry> <term><varname>broken</varname></term> <listitem><para>If set to <literal>true</literal>, the package is marked as “broken”, meaning that it won’t show up in |