diff options
author | Eelco Dolstra | 2006-03-10 16:12:46 +0000 |
---|---|---|
committer | Eelco Dolstra | 2006-03-10 16:12:46 +0000 |
commit | baec8f5b38e83a456eebdf742834efc2c22386c6 (patch) | |
tree | ecd654568b44dba0a8a0fb0c6abebbc7b1c5feda | |
parent | 4c63a4a97a56d992ccc83e77ce477d3b22906240 (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
8 files changed, 50 insertions, 7 deletions
diff --git a/pkgs/applications/networking/browsers/firefox-wrapper/default.nix b/pkgs/applications/networking/browsers/firefox-wrapper/default.nix index c806d88c80a3..909a52d0a417 100644 --- a/pkgs/applications/networking/browsers/firefox-wrapper/default.nix +++ b/pkgs/applications/networking/browsers/firefox-wrapper/default.nix @@ -11,4 +11,8 @@ stdenv.mkDerivation { # Let each plugin tell us (through its `mozillaPlugin') attribute # where to find the plugin in its tree. plugins = map (x: x ~ x.mozillaPlugin) plugins; + + meta = { + description = firefox.meta.description + " (with various plugins)"; + }; } diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix index a620a2b39b37..55ef8813e4b6 100644 --- a/pkgs/applications/networking/browsers/firefox/default.nix +++ b/pkgs/applications/networking/browsers/firefox/default.nix @@ -15,4 +15,8 @@ stdenv.mkDerivation { inherit gtk; patches = [./writable-copies.patch]; + + meta = { + description = "Mozilla Firefox - the browser, reloaded"; + }; } diff --git a/pkgs/build-support/gcc-cross-wrapper/default.nix b/pkgs/build-support/gcc-cross-wrapper/default.nix index 0ceab44ee27c..09f7f006928e 100644 --- a/pkgs/build-support/gcc-cross-wrapper/default.nix +++ b/pkgs/build-support/gcc-cross-wrapper/default.nix @@ -27,4 +27,7 @@ stdenv.mkDerivation { langCC = if nativeTools then true else gcc.langCC; langF77 = if nativeTools then false else gcc.langF77; shell = if shell == "" then stdenv.shell else shell; + meta = if gcc != null then gcc.meta else + { description = "System C compiler wrapper"; + }; } diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index 4296aef67c8b..22d023951293 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -27,4 +27,7 @@ stdenv.mkDerivation { langCC = if nativeTools then true else gcc.langCC; langF77 = if nativeTools then false else gcc.langF77; shell = if shell == "" then stdenv.shell else shell; + meta = if gcc != null then gcc.meta else + { description = "System C compiler wrapper"; + }; } diff --git a/pkgs/development/compilers/gcc-4.0-cross/default.nix b/pkgs/development/compilers/gcc-4.0-cross/default.nix index a31353e2d233..ecae99ceeee4 100644 --- a/pkgs/development/compilers/gcc-4.0-cross/default.nix +++ b/pkgs/development/compilers/gcc-4.0-cross/default.nix @@ -26,4 +26,10 @@ stdenv.mkDerivation { buildInputs = [binutilsCross]; inherit kernelHeadersCross binutilsCross; platform = cross; + + meta = { + homepage = "http://gcc.gnu.org/"; + license = "GPL/LGPL"; + description = "GNU Compiler Collection, 4.0.x (cross-compiler for " + cross + ")"; + }; } diff --git a/pkgs/development/compilers/gcc-4.0/default.nix b/pkgs/development/compilers/gcc-4.0/default.nix index bed212e964b6..8363c10edb42 100644 --- a/pkgs/development/compilers/gcc-4.0/default.nix +++ b/pkgs/development/compilers/gcc-4.0/default.nix @@ -15,4 +15,10 @@ stdenv.mkDerivation { # !!! apply only if noSysDirs is set patches = [./no-sys-dirs.patch]; inherit noSysDirs langC langCC langF77 profiledCompiler; + + meta = { + homepage = "http://gcc.gnu.org/"; + license = "GPL/LGPL"; + description = "GNU Compiler Collection, 4.0.x"; + }; } diff --git a/pkgs/development/libraries/aterm/aterm-2.4.nix b/pkgs/development/libraries/aterm/aterm-2.4.nix index a4a802471feb..c367b4b90549 100644 --- a/pkgs/development/libraries/aterm/aterm-2.4.nix +++ b/pkgs/development/libraries/aterm/aterm-2.4.nix @@ -6,4 +6,9 @@ stdenv.mkDerivation { url = http://nix.cs.uu.nl/dist/tarballs/aterm-2.4.2.tar.gz; md5 = "18617081dd112d85e6c4b1b552628114"; }; + meta = { + homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm; + license = "LGPL"; + description = "Library for manipulation of term data structures in C"; + }; } 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 {}; }; } |