1
1
# 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 } :
3
3
let tool-version-map = import ./tool-map.nix ;
4
4
tool = tool-name : pkgs . pkgsBuildBuild . haskell-nix . tool compiler-nix-name tool-name [ ( tool-version-map compiler-nix-name tool-name ) toolsModule ] ;
5
5
cabal-install = pkgs . pkgsBuildBuild . haskell-nix . nix-tools-unchecked . exes . cabal ;
@@ -64,6 +64,7 @@ pkgs.mkShell {
64
64
+ lib . optionalString ( ! withHLS && ! withHlint ) "-minimal"
65
65
+ lib . optionalString withIOG "-iog"
66
66
+ lib . optionalString withIOGFull "-full"
67
+ + lib . optionalString withGHCTooling "-ghc"
67
68
;
68
69
in ''
69
70
export PS1="\[\033[01;33m\][\w]$\[\033[00m\] "
@@ -81,6 +82,14 @@ pkgs.mkShell {
81
82
+ lib . optionalString stdenv . hostPlatform . isMacOS
82
83
''
83
84
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"
84
93
'' ;
85
94
86
95
buildInputs =
@@ -118,7 +127,11 @@ pkgs.mkShell {
118
127
[ postgresql ] ++ ( optional stdenv . hostPlatform . isAarch64 R )
119
128
)
120
129
++ attrValues haskell-tools
121
- ) ;
130
+ )
131
+ ++ optionals withGHCTooling (
132
+ with pkgs ; [ python3 automake autoconf alex happy ]
133
+ )
134
+ ;
122
135
123
136
passthru = {
124
137
plans = if haskell-tools == { } then { } else
0 commit comments