From e3319eb73d9b3ca6edbb23d58019464d9b9ba167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sun, 27 Jul 2014 13:52:11 +0200 Subject: [PATCH] doc: modernize meta attributes documentation --- doc/meta.xml | 78 +++++++++++-------- pkgs/applications/misc/hello/ex-2/default.nix | 3 +- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/doc/meta.xml b/doc/meta.xml index 6c8e458509a7..d497ae413156 100644 --- a/doc/meta.xml +++ b/doc/meta.xml @@ -17,7 +17,9 @@ meta = { It is fully customizable. ''; 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; }; @@ -32,15 +34,33 @@ command-line using nix-env: $ nix-env -qa hello --meta --xml -<?xml version='1.0' encoding='utf-8'?> -<items> - <item attrPath="hello" name="hello-2.3" system="i686-linux"> - <meta name="description" value="A program that produces a familiar, friendly greeting" /> - <meta name="homepage" value="http://www.gnu.org/software/hello/manual/" /> - <meta name="license" 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;" /> - </item> -</items> +<?xml version='1.0' encoding='utf-8'?> +<items> + <item attrPath="nixos.pkgs.hello" name="hello-2.9" system="x86_64-linux"> + <meta name="description" type="string" value="A program that produces a familiar, friendly greeting" /> + <meta name="homepage" type="string" value="http://www.gnu.org/software/hello/manual/" /> + <meta name="license" type="string" value="GPLv3+" /> + <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;" /> + <meta name="maintainers" type="strings"> + <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> + nix-env knows about the @@ -92,20 +112,22 @@ interpretation: license - The license for the package. See below for the - allowed values. + The license for the package. One from attribute set defined in + + nixpkgs/lib/licenses.nix. + Example: + stdenv.lib.licenses.gpl3. maintainers A list of names and e-mail addresses of the - maintainers of this Nix expression, e.g. ["Alice - <alice@example.org>" "Bob <bob@example.com>"]. If - you are the maintainer of multiple packages, you may want to add + maintainers of this Nix expression. If + you would like to be a maintainer of a package, you may want to add yourself to pkgs/lib/maintainers.nix - and write something like [stdenv.lib.maintainers.alice - stdenv.lib.maintainers.bob]. + xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/maintainers.nix">nixpkgs/lib/maintainers.nix + and write something like [ stdenv.lib.maintainers.alice + stdenv.lib.maintainers.bob ]. @@ -121,29 +143,23 @@ interpretation: platforms 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 nix-env - -qa output, on any platform not listed - here. An example is: + package is supported. An example is: -meta.platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; - - - The set lib.platforms defines various common - lists of platforms types, so it’s more typical to write: - - -meta.platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; +meta.platforms = stdenv.lib.platforms.linux; + Attribute Set stdenv.lib.platforms in + + nixpkgs/lib/platforms.nix defines various common + lists of platforms types. hydraPlatforms The list of Nix platform types for which the Hydra - instance at hydra.nixos.org should build the + instance at hydra.nixos.org will build the package. (Hydra is the Nix-based continuous build system.) It defaults to the value of meta.platforms. Thus, the only reason to set meta.hydraPlatforms is diff --git a/pkgs/applications/misc/hello/ex-2/default.nix b/pkgs/applications/misc/hello/ex-2/default.nix index d3ade1ab8505..71c9777ff9b7 100644 --- a/pkgs/applications/misc/hello/ex-2/default.nix +++ b/pkgs/applications/misc/hello/ex-2/default.nix @@ -17,8 +17,7 @@ stdenv.mkDerivation rec { It is fully customizable. ''; homepage = http://www.gnu.org/software/hello/manual/; - license = "GPLv3+"; - + license = stdenv.lib.licenses.gpl3Plus; maintainers = [ stdenv.lib.maintainers.ludo ]; platforms = stdenv.lib.platforms.all; };