doc: modernize meta attributes documentation
This commit is contained in:
parent
c8cd4275a3
commit
e3319eb73d
78
doc/meta.xml
78
doc/meta.xml
@ -17,7 +17,9 @@ meta = {
|
|||||||
It is fully customizable.
|
It is fully customizable.
|
||||||
'';
|
'';
|
||||||
homepage = http://www.gnu.org/software/hello/manual/;
|
homepage = http://www.gnu.org/software/hello/manual/;
|
||||||
license = "GPLv3+";
|
license = stdenv.lib.licenses.gpl3Plus;
|
||||||
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
||||||
|
platforms = stdenv.lib.platforms.all;
|
||||||
};
|
};
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@ -32,15 +34,33 @@ command-line using <command>nix-env</command>:
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
$ nix-env -qa hello --meta --xml
|
$ nix-env -qa hello --meta --xml
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<items>
|
<items>
|
||||||
<item attrPath="hello" name="hello-2.3" system="i686-linux">
|
<item attrPath="nixos.pkgs.hello" name="hello-2.9" system="x86_64-linux">
|
||||||
<meta name="description" value="A program that produces a familiar, friendly greeting" />
|
<meta name="description" type="string" value="A program that produces a familiar, friendly greeting" />
|
||||||
<meta name="homepage" value="http://www.gnu.org/software/hello/manual/" />
|
<meta name="homepage" type="string" value="http://www.gnu.org/software/hello/manual/" />
|
||||||
<meta name="license" value="GPLv3+" />
|
<meta name="license" type="string" value="GPLv3+" />
|
||||||
<meta name="longDescription" value="GNU Hello is a program that prints &quot;Hello, world!&quot; when you run it.&#xA;It is fully customizable.&#xA;" />
|
<meta name="longDescription" type="string" value="GNU Hello is a program that prints &quot;Hello, world!&quot; when you run it.&#xA;It is fully customizable.&#xA;" />
|
||||||
</item>
|
<meta name="maintainers" type="strings">
|
||||||
</items>
|
<string value="Ludovic Courtès &lt;ludo@gnu.org&gt;" />
|
||||||
|
</meta>
|
||||||
|
<meta name="platforms" type="strings">
|
||||||
|
<string value="i686-linux" />
|
||||||
|
<string value="x86_64-linux" />
|
||||||
|
<string value="armv5tel-linux" />
|
||||||
|
<string value="armv7l-linux" />
|
||||||
|
<string value="mips64el-linux" />
|
||||||
|
<string value="x86_64-darwin" />
|
||||||
|
<string value="i686-cygwin" />
|
||||||
|
<string value="i686-freebsd" />
|
||||||
|
<string value="x86_64-freebsd" />
|
||||||
|
<string value="i686-openbsd" />
|
||||||
|
<string value="x86_64-openbsd" />
|
||||||
|
</meta>
|
||||||
|
<meta name="position" type="string" value="/nix/store/cn8zjjdd9kvmp1p5d21h7ya0cr1jhkk3-nixos-14.10pre44264.12f06b3/nixos/nixpkgs/pkgs/applications/misc/hello/ex-2/default.nix:14" />
|
||||||
|
</item>
|
||||||
|
</items>
|
||||||
|
|
||||||
</screen>
|
</screen>
|
||||||
|
|
||||||
<command>nix-env</command> knows about the
|
<command>nix-env</command> knows about the
|
||||||
@ -92,20 +112,22 @@ interpretation:</para>
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>license</varname></term>
|
<term><varname>license</varname></term>
|
||||||
<listitem><para>The license for the package. See below for the
|
<listitem><para>The license for the package. One from attribute set defined in
|
||||||
allowed values.</para></listitem>
|
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/licenses.nix">
|
||||||
|
<filename>nixpkgs/lib/licenses.nix</filename></link>.
|
||||||
|
Example:
|
||||||
|
<literal>stdenv.lib.licenses.gpl3</literal>.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>maintainers</varname></term>
|
<term><varname>maintainers</varname></term>
|
||||||
<listitem><para>A list of names and e-mail addresses of the
|
<listitem><para>A list of names and e-mail addresses of the
|
||||||
maintainers of this Nix expression, e.g. <literal>["Alice
|
maintainers of this Nix expression. If
|
||||||
<alice@example.org>" "Bob <bob@example.com>"]</literal>. If
|
you would like to be a maintainer of a package, you may want to add
|
||||||
you are the maintainer of multiple packages, you may want to add
|
|
||||||
yourself to <link
|
yourself to <link
|
||||||
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/maintainers.nix"><filename>pkgs/lib/maintainers.nix</filename></link>
|
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/maintainers.nix"><filename>nixpkgs/lib/maintainers.nix</filename></link>
|
||||||
and write something like <literal>[stdenv.lib.maintainers.alice
|
and write something like <literal>[ stdenv.lib.maintainers.alice
|
||||||
stdenv.lib.maintainers.bob]</literal>.</para></listitem>
|
stdenv.lib.maintainers.bob ]</literal>.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -121,29 +143,23 @@ interpretation:</para>
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>platforms</varname></term>
|
<term><varname>platforms</varname></term>
|
||||||
<listitem><para>The list of Nix platform types on which the
|
<listitem><para>The list of Nix platform types on which the
|
||||||
package is supported. If this attribute is set, the package will
|
package is supported. An example is:
|
||||||
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>
|
<programlisting>
|
||||||
meta.platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
|
meta.platforms = stdenv.lib.platforms.linux;
|
||||||
</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>
|
</programlisting>
|
||||||
|
|
||||||
|
Attribute Set <varname>stdenv.lib.platforms</varname> in
|
||||||
|
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/platforms.nix">
|
||||||
|
<filename>nixpkgs/lib/platforms.nix</filename></link> defines various common
|
||||||
|
lists of platforms types.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>hydraPlatforms</varname></term>
|
<term><varname>hydraPlatforms</varname></term>
|
||||||
<listitem><para>The list of Nix platform types for which the Hydra
|
<listitem><para>The list of Nix platform types for which the Hydra
|
||||||
instance at <literal>hydra.nixos.org</literal> should build the
|
instance at <literal>hydra.nixos.org</literal> will build the
|
||||||
package. (Hydra is the Nix-based continuous build system.) It
|
package. (Hydra is the Nix-based continuous build system.) It
|
||||||
defaults to the value of <varname>meta.platforms</varname>. Thus,
|
defaults to the value of <varname>meta.platforms</varname>. Thus,
|
||||||
the only reason to set <varname>meta.hydraPlatforms</varname> is
|
the only reason to set <varname>meta.hydraPlatforms</varname> is
|
||||||
|
@ -17,8 +17,7 @@ stdenv.mkDerivation rec {
|
|||||||
It is fully customizable.
|
It is fully customizable.
|
||||||
'';
|
'';
|
||||||
homepage = http://www.gnu.org/software/hello/manual/;
|
homepage = http://www.gnu.org/software/hello/manual/;
|
||||||
license = "GPLv3+";
|
license = stdenv.lib.licenses.gpl3Plus;
|
||||||
|
|
||||||
maintainers = [ stdenv.lib.maintainers.ludo ];
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
||||||
platforms = stdenv.lib.platforms.all;
|
platforms = stdenv.lib.platforms.all;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user