@@ -309,48 +309,6 @@ rec {
309309 mergeAttrsByFuncDefaults = foldl mergeAttrByFunc { inherit mergeAttrBy; };
310310 mergeAttrsByFuncDefaultsClean = list: removeAttrs (mergeAttrsByFuncDefaults list) ["mergeAttrBy"];
311311
312− # merge attrs based on version key into mkDerivation args, see mergeAttrBy to learn about smart merge defaults
313− #
314− # This function is best explained by an example:
315− #
316− # {version ? "2.x"}:
317− #
318− # mkDerivation (mergeAttrsByVersion "package-name" version
319− # { # version specific settings
320− # "git" = { src = ..; preConfigre = "autogen.sh"; buildInputs = [automake autoconf libtool]; };
321− # "2.x" = { src = ..; };
322− # }
323− # { // shared settings
324− # buildInputs = [ common build inputs ];
325− # meta = { .. }
326− # }
327− # )
328− #
329− # Please note that e.g. Eelco Dolstra usually prefers having one file for
330− # each version. On the other hand there are valuable additional design goals
331− # - readability
332− # - do it once only
333− # - try to avoid duplication
334− #
335− # Marc Weber and Michael Raskin sometimes prefer keeping older
336− # versions around for testing and regression tests - as long as its cheap to
337− # do so.
338− #
339− # Very often it just happens that the "shared" code is the bigger part.
340− # Then using this function might be appropriate.
341− #
342− # Be aware that its easy to cause recompilations in all versions when using
343− # this function - also if derivations get too complex splitting into multiple
344− # files is the way to go.
345− #
346− # See misc.nix -> versionedDerivation
347− # discussion: nixpkgs: pull/310
348− mergeAttrsByVersion = name: version: attrsByVersion: base:
349− mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; }
350− base
351− (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)
352− ];
353−
354312 # sane defaults (same name as attr name so that inherit can be used)
355313 mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }
356314 listToAttrs (map (n: nameValuePair n lib.concat)