@@ -6,15 +6,6 @@ let
6 echo "${field}: ${lib.concatStringsSep " " xs}" >> $out/cabal.config
6 echo "${field}: ${lib.concatStringsSep " " xs}" >> $out/cabal.config
9− flatDepends = component:
11− makePairs = map (p: rec { key="${val}"; val=(p.components.library or p); });
12− closure = builtins.genericClosure {
13− startSet = makePairs component.depends;
14− operator = {val,...}: makePairs val.config.depends;
16− in map ({val,...}: val) closure;
18 exactDep = pdbArg: p: ''
9 exactDep = pdbArg: p: ''
19 if id=$(target-pkg ${pdbArg} field ${p} id --simple-output); then
10 if id=$(target-pkg ${pdbArg} field ${p} id --simple-output); then
20 echo "--dependency=${p}=$id" >> $out/configure-flags
11 echo "--dependency=${p}=$id" >> $out/configure-flags
@@ -58,7 +49,7 @@ in { identifier, component, fullName, flags ? {} }:
59 ${lib.concatMapStringsSep "\n" (p: ''
50 ${lib.concatMapStringsSep "\n" (p: ''
60 target-pkg --package-db ${p}/package.conf.d dump | target-pkg --force --package-db $out/package.conf.d register -
51 target-pkg --package-db ${p}/package.conf.d dump | target-pkg --force --package-db $out/package.conf.d register -
61− '') (flatDepends component)}
52+ '') (haskellLib.flatLibDepends component)}
63 # Note: we pass `clear` first to ensure that we never consult the implicit global package db.
54 # Note: we pass `clear` first to ensure that we never consult the implicit global package db.
64 ${flagsAndConfig "package-db" ["clear" "$out/package.conf.d"]}
55 ${flagsAndConfig "package-db" ["clear" "$out/package.conf.d"]}