11# define a development shell for dynamically linked applications (default)
2- { self , pkgs , compiler , compiler-nix-name , toolsModule , withHLS ? true , withHlint ? true , withIOG ? true , withIOGFull ? false } :
2+ { self , pkgs , compiler , compiler-nix-name , toolsModule , withHLS ? true , withHlint ? true , withIOG ? true , withIOGFull ? false , withGHCTooling ? false } :
33let tool-version-map = import ./tool-map.nix ;
44 tool = tool-name : pkgs . pkgsBuildBuild . haskell-nix . tool compiler-nix-name tool-name [ ( tool-version-map compiler-nix-name tool-name ) toolsModule ] ;
55 cabal-install = pkgs . pkgsBuildBuild . haskell-nix . nix-tools-unchecked . exes . cabal ;
@@ -64,6 +64,7 @@ pkgs.mkShell {
6464 + lib . optionalString ( ! withHLS && ! withHlint ) "-minimal"
6565 + lib . optionalString withIOG "-iog"
6666 + lib . optionalString withIOGFull "-full"
67+ + lib . optionalString withGHCTooling "-ghc"
6768 ;
6869 in ''
6970 export PS1="\[\033[01;33m\][\w]$\[\033[00m\] "
@@ -81,6 +82,14 @@ pkgs.mkShell {
8182 + lib . optionalString stdenv . hostPlatform . isMacOS
8283 ''
8384 export DYLD_LIBRARY_PATH="${ lib . getLib openssl } /lib"
85+ ''
86+ + lib . optionalString withGHCTooling ''
87+ export HADRIAN_CONFIGURE_FLAGS=--with-gmp-includes="${ lib . getDev gmp } /include" --with-gmp-libraries="${ lib . getLib gmp } /lib"
88+ echo "HADRIAN_CONFIGURE_FLAGS set to $HADRIAN_CONFIGURE_FLAGS"
89+ echo "To build GHC, run"
90+ echo " ./boot"
91+ echo " ./configure \"$HADRIAN_CONFIGURE_FLAGS\""
92+ echo " ./hadrian/build -j"
8493 '' ;
8594
8695 buildInputs =
@@ -118,7 +127,11 @@ pkgs.mkShell {
118127 [ postgresql ] ++ ( optional stdenv . hostPlatform . isAarch64 R )
119128 )
120129 ++ attrValues haskell-tools
121- ) ;
130+ )
131+ ++ optionals withGHCTooling (
132+ with pkgs ; [ python3 automake autoconf alex happy ]
133+ )
134+ ;
122135
123136 passthru = {
124137 plans = if haskell-tools == { } then { } else
0 commit comments