@@ -28,7 +28,8 @@ with haskellLib;
2828 tys;
2929 in libComp (subComps z);
3030
31− getAllComponents = foldComponents subComponentTypes (c: acc: [c] ++ acc) [];
31+ getAllComponents = foldComponents subComponentTypes (c: acc:
32+ lib.optional c.buildable c ++ acc) [];
3233
3334 componentPrefix = {
3435 # Are all of these right?
@@ -45,9 +46,12 @@ with haskellLib;
4546 applyLibrary = cname: f { cname = config.package.identifier.name; ctype = "lib"; };
4647 applySubComp = ctype: cname: f { inherit cname; ctype = componentPrefix.${ctype} or (throw "Missing component mapping for ${ctype}."); };
4748 applyAllComp = f { cname = config.package.identifier.name; ctype = "all"; };
48− libComp = if comps.library == null then {} else lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
49+ buildableAttrs = lib.filterAttrs (n: comp: comp.buildable or true);
50+ libComp = if comps.library == null || !(comps.library.buildable or true)
51+ then {}
52+ else lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
4953 subComps = lib.mapAttrs
50− (ctype: lib.mapAttrs (applySubComp ctype))
54+ (ctype: attrs: lib.mapAttrs (applySubComp ctype) (buildableAttrs attrs))
5155 (builtins.intersectAttrs (lib.genAttrs subComponentTypes (_: null)) comps);
5256 allComp = { all = applyAllComp comps.all; };
5357 in subComps // libComp // allComp;