* 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
This commit is contained in:
Eelco Dolstra 2006-03-10 16:12:46 +00:00
parent 4c63a4a97a
commit baec8f5b38
8 changed files with 50 additions and 7 deletions

View file

@ -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)";
};
}

View file

@ -15,4 +15,8 @@ stdenv.mkDerivation {
inherit gtk;
patches = [./writable-copies.patch];
meta = {
description = "Mozilla Firefox - the browser, reloaded";
};
}

View file

@ -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";
};
}

View file

@ -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";
};
}

View file

@ -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 + ")";
};
}

View file

@ -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";
};
}

View file

@ -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";
};
}

View file

@ -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 {}; };
}