Skip to content

Commit 860c0e1

Browse files
committed
add iog tooling
1 parent 3493951 commit 860c0e1

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

dynamic.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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 }:
33
let 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,6 +127,9 @@ pkgs.mkShell {
118127
[ postgresql ] ++ (optional stdenv.hostPlatform.isAarch64 R)
119128
)
120129
++ attrValues haskell-tools
130+
++ optionals withGHCTooling (
131+
with pkgs; [ automake autoconf alex happy ]
132+
)
121133
);
122134

123135
passthru = {

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
pkgs.lib.nameValuePair "${short-name}-minimal" (
117117
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; })
118118
)) (compilers pkgs)
119+
// pkgs.lib.mapAttrs' (short-name: args:
120+
pkgs.lib.nameValuePair "${short-name}-minimal-ghc" (
121+
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; withGHCTooling = true; })
122+
)) (compilers pkgs)
119123
// pkgs.lib.mapAttrs' (short-name: args:
120124
pkgs.lib.nameValuePair "${short-name}-static" (
121125
import ./static.nix (args // { withIOG = false; })

0 commit comments

Comments
 (0)