on iko/ghcjs-patch-master help sign in
Support library-less cabal files.
696f22dMoritz Angermann
lib/default.nix+1−1
@@ -44,7 +44,7 @@ with haskellLib;
44 applyLibrary = cname: f { cname = config.package.identifier.name; ctype = "lib"; };
44 applyLibrary = cname: f { cname = config.package.identifier.name; ctype = "lib"; };
45 applySubComp = ctype: cname: f { inherit cname; ctype = componentPrefix.${ctype}; };
45 applySubComp = ctype: cname: f { inherit cname; ctype = componentPrefix.${ctype}; };
46 applyAllComp = f { cname = config.package.identifier.name; ctype = "all"; };
46 applyAllComp = f { cname = config.package.identifier.name; ctype = "all"; };
47− libComp = lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
47+ libComp = if comps.library == null then {} else lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
48 subComps = lib.mapAttrs
48 subComps = lib.mapAttrs
49 (ctype: lib.mapAttrs (applySubComp ctype))
49 (ctype: lib.mapAttrs (applySubComp ctype))
50 (builtins.intersectAttrs (lib.genAttrs subComponentTypes (_: null)) comps);
50 (builtins.intersectAttrs (lib.genAttrs subComponentTypes (_: null)) comps);
modules/package.nix+2−1
@@ -160,7 +160,8 @@ in {
160 };
160 };
161 in {
161 in {
162 library = mkOption {
162 library = mkOption {
163− type = componentType;
163+ type = nullOr componentType;
164+ default = null;
164 };
165 };
165 sublibs = mkOption {
166 sublibs = mkOption {
166 type = attrsOf componentType;
167 type = attrsOf componentType;