diff --git a/pkgs/top-level/guile-2-test.nix b/pkgs/top-level/guile-2-test.nix index ffa216e8ef6..43aa862f54f 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; -} +})