summary refs log tree commit diff
path: root/pkgs/top-level/release-lib.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-20 17:05:30 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-20 19:33:08 +0100
commitb981eb3f7b96a6feef12aad0c26bc27f364427a8 (patch)
treeb599656a20816d067baae34193d7eab0c443acff /pkgs/top-level/release-lib.nix
parentef0e4d56f57b936aa2f15ecea730bdeb53837c0f (diff)
downloadnixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.tar
nixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.tar.gz
nixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.tar.bz2
nixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.tar.lz
nixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.tar.xz
nixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.tar.zst
nixlib-b981eb3f7b96a6feef12aad0c26bc27f364427a8.zip
release-lib.nix: Style cleanup
Diffstat (limited to 'pkgs/top-level/release-lib.nix')
-rw-r--r--pkgs/top-level/release-lib.nix42
1 files changed, 21 insertions, 21 deletions
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index 5ee574bbabfe..a5a74de66907 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -1,5 +1,7 @@
 { supportedSystems, packageSet ? (import ./all-packages.nix) }:
 
+with import ../../lib;
+
 rec {
 
   # Ensure that we don't build packages marked as unfree.
@@ -7,7 +9,7 @@ rec {
     config.allowUnfree = false;
   });
 
-  pkgs = allPackages { system = "x86_64-linux"; };
+  pkgs = pkgsFor "x86_64-linux";
 
 
   /* !!! Hack: poor man's memoisation function.  Necessary to prevent
@@ -33,10 +35,10 @@ rec {
   /* The working or failing mails for cross builds will be sent only to
      the following maintainers, as most package maintainers will not be
      interested in the result of cross building a package. */
-  crossMaintainers = with pkgs.lib.maintainers; [ viric ];
+  crossMaintainers = [ maintainers.viric ];
 
 
-  toJob = x: if builtins.isAttrs x then x else
+  toJob = x: if isAttrs x then x else
     { type = "job"; systems = x; };
 
 
@@ -45,8 +47,8 @@ rec {
      platform as an argument .  We return an attribute set containing
      a derivation for each supported platform, i.e. ‘{ x86_64-linux =
      f pkgs_x86_64_linux; i686-linux = f pkgs_i686_linux; ... }’. */
-  testOn = systems: f: pkgs.lib.genAttrs
-    (pkgs.lib.filter (x: pkgs.lib.elem x supportedSystems) systems)
+  testOn = systems: f: genAttrs
+    (filter (x: elem x supportedSystems) systems)
     (system: f (pkgsFor system));
 
 
@@ -54,62 +56,60 @@ rec {
      'crossSystem' parameter for allPackages, defining the target
      platform for cross builds. */
   testOnCross = crossSystem: systems: f: {system ? builtins.currentSystem}:
-    if pkgs.lib.elem system systems
+    if elem system systems
     then f (allPackages { inherit system crossSystem; })
     else {};
 
 
   /* Map an attribute of the form `foo = [platforms...]'  to `testOn
      [platforms...] (pkgs: pkgs.foo)'. */
-  mapTestOn = pkgs.lib.mapAttrsRecursiveCond
+  mapTestOn = mapAttrsRecursiveCond
     (as: as.type or "" != "job")
     (path: value:
       let
         job = toJob value;
-        getPkg = pkgs: pkgs.lib.getAttrFromPath path pkgs;
+        getPkg = pkgs: getAttrFromPath path pkgs;
       in testOn job.systems getPkg);
 
 
   /* Similar to the testOn function, but with an additional 'crossSystem'
    * parameter for allPackages, defining the target platform for cross builds,
    * and triggering the build of the host derivation (cross built - crossDrv). */
-  mapTestOnCross = crossSystem: pkgs.lib.mapAttrsRecursiveCond
+  mapTestOnCross = crossSystem: mapAttrsRecursiveCond
     (as: as.type or "" != "job")
     (path: value:
       let
         job = toJob value;
-        getPkg = pkgs: pkgs.lib.addMetaAttrs { maintainers = crossMaintainers; }
-          (pkgs.lib.getAttrFromPath path pkgs);
+        getPkg = pkgs: addMetaAttrs { maintainers = crossMaintainers; }
+          (getAttrFromPath path pkgs);
       in testOnCross crossSystem job.systems getPkg);
 
 
   /* Find all packages that have a meta.platforms field listing the
      supported platforms. */
   packagesWithMetaPlatform = attrSet:
-    let pairs = pkgs.lib.concatMap
+    let pairs = concatMap
       (x:
         let pair = builtins.tryEval
               (let
-                 attrVal = (builtins.getAttr x attrSet);
+                 attrVal = attrSet.${x};
                in
                  { val = processPackage attrVal;
                    attrVal = attrVal;
-                   attrValIsAttrs = builtins.isAttrs attrVal;
+                   attrValIsAttrs = isAttrs attrVal;
                  });
             success = (builtins.tryEval pair.value.attrVal).success;
         in
-        pkgs.lib.optional (success && pair.value.attrValIsAttrs && pair.value.val != [])
+        optional (success && pair.value.attrValIsAttrs && pair.value.val != [])
           { name = x; value = pair.value.val; })
-      (builtins.attrNames attrSet);
+      (attrNames attrSet);
     in
-      builtins.listToAttrs pairs;
+      listToAttrs pairs;
 
 
   # May fail as much as it wishes, we will catch the error.
   processPackage = attrSet:
-    if attrSet.recurseForDerivations or false then
-      packagesWithMetaPlatform attrSet
-    else if attrSet.recurseForRelease or false then
+    if attrSet.recurseForDerivations or false || attrSet.recurseForRelease or false then
       packagesWithMetaPlatform attrSet
     else if attrSet.meta.broken or false then
       []
@@ -118,7 +118,7 @@ rec {
 
 
   /* Common platform groups on which to test packages. */
-  inherit (pkgs.lib.platforms) unix linux darwin cygwin allBut all mesaPlatforms;
+  inherit (platforms) unix linux darwin cygwin allBut all mesaPlatforms;
 
   /* Platform groups for specific kinds of applications. */
   x11Supported = linux;