Skip to content

Commit 3aff824

Browse files
committed
Use -package ghc when building Setup.hs
1 parent af03ecc commit 3aff824

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builder/setup-builder.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ let
1919
};
2020
in map ({val,...}: val) closure;
2121

22+
includeGhcPackage = lib.any (p: p.identifier.name == "ghc") setup-depends;
23+
2224
configFiles = runCommand "${fullName}-config" { nativeBuildInputs = [ghc]; } (''
2325
mkdir -p $out
2426
@@ -91,7 +93,8 @@ stdenv.mkDerivation {
9193
for f in Setup.hs Setup.lhs; do
9294
if [ -f $f ]; then
9395
echo Compiling package $f
94-
ghc $f --make -o ./Setup
96+
ghc $f '' + (if includeGhcPackage then "-package ghc " else "")
97+
+ ''--make -o ./Setup
9598
setup=$(pwd)/Setup
9699
fi
97100
done

0 commit comments

Comments
 (0)