diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 7914527cdf..63f1d79554 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -131,6 +131,15 @@ in { ++ final.lib.optional (versionAtLeast "8.6.4") ./patches/ghc/Cabal-3886.patch ; in ({ + sources = { + ghc-865-iohk = import ../compiler/ghc/source-dist.nix { + inherit (final) stdenv; + pkgs = final; + inherit (final.haskell-nix.compiler.ghc865.bootPkgs) alex happy hscolour ghc; + src = final.haskell-nix.sources."ghc-8.6.5-iohk"; + version = "8.6.5-iohk"; + }; + }; ghc844 = final.callPackage ../compiler/ghc { extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc844; }; @@ -236,26 +245,61 @@ in { ghc-patches = ghc-patches "8.6.4" ++ [ D5123-patch ]; }; - ghc865 = final.callPackage ../compiler/ghc { - extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; }; + # ghc865 = final.callPackage ../compiler/ghc { + # extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; }; + + # inherit sphinx installDeps; + # bootPkgs = bootPkgs // { + # # GHC 8.6.5 and earlier need happy 1.19.11 + # happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked; + # }; + + # buildLlvmPackages = final.buildPackages.llvmPackages_6; + # llvmPackages = final.llvmPackages_6; + + # src-spec = rec { + # version = "8.6.5"; + # url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz"; + # sha256 = "0qg3zsmbk4rkwkc3jpas3zs74qaxmw4sp4v1mhsbj0a0dzls2jjd"; + # }; + + # ghc-patches = ghc-patches "8.6.5" + # ++ [ D5123-patch haddock-900-patch ]; + # }; + ghc865 = final.haskell-nix.compiler.ghc865-iohk; + ghc865-iohk = final.callPackage ../compiler/ghc { + extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865-iohk; }; - inherit sphinx installDeps; - bootPkgs = bootPkgs // { - # GHC 8.6.5 and earlier need happy 1.19.11 - happy = final.haskell-nix.bootstrap.packages.happy-old-unchecked; - }; + inherit bootPkgs sphinx installDeps; buildLlvmPackages = final.buildPackages.llvmPackages_6; llvmPackages = final.llvmPackages_6; src-spec = rec { version = "8.6.5"; - url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz"; - sha256 = "0qg3zsmbk4rkwkc3jpas3zs74qaxmw4sp4v1mhsbj0a0dzls2jjd"; + file = "${final.haskell-nix.compiler.sources.ghc-865-iohk}/src.tar.xz"; }; - ghc-patches = ghc-patches "8.6.5" - ++ [ D5123-patch haddock-900-patch ]; + ghc-patches = [ + ./patches/ghc/outputtable-assert-8.6.patch + ./patches/ghc/ghc-8.6.4-reenable-th-qq-in-stage1.patch + ./patches/ghc/dll-loader-8.4.2.patch + ./patches/ghc/ghc-8.6.4-prim-no-arm-atomics.patch + ./patches/ghc/ghc-8.6.5-atomic-arm-arch.patch + ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch + ./patches/ghc/respect-ar-path.patch + ./patches/ghc/ghc-no-system-linker.patch + # ./patches/ghc/aarch64-linker.patch + ./patches/ghc/llvm-emit-nonlazybind.patch + + ./patches/ghc/Cabal-3886.patch + ./patches/ghc/ghc-8.4.3-Cabal2201-allow-test-wrapper.patch + ./patches/ghc/ghc-8.4.3-Cabal2201-response-file-support.patch + ./patches/ghc/ghc-8.6-Cabal-fix-datadir.patch + ./patches/ghc/ghc-8.4.3-Cabal2201-no-hackage-tests.patch + ./patches/ghc/ghc-prim-linux-extra-libraries.patch + haddock-900-patch + ]; }; ghc881 = final.callPackage ../compiler/ghc { extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc881; }; diff --git a/overlays/patches/ghc/ghc-prim-linux-extra-libraries.patch b/overlays/patches/ghc/ghc-prim-linux-extra-libraries.patch new file mode 100644 index 0000000000..b5ede27f96 --- /dev/null +++ b/overlays/patches/ghc/ghc-prim-linux-extra-libraries.patch @@ -0,0 +1,16 @@ +diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal +index a95f1ecaa8..4866490899 100644 +--- a/libraries/ghc-prim/ghc-prim.cabal ++++ b/libraries/ghc-prim/ghc-prim.cabal +@@ -66,6 +66,11 @@ Library + -- on Windows. Required because of mingw32. + extra-libraries: user32, mingw32, mingwex + ++ if os(linux) ++ -- we need libm, but for musl and other's we might need libc, as libm ++ -- is just an empty shell. ++ extra-libraries: c, m ++ + c-sources: + cbits/atomic.c + cbits/bswap.c \ No newline at end of file