summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorEelco Dolstra2006-03-10 16:12:46 +0000
committerEelco Dolstra2006-03-10 16:12:46 +0000
commitbaec8f5b38e83a456eebdf742834efc2c22386c6 (patch)
treeecd654568b44dba0a8a0fb0c6abebbc7b1c5feda /pkgs/stdenv
parent4c63a4a97a56d992ccc83e77ce477d3b22906240 (diff)
* stdenv.mkDerivation now takes an optional attribute "meta" that
  contains arbitrary information about a package, like this:

  meta = {
    homepage = "http://gcc.gnu.org/";
    license = "GPL/LGPL";
    description = "GNU Compiler Collection, 4.0.x";
  };

  The "meta" attribute is not passed to the actual derivation
  operation, so it's not a dependency --- changes to "meta" attributes
  don't trigger a recompilation.

  Now we have to standardise some useful attributes ;-)

svn path=/nixpkgs/branches/usability/; revision=5024
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/default.nix26
1 files changed, 19 insertions, 7 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 5bb63f1b815d..90770e9dddc0 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -26,13 +26,25 @@ let {
     # stdenv and its shell.
     // {
     
-      mkDerivation = attrs: derivation (attrs // {
-        builder = if attrs ? realBuilder then attrs.realBuilder else shell;
-        args = if attrs ? args then attrs.args else
-          ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
-        stdenv = body;
-        system = body.system;
-      });
+      mkDerivation = attrs:
+        (derivation (
+          (removeAttrs attrs ["meta"])
+          //
+          {
+            builder = if attrs ? realBuilder then attrs.realBuilder else shell;
+            args = if attrs ? args then attrs.args else
+              ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
+            stdenv = body;
+            system = body.system;
+          })
+        )
+        //
+        # The meta attribute is passed in the resulting attribute set,
+        # but it's not part of the actual derivation, i.e., it's not
+        # passed to the builder and is not a dependency.  But since we
+        # include it in the result, it *is* available to nix-env for
+        # queries.
+        { meta = if attrs ? meta then attrs.meta else {}; };
 
     }