git.iko.soy/typeable/nixpkgs
on master help sign in
* 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

commitbaec8f5b38e83a456eebdf742834efc2c22386c6 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateFri 10 Mar 2006, 16:12 (21 years ago) parent4c63a4a
8 files changed+50−7
pkgs/applications/networking/browsers/firefox-wrapper/default.nix+4 pkgs/applications/networking/browsers/firefox/default.nix+4 pkgs/build-support/gcc-cross-wrapper/default.nix+3 pkgs/build-support/gcc-wrapper/default.nix+3 pkgs/development/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+19−7
pkgs/applications/networking/browsers/firefox-wrapper/default.nix+4
@@ -11,4 +11,8 @@ stdenv.mkDerivation {
1111 # Let each plugin tell us (through its `mozillaPlugin') attribute
1212 # where to find the plugin in its tree.
1313 plugins = map (x: x ~ x.mozillaPlugin) plugins;
14+
15+ meta = {
16+ description = firefox.meta.description + " (with various plugins)";
17+ };
1418}
pkgs/applications/networking/browsers/firefox/default.nix+4
@@ -15,4 +15,8 @@ stdenv.mkDerivation {
1515 inherit gtk;
1616
1717 patches = [./writable-copies.patch];
18+
19+ meta = {
20+ description = "Mozilla Firefox - the browser, reloaded";
21+ };
1822}
pkgs/build-support/gcc-cross-wrapper/default.nix+3
@@ -27,4 +27,7 @@ stdenv.mkDerivation {
2727 langCC = if nativeTools then true else gcc.langCC;
2828 langF77 = if nativeTools then false else gcc.langF77;
2929 shell = if shell == "" then stdenv.shell else shell;
30+ meta = if gcc != null then gcc.meta else
31+ { description = "System C compiler wrapper";
32+ };
3033}
pkgs/build-support/gcc-wrapper/default.nix+3
@@ -27,4 +27,7 @@ stdenv.mkDerivation {
2727 langCC = if nativeTools then true else gcc.langCC;
2828 langF77 = if nativeTools then false else gcc.langF77;
2929 shell = if shell == "" then stdenv.shell else shell;
30+ meta = if gcc != null then gcc.meta else
31+ { description = "System C compiler wrapper";
32+ };
3033}
pkgs/development/compilers/gcc-4.0-cross/default.nix+6
@@ -26,4 +26,10 @@ stdenv.mkDerivation {
2626 buildInputs = [binutilsCross];
2727 inherit kernelHeadersCross binutilsCross;
2828 platform = cross;
29+
30+ meta = {
31+ homepage = "http://gcc.gnu.org/";
32+ license = "GPL/LGPL";
33+ description = "GNU Compiler Collection, 4.0.x (cross-compiler for " + cross + ")";
34+ };
2935}
pkgs/development/compilers/gcc-4.0/default.nix+6
@@ -15,4 +15,10 @@ stdenv.mkDerivation {
1515 # !!! apply only if noSysDirs is set
1616 patches = [./no-sys-dirs.patch];
1717 inherit noSysDirs langC langCC langF77 profiledCompiler;
18+
19+ meta = {
20+ homepage = "http://gcc.gnu.org/";
21+ license = "GPL/LGPL";
22+ description = "GNU Compiler Collection, 4.0.x";
23+ };
1824}
pkgs/development/libraries/aterm/aterm-2.4.nix+5
@@ -6,4 +6,9 @@ stdenv.mkDerivation {
66 url = http://nix.cs.uu.nl/dist/tarballs/aterm-2.4.2.tar.gz;
77 md5 = "18617081dd112d85e6c4b1b552628114";
88 };
9+ meta = {
10+ homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm;
11+ license = "LGPL";
12+ description = "Library for manipulation of term data structures in C";
13+ };
914}
pkgs/stdenv/generic/default.nix+19−7
@@ -26,13 +26,25 @@ let {
2626 # stdenv and its shell.
2727 // {
2828
29− mkDerivation = attrs: derivation (attrs // {
30− builder = if attrs ? realBuilder then attrs.realBuilder else shell;
31− args = if attrs ? args then attrs.args else
32− ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
33− stdenv = body;
34− system = body.system;
35− });
29+ mkDerivation = attrs:
30+ (derivation (
31+ (removeAttrs attrs ["meta"])
32+ //
33+ {
34+ builder = if attrs ? realBuilder then attrs.realBuilder else shell;
35+ args = if attrs ? args then attrs.args else
36+ ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
37+ stdenv = body;
38+ system = body.system;
39+ })
40+ )
41+ //
42+ # The meta attribute is passed in the resulting attribute set,
43+ # but it's not part of the actual derivation, i.e., it's not
44+ # passed to the builder and is not a dependency. But since we
45+ # include it in the result, it *is* available to nix-env for
46+ # queries.
47+ { meta = if attrs ? meta then attrs.meta else {}; };
3648
3749 }
3850