Skip to content

Commit ee9c33c

Browse files
authored
add iog tooling (#176)
* add iog tooling * adding python3 * separate tooling from IOG
1 parent 3493951 commit ee9c33c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

dynamic.nix

Lines changed: 15 additions & 2 deletions
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,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

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)