forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathghc.nix
66 lines (58 loc) · 2.49 KB
/
ghc.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# This file defines the GHC along with any overrides that is used for the
# nix builds and stack builds.
{ system ? builtins.currentSystem
, pkgs ? import ./nixpkgs.nix { inherit system; }
}:
let
hsLib = pkgs.haskell.lib;
hsOverrides = with pkgs.haskell.lib; with pkgs.lib; (self: super:
rec {
# Override the default mkDerivation.
# NOTE: Changing this in any way will cause a full rebuild of every package!
mkDerivation = args: super.mkDerivation (args // {
enableLibraryProfiling = args.enableLibraryProfiling or true;
doCheck = args.doCheck or false;
});
withPackages = packages: super.callPackage ./with-packages-wrapper.nix {
inherit (self) ghc llvmPackages;
inherit packages;
};
ghcWithPackages = selectFrom: withPackages (selectFrom self);
# We need newer versions that build with GHC 8.6
language-c = super.callPackage ./overrides/language-c-0.8.2.nix {};
c2hs = super.callPackage ./overrides/c2hs-0.28.6.nix {};
});
ghc863Binary = pkgs.callPackage ./overrides/ghc-8.6.3-binary.nix {
gcc-clang-wrapper = "${toString pkgs.path}/pkgs/development/compilers/ghc/gcc-clang-wrapper.sh";
};
ghc863BinaryPackages = pkgs.callPackage "${toString pkgs.path}/pkgs/development/haskell-modules" {
haskellLib = pkgs.haskell.lib;
buildHaskellPackages = ghc863BinaryPackages;
ghc = ghc863Binary;
compilerConfig = pkgs.callPackage "${toString pkgs.path}/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix" { haskellLib = pkgs.haskell.lib; };
packageSetConfig = self: super: {
mkDerivation = drv: super.mkDerivation (drv // {
doCheck = false;
doHaddock = false;
enableExecutableProfiling = false;
enableLibraryProfiling = false;
enableSharedExecutables = false;
enableSharedLibraries = false;
});
};
};
ghc = pkgs.callPackage ./overrides/ghc-8.6.4.nix rec {
bootPkgs = ghc863BinaryPackages;
inherit (pkgs.python3Packages) sphinx;
inherit (pkgs) buildLlvmPackages;
enableIntegerSimple = true;
enableRelocatedStaticLibs = true;
};
packages = pkgs.callPackage "${toString pkgs.path}/pkgs/development/haskell-modules" {
haskellLib = pkgs.haskell.lib;
inherit ghc;
buildHaskellPackages = packages;
compilerConfig = pkgs.callPackage "${toString pkgs.path}/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix" { haskellLib = pkgs.haskell.lib; };
overrides = hsOverrides;
};
in packages