| 
1 | 1 | { stdenv, lib, haskellLib, ghc, nonReinstallablePkgs, runCommand, writeText, writeScript }@defaults:  | 
2 | 2 | 
 
  | 
3 |  | -{ identifier, component, fullName, flags ? {}, needsProfiling ? false, enableDWARF ? false, chooseDrv ? drv: drv, nonReinstallablePkgs ? defaults.nonReinstallablePkgs }:  | 
 | 3 | +{ identifier, component, fullName, flags ? {}, needsProfiling ? false, enableDWARF ? false, chooseDrv ? drv: drv, nonReinstallablePkgs ? defaults.nonReinstallablePkgs, prebuilt-depends ? [] }:  | 
4 | 4 | 
 
  | 
5 | 5 | let  | 
6 | 6 |   # Sort and remove duplicates from nonReinstallablePkgs.  | 
 | 
57 | 57 |       ((if needsProfiling then (x: map (p: p.profiled or p) x) else x: x)  | 
58 | 58 |       (map haskellLib.dependToLib component.depends))  | 
59 | 59 |     )  | 
60 |  | -  );  | 
 | 60 | +  ) ++ prebuilt-depends;  | 
61 | 61 |   script = ''  | 
62 | 62 |     ${target-pkg} init $configFiles/${packageCfgDir}  | 
63 | 63 | 
  | 
 | 
149 | 149 |       echo "allow-older: ${identifier.name}:*" >> $configFiles/cabal.config  | 
150 | 150 |     ''}  | 
151 | 151 | 
  | 
152 |  | -    for p in "''${pkgsHostTarget[@]}"; do  | 
153 |  | -      if [ -e $p/envDep ]; then  | 
154 |  | -        cat $p/envDep >> $configFiles/ghc-environment  | 
155 |  | -      fi  | 
156 |  | -      ${ lib.optionalString component.doExactConfig ''  | 
157 |  | -        if [ -d $p/exactDep ]; then  | 
158 |  | -          cat $p/exactDep/configure-flags >> $configFiles/configure-flags  | 
159 |  | -          cat $p/exactDep/cabal.config >> $configFiles/cabal.config  | 
160 |  | -        fi  | 
161 |  | -      ''}  | 
162 |  | -    done  | 
163 | 152 |     for p in ${lib.concatStringsSep " " nonReinstallablePkgs'}; do  | 
164 | 153 |       if [ -e $ghcDeps/envDeps/$p ]; then  | 
165 | 154 |         cat $ghcDeps/envDeps/$p >> $configFiles/ghc-environment  | 
 | 
172 | 161 |         cat $ghcDeps/exactDeps/$p/cabal.config >> $configFiles/cabal.config  | 
173 | 162 |       fi  | 
174 | 163 |     done  | 
 | 164 | +  '' + ''  | 
 | 165 | +    for p in "''${pkgsHostTarget[@]}"; do  | 
 | 166 | +      if [ -e $p/envDep ]; then  | 
 | 167 | +        cat $p/envDep >> $configFiles/ghc-environment  | 
 | 168 | +      fi  | 
 | 169 | +      ${ lib.optionalString component.doExactConfig ''  | 
 | 170 | +        if [ -d $p/exactDep ]; then  | 
 | 171 | +          cat $p/exactDep/configure-flags >> $configFiles/configure-flags  | 
 | 172 | +          cat $p/exactDep/cabal.config >> $configFiles/cabal.config  | 
 | 173 | +        fi  | 
 | 174 | +      ''}  | 
 | 175 | +    done  | 
175 | 176 |   ''  | 
176 | 177 |   # This code originates in the `generic-builder.nix` from nixpkgs.  However GHC has been fixed  | 
177 | 178 |   # to drop unused libraries referenced from libraries; and this patch is usually included in the  | 
 | 
0 commit comments