@@ -1,9 +1,10 @@
1−self: super: rec {
1+self: super: {
2+ haskell-nix = super.haskell-nix // rec {
23 # Use this to disable the existing haskell infra structure for testing purposes
3− haskell.compiler =
4+ compiler =
45 let bootPkgs = with self.buildPackages; {
5− ghc = buildPackages.bootstrap.haskell.compiler.ghc844;
6− inherit (bootstrap.haskell.packages) alex happy hscolour;
6+ ghc = buildPackages.haskell-nix.bootstrap.compiler.ghc844;
7+ inherit (bootstrap.packages) alex happy hscolour;
78 };
89 sphinx = with self.buildPackages; (python3Packages.sphinx_1_7_9 or python3Packages.sphinx);
910 hsc2hs-align-conditionals-patch = self.fetchpatch {
@@ -70,7 +71,7 @@ self: super: rec {
7071 ;
7172 in ({
7273 ghc844 = self.callPackage ../compiler/ghc {
73− extra-passthru = { buildGHC = self.buildPackages.haskell.compiler.ghc844; };
74+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc844; };
7475
7576 inherit bootPkgs sphinx;
7677
@@ -88,7 +89,7 @@ self: super: rec {
8889 ++ self.lib.optional self.stdenv.isDarwin ./patches/ghc/ghc-8.4.4-backport-dylib-command-size-limit.patch;
8990 };
9091 ghc861 = self.callPackage ../compiler/ghc {
91− extra-passthru = { buildGHC = self.buildPackages.haskell.compiler.ghc861; };
92+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc861; };
9293
9394 inherit bootPkgs sphinx;
9495
@@ -104,7 +105,7 @@ self: super: rec {
104105 ghc-patches = [ D5123-patch ];
105106 };
106107 ghc862 = self.callPackage ../compiler/ghc {
107− extra-passthru = { buildGHC = self.buildPackages.haskell.compiler.ghc862; };
108+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc862; };
108109
109110 inherit bootPkgs sphinx;
110111
@@ -121,7 +122,7 @@ self: super: rec {
121122 ++ [ D5123-patch ];
122123 };
123124 ghc863 = self.callPackage ../compiler/ghc {
124− extra-passthru = { buildGHC = self.buildPackages.haskell.compiler.ghc863; };
125+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc863; };
125126
126127 inherit bootPkgs sphinx;
127128
@@ -138,7 +139,7 @@ self: super: rec {
138139 ++ [ D5123-patch ];
139140 };
140141 ghc864 = self.callPackage ../compiler/ghc {
141− extra-passthru = { buildGHC = self.buildPackages.haskell.compiler.ghc864; };
142+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc864; };
142143
143144 inherit bootPkgs sphinx;
144145
@@ -155,7 +156,7 @@ self: super: rec {
155156 ++ [ D5123-patch ];
156157 };
157158 ghc865 = self.callPackage ../compiler/ghc {
158− extra-passthru = { buildGHC = self.buildPackages.haskell.compiler.ghc865; };
159+ extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc865; };
159160
160161 inherit bootPkgs sphinx;
161162
@@ -175,7 +176,7 @@ self: super: rec {
175176 ghc865 = let ghcjs865 = self.callPackage ../compiler/ghcjs/ghcjs.nix {
176177 ghcjsSrcJson = ../compiler/ghcjs/ghcjs-src.json;
177178 ghcjsVersion = "8.6.0.1";
178− ghc = self.buildPackages.haskell.compiler.ghc865;
179+ ghc = self.buildPackages.haskell-nix.compiler.ghc865;
179180 }; in let targetPrefix = "js-unknown-ghcjs-"; in self.runCommand "${targetPrefix}ghc-8.6.5" {
180181 passthru = {
181182 inherit targetPrefix;
@@ -194,14 +195,8 @@ self: super: rec {
194195 '';
195196 });
196197
197− ghc = haskell.compiler.ghc865;
198− cabal-install = self.buildPackages.bootstrap.haskell.packages.cabal-install;
199−
200− # see below
201− haskellPackages.hpack = null;
202− haskellPackages.hoogle = self.haskell-nix.haskellPackages.hoogle.components.exes.hoogle;
203− haskellPackages.happy = self.haskell-nix.haskellPackages.happy.components.exes.happy;
204− haskellPackages.alex = self.haskell-nix.haskellPackages.alex.components.exes.alex;
198+ ghc = compiler.ghc865;
199+ cabal-install = self.buildPackages.haskell-nix.bootstrap.packages.cabal-install;
205200
206201 # WARN: The `import ../. {}` will prevent
207202 # any cross to work, as we will loose
@@ -215,11 +210,6 @@ self: super: rec {
215210 # }).components.exes.hello;
216211 # };
217212
218− # stub out lib stuff.
219− haskell.lib = {
220− justStaticExecutables = x: x;
221− };
222−
223213 # NOTE: 8.6.5 prebuilt binaries on macOS, will yield:
224214 #
225215 # > Linking dist/build/cabal/cabal ...
@@ -234,63 +224,62 @@ self: super: rec {
234224
235225
236226 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
237− bootstrap = {
227+ bootstrap = with self.haskell-nix; let ghc = self.buildPackages.haskell-nix.bootstrap.compiler.ghc844; in {
238228 # XXX: import ../. will throw away all other overlays, config values, ...
239229 # this is not ideal!
240− haskell = with self.haskell-nix; let ghc = self.buildPackages.bootstrap.haskell.compiler.ghc844; in {
241− # get binary compilers for bootstrapping. We'll put the eventual proper
242− # compilers into the same place where nix expects them.
243− compiler = import ../compiler/old-ghc-nix { pkgs = self; };
244−
245− packages = {
246− # cabal has it's own bootstrap script which we'll use.
247− cabal-install = import ../compiler/bootstrap/cabal-install.nix {
248− inherit (self) fetchurl stdenv zlib;
249− inherit hackage ghc;
250− src = self.fetchurl {
251− url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz";
252− sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm65lbnx33";
253− };
254− version = "3.0.0.0";
230+ # get binary compilers for bootstrapping. We'll put the eventual proper
231+ # compilers into the same place where nix expects them.
232+ compiler = import ../compiler/old-ghc-nix { pkgs = self; };
233+
234+ packages = {
235+ # cabal has it's own bootstrap script which we'll use.
236+ cabal-install = import ../compiler/bootstrap/cabal-install.nix {
237+ inherit (self) fetchurl stdenv zlib;
238+ inherit hackage ghc;
239+ src = self.fetchurl {
240+ url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz";
241+ sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm65lbnx33";
255242 };
243+ version = "3.0.0.0";
244+ };
256245
257− # disable hpack support during bootstrap
258− hpack = null;
259− nix-tools = nix-tools.override {
260− inherit ghc;
261− inherit (bootstrap.haskell.packages) hpack;
262− };
246+ # disable hpack support during bootstrap
247+ hpack = null;
248+ nix-tools = nix-tools.override {
249+ inherit ghc;
250+ inherit (bootstrap.packages) hpack;
251+ };
263252
264− # now that we have nix-tools and hpack, we can just
265− # use `hackage-package` to build any package from
266− # hackage with haskell.nix. For alex and happy we
267− # need to use the boot strap compiler as we need them
268− # to build ghcs from source.
269− alex-project = hackage-project {
270− inherit ghc;
271− inherit (bootstrap.haskell.packages) cabal-install nix-tools hpack;
272− name = "alex"; version = "3.2.4";
273− index-state = "2019-10-20T00:00:00Z";
274− plan-sha256 = "086kd6aa5bir3y4aqb1wl5zkj6agz5q4wp4snvdnf6cidz5wra06";
275− };
276− alex = bootstrap.haskell.packages.alex-project.alex.components.exes.alex;
277− happy-project = hackage-project {
278− inherit ghc;
279− inherit (bootstrap.haskell.packages) cabal-install nix-tools hpack;
280− name = "happy"; version = "1.19.11";
281− index-state = "2019-10-20T00:00:00Z";
282− plan-sha256 = "011bxlxdv239psgi80j00km2wcgb68j16sz3fng67d03sqf5i37w";
283− };
284− happy = bootstrap.haskell.packages.happy-project.happy.components.exes.happy;
285− hscolour-project = hackage-project {
286− inherit ghc;
287− inherit (bootstrap.haskell.packages) cabal-install nix-tools hpack;
288− name = "hscolour"; version = "1.24.4";
289− index-state = "2019-10-20T00:00:00Z";
290− plan-sha256 = "021rwcmkshibc3mfr833ay5hfr19kq6k32lxyrrb6vp9vmihgw4b";
291− };
292− hscolour = bootstrap.haskell.packages.hscolour-project.hscolour.components.exes.HsColour;
253+ # now that we have nix-tools and hpack, we can just
254+ # use `hackage-package` to build any package from
255+ # hackage with haskell.nix. For alex and happy we
256+ # need to use the boot strap compiler as we need them
257+ # to build ghcs from source.
258+ alex-project = hackage-project {
259+ inherit ghc;
260+ inherit (bootstrap.packages) cabal-install nix-tools hpack;
261+ name = "alex"; version = "3.2.4";
262+ index-state = "2019-10-20T00:00:00Z";
263+ plan-sha256 = "086kd6aa5bir3y4aqb1wl5zkj6agz5q4wp4snvdnf6cidz5wra06";
264+ };
265+ alex = bootstrap.packages.alex-project.alex.components.exes.alex;
266+ happy-project = hackage-project {
267+ inherit ghc;
268+ inherit (bootstrap.packages) cabal-install nix-tools hpack;
269+ name = "happy"; version = "1.19.11";
270+ index-state = "2019-10-20T00:00:00Z";
271+ plan-sha256 = "011bxlxdv239psgi80j00km2wcgb68j16sz3fng67d03sqf5i37w";
272+ };
273+ happy = bootstrap.packages.happy-project.happy.components.exes.happy;
274+ hscolour-project = hackage-project {
275+ inherit ghc;
276+ inherit (bootstrap.packages) cabal-install nix-tools hpack;
277+ name = "hscolour"; version = "1.24.4";
278+ index-state = "2019-10-20T00:00:00Z";
279+ plan-sha256 = "021rwcmkshibc3mfr833ay5hfr19kq6k32lxyrrb6vp9vmihgw4b";
293280 };
281+ hscolour = bootstrap.packages.hscolour-project.hscolour.components.exes.HsColour;
294282 };
295283 };
284+ };
296285}