summary refs log tree commit diff
path: root/pkgs/lib/misc.nix
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2013-05-05 17:05:59 +0200
committerEvgeny Egorochkin <phreedom@yandex.ru>2013-05-08 15:43:07 +0300
commitb50b9bf2b710205a98de6e3ab88c3c1b7220e52f (patch)
tree53ac2dec7979f092fd0be0a8dccee2886dd167e2 /pkgs/lib/misc.nix
parente0fab80c27377edab687b72e4383dc0022c9cde0 (diff)
downloadnixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.tar
nixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.tar.gz
nixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.tar.bz2
nixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.tar.lz
nixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.tar.xz
nixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.tar.zst
nixpkgs-b50b9bf2b710205a98de6e3ab88c3c1b7220e52f.zip
add versionedDerivation
Diffstat (limited to 'pkgs/lib/misc.nix')
-rw-r--r--pkgs/lib/misc.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix
index bd57d2b6518..19e5081009d 100644
--- a/pkgs/lib/misc.nix
+++ b/pkgs/lib/misc.nix
@@ -321,12 +321,12 @@ rec {
   #
   # This function is best explained by an example:
   #
-  #     {version ? "2.0"} :
+  #     {version ? "2.x"} :
   #
   #     mkDerivation (mergeAttrsByVersion "package-name" version 
   #       { # version specific settings
   #         "git" = { src = ..; preConfigre = "autogen.sh"; buildInputs = [automake autoconf libtool];  };
-  #         "2.0" = { src = ..; };
+  #         "2.x" = { src = ..; };
   #       }
   #       {  // shared settings
   #          buildInputs = [ common build inputs ];
@@ -347,7 +347,12 @@ rec {
   # Very often it just happens that the "shared" code is the bigger part.
   # Then using this function might be appropriate.
   #
-  # Be aware that its easy to cause recompilations in all versions when using this function
+  # Be aware that its easy to cause recompilations in all versions when using
+  # this function - also if derivations get too complex splitting into multiple
+  # files is the way to go.
+  #
+  # See misc.nix -> versionedDerivation
+  # discussion: nixpkgs: pull/310
   mergeAttrsByVersion = name: version: attrsByVersion: base:
     mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; } base (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)];