mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
8f56205567
We currently use a custom cabal file for ghc-lib that has libffi in the extra-libraries section so Hazel adds the headers. Forcing GHC to use the bundled libffi should hopefully remove the need for this hack which simplifies things.
64 lines
2.3 KiB
Nix
64 lines
2.3 KiB
Nix
# 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);
|
|
});
|
|
|
|
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.5.nix rec {
|
|
bootPkgs = ghc863BinaryPackages;
|
|
inherit (pkgs.python3Packages) sphinx;
|
|
inherit (pkgs) buildLlvmPackages;
|
|
enableIntegerSimple = true;
|
|
enableRelocatedStaticLibs = true;
|
|
libffi = null;
|
|
};
|
|
|
|
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
|