Skip to content

Commit

Permalink
use custom ghc.
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman committed Sep 24, 2020
1 parent 459dd8f commit 577d987
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 11 deletions.
66 changes: 55 additions & 11 deletions overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };

Expand Down Expand Up @@ -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; };
Expand Down
16 changes: 16 additions & 0 deletions overlays/patches/ghc/ghc-prim-linux-extra-libraries.patch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 577d987

Please sign in to comment.