From baec8f5b38e83a456eebdf742834efc2c22386c6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 10 Mar 2006 16:12:46 +0000 Subject: * 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 --- .../browsers/firefox-wrapper/default.nix | 4 ++++ .../networking/browsers/firefox/default.nix | 4 ++++ pkgs/build-support/gcc-cross-wrapper/default.nix | 3 +++ pkgs/build-support/gcc-wrapper/default.nix | 3 +++ .../compilers/gcc-4.0-cross/default.nix | 6 +++++ pkgs/development/compilers/gcc-4.0/default.nix | 6 +++++ pkgs/development/libraries/aterm/aterm-2.4.nix | 5 +++++ pkgs/stdenv/generic/default.nix | 26 ++++++++++++++++------ 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 c806d88c80a3e..909a52d0a417b 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 a620a2b39b373..55ef8813e4b64 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 0ceab44ee27c3..09f7f006928e3 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 4296aef67c8bc..22d0239512930 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 a31353e2d233b..ecae99ceeee45 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 bed212e964b61..8363c10edb422 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 a4a802471feb4..c367b4b90549a 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 5bb63f1b815dd..90770e9dddc06 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 {}; }; } -- cgit 1.4.1