2018-05-11 01:12:42 +02:00
|
|
|
{ compiler ? "ghc822"
|
2018-04-12 05:21:52 +02:00
|
|
|
, doProfiling ? false
|
|
|
|
, doBenchmark ? false
|
2018-04-24 01:39:37 +02:00
|
|
|
, doTracing ? false
|
2018-04-29 03:21:24 +02:00
|
|
|
, doStrict ? false
|
2018-05-14 23:27:53 +02:00
|
|
|
, rev ? "a2981671523416ad5c9a49de8c16ac8fccb2306b"
|
|
|
|
, sha256 ? "1cgp63hdzfs836ynvfsknp43dkgq0dfny1bb79c97rzh1alqx0kz"
|
2018-05-14 23:47:04 +02:00
|
|
|
, nixpkgs ? if builtins.compareVersions builtins.nixVersion "2.0" < 0
|
2018-05-15 06:21:13 +02:00
|
|
|
then abort "hnix requires at least nix 2.0"
|
2018-05-14 23:47:04 +02:00
|
|
|
else import (builtins.fetchTarball {
|
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
|
|
|
inherit sha256; }) {
|
|
|
|
config.allowUnfree = true;
|
|
|
|
config.allowBroken = false;
|
|
|
|
}
|
2018-04-12 05:21:52 +02:00
|
|
|
}:
|
2018-04-07 01:23:24 +02:00
|
|
|
|
2018-04-17 00:10:47 +02:00
|
|
|
let inherit (nixpkgs) pkgs;
|
2018-04-07 01:23:24 +02:00
|
|
|
|
2018-04-17 00:10:47 +02:00
|
|
|
haskellPackages = pkgs.haskell.packages.${compiler}.override {
|
2018-05-09 01:40:56 +02:00
|
|
|
overrides = with pkgs.haskell.lib; self: super:
|
|
|
|
if compiler == "ghcjs" then {} else
|
|
|
|
{
|
|
|
|
cryptohash-md5 = doJailbreak super.cryptohash-md5;
|
|
|
|
cryptohash-sha1 = doJailbreak super.cryptohash-sha1;
|
|
|
|
cryptohash-sha256 = doJailbreak super.cryptohash-sha256;
|
|
|
|
cryptohash-sha512 = doJailbreak super.cryptohash-sha512;
|
|
|
|
serialise = dontCheck super.serialise;
|
2018-05-01 03:47:21 +02:00
|
|
|
|
2018-05-09 01:40:56 +02:00
|
|
|
ghc-datasize =
|
|
|
|
if doProfiling
|
|
|
|
then null
|
|
|
|
else pkgs.haskell.lib.overrideCabal super.ghc-datasize (attrs: {
|
|
|
|
enableLibraryProfiling = false;
|
|
|
|
enableExecutableProfiling = false;
|
|
|
|
});
|
2018-05-01 03:47:21 +02:00
|
|
|
|
2018-05-09 01:40:56 +02:00
|
|
|
ghc-heap-view =
|
|
|
|
if doProfiling
|
|
|
|
then null
|
|
|
|
else pkgs.haskell.lib.overrideCabal super.ghc-heap-view (attrs: {
|
|
|
|
enableLibraryProfiling = false;
|
|
|
|
enableExecutableProfiling = false;
|
|
|
|
});
|
|
|
|
};
|
2018-04-07 01:23:24 +02:00
|
|
|
};
|
|
|
|
|
2018-04-17 00:10:47 +02:00
|
|
|
in haskellPackages.developPackage {
|
|
|
|
root = ./.;
|
|
|
|
|
2018-05-15 00:34:22 +02:00
|
|
|
overrides = with pkgs.haskell.lib; self: super:
|
|
|
|
if compiler == "ghc802"
|
|
|
|
then {
|
|
|
|
concurrent-output = doJailbreak super.concurrent-output;
|
|
|
|
}
|
|
|
|
else {};
|
|
|
|
|
2018-05-11 00:07:32 +02:00
|
|
|
source-overrides =
|
|
|
|
if compiler == "ghc802"
|
|
|
|
then {
|
|
|
|
lens-family-core = "1.2.1";
|
|
|
|
lens-family = "1.2.1";
|
|
|
|
}
|
|
|
|
else {};
|
2018-04-17 00:10:47 +02:00
|
|
|
|
|
|
|
modifier = drv: pkgs.haskell.lib.overrideCabal drv (attrs: {
|
|
|
|
testHaskellDepends = attrs.testHaskellDepends ++
|
2018-05-14 22:20:02 +02:00
|
|
|
[ pkgs.nix pkgs.haskell.packages.ghc822.hpack
|
|
|
|
|
|
|
|
(let cabalInstallVersion = {
|
|
|
|
ghc802 = "1.24.0.2";
|
|
|
|
ghc822 = "2.0.0.1";
|
|
|
|
ghc842 = "2.2.0.0";
|
|
|
|
}; in
|
|
|
|
haskellPackages.callHackage "cabal-install"
|
|
|
|
(cabalInstallVersion.${compiler}) {})
|
|
|
|
];
|
2018-04-17 00:10:47 +02:00
|
|
|
|
|
|
|
enableLibraryProfiling = doProfiling;
|
|
|
|
enableExecutableProfiling = doProfiling;
|
2018-04-07 01:23:24 +02:00
|
|
|
|
2018-04-17 00:10:47 +02:00
|
|
|
inherit doBenchmark;
|
2018-04-24 01:39:37 +02:00
|
|
|
|
2018-04-29 03:21:24 +02:00
|
|
|
configureFlags =
|
2018-05-01 03:47:21 +02:00
|
|
|
pkgs.stdenv.lib.optional doTracing "--flags=tracing"
|
|
|
|
++ pkgs.stdenv.lib.optional doProfiling "--flags=profiling"
|
|
|
|
++ pkgs.stdenv.lib.optional doStrict "--ghc-options=-Werror";
|
2018-04-17 00:10:47 +02:00
|
|
|
});
|
|
|
|
}
|