about summary refs log tree commit diff
path: root/pkgs/top-level/guile-2-test.nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-09-19 21:44:50 +0000
committerLudovic Courtès <ludo@gnu.org>2009-09-19 21:44:50 +0000
commit9d9fa8dd553da56b2777605f5ec363f55c43b0cb (patch)
tree8da0225992bae85372652669c7b86f7bc0469be1 /pkgs/top-level/guile-2-test.nix
parent12468cc5c8245820a95bb5f91a59548992c3bbc6 (diff)
downloadnixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.tar
nixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.tar.gz
nixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.tar.bz2
nixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.tar.lz
nixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.tar.xz
nixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.tar.zst
nixlib-9d9fa8dd553da56b2777605f5ec363f55c43b0cb.zip
guile-2-test: Attempt to provide Hydra with what it wants.
Thanks to Michael Raskin!

svn path=/nixpkgs/trunk/; revision=17280
Diffstat (limited to 'pkgs/top-level/guile-2-test.nix')
-rw-r--r--pkgs/top-level/guile-2-test.nix25
1 files changed, 23 insertions, 2 deletions
diff --git a/pkgs/top-level/guile-2-test.nix b/pkgs/top-level/guile-2-test.nix
index ffa216e8ef61..43aa862f54fc 100644
--- a/pkgs/top-level/guile-2-test.nix
+++ b/pkgs/top-level/guile-2-test.nix
@@ -12,9 +12,30 @@ let
     };
   };
 
+  /* Perform a job on the given set of platforms.  The function `f' is
+     called by Hydra for each platform, and should return some job
+     to build on that platform.  `f' is passed the Nixpkgs collection
+     for the platform in question. */
+  testOn = systems: f: {system ? builtins.currentSystem}:
+    if pkgs.lib.elem system systems
+    then f (allPackages {inherit system;})
+    else {};
+
+  /* Map an attribute of the form `foo = [platforms...]'  to `testOn
+     [platforms...] (pkgs: pkgs.foo)'. */
+  mapTestOn = pkgs.lib.mapAttrsRecursiveCond
+    (as: !(as ? type && as.type == "job"))
+    (path: value:
+      let
+        job = toJob value;
+        getPkg = pkgs:
+          pkgs.lib.addMetaAttrs { schedulingPriority = toString job.schedulingPriority; }
+          (pkgs.lib.getAttrFromPath path pkgs);
+      in testOn job.systems getPkg);
+
   inherit (pkgs.lib.platforms) linux darwin cygwin allBut all;
 
-in {
+in (mapTestOn {
   /* The package list below was obtained with:
 
      cat top-level/all-packages.nix				\
@@ -43,4 +64,4 @@ in {
   ballAndPaddle = linux;
   drgeo = linux;
   lilypond = linux;
-}
+})