git.iko.soy/typeable/nixpkgs
on master help sign in
mergeAttrsByVersion, versionedDerivation: remove

obsolete and ancient

commitf48109387ab1179fa66e3ea0362f6755a3bb9006 authorRobin Gloster <mail@glob.in> dateFri 11 Aug 2017, 23:13 (9 years ago) parent6c1528c
3 files changed−48
lib/deprecated.nix−42 pkgs/misc/misc.nix−5 pkgs/top-level/all-packages.nix−1
lib/deprecated.nix−42
@@ -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)
pkgs/misc/misc.nix−5
@@ -5,11 +5,6 @@ let inherit (pkgs) stdenv runCommand perl lib;
55in
66
77{
8−
9− # description see mergeAttrsByVersion in lib/misc.nix
10− versionedDerivation = name: version: attrsByVersion: base:
11− pkgs.stdenv.mkDerivation (stdenv.lib.mergeAttrsByVersion name version attrsByVersion base);
12−
138 /*
149 Usage example creating a derivation installing ruby, sup and a lib:
1510
pkgs/top-level/all-packages.nix−1
@@ -50,7 +50,6 @@ with pkgs;
5050 inherit lib config;
5151
5252 inherit (lib) lowPrio hiPrio appendToName makeOverridable;
53− inherit (misc) versionedDerivation;
5453
5554 # Applying this to an attribute set will cause nix-env to look
5655 # inside the set for derivations.