forked from dapphub/dapptools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
haskell.nix
71 lines (59 loc) · 2.26 KB
/
haskell.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
67
68
69
70
71
# This file was extracted from overlay.nix in order to provide access
# to our Haskell package extensions from other overlays, bypassing the
# rest of our overlay. This was necessary for rather obscure reasons.
{ pkgs, lib }:
let
stdenv = pkgs.stdenv;
in self-hs: super-hs:
let
dontCheck = x: y:
pkgs.haskell.lib.dontCheck
(self-hs.callCabal2nix x y {});
sbv_prepatch = pkgs.haskell.lib.dontCheck (self-hs.callCabal2nix "sbv" (builtins.fetchGit {
url = "https://github.com/LeventErkok/sbv/";
rev = "91637c043d206530bc64d7eac88d2f80e8db0b85";
}) {inherit (pkgs) z3;});
in {
restless-git = dontCheck "restless-git" (./src/restless-git);
wreq = pkgs.haskell.lib.doJailbreak super-hs.wreq;
# we use a pretty bleeding edge sbv version
sbv = sbv_prepatch.overrideAttrs (attrs: {
postPatch = ''
sed -i -e 's|"z3"|"${pkgs.z3}/bin/z3"|' Data/SBV/Provers/Z3.hs
sed -i -e 's|"cvc4"|"${pkgs.cvc4}/bin/cvc4"|' Data/SBV/Provers/CVC4.hs'';
configureFlags = attrs.configureFlags ++ [
"--ghc-option=-O2"
];
});
# This package is somewhat unmaintained and doesn't compile with GHC 8.4,
# so we have to use a GitHub fork that fixes it.
semver-range = super-hs.semver-range.overrideAttrs (attrs: {
src = pkgs.fetchFromGitHub {
owner = "dmjio";
repo = "semver-range";
rev = "patch-1";
sha256 = "1l20hni4v4k6alxj867z00625pa5hkf0h5sdaj1mjc237k5v78j9";
};
meta.broken = false;
});
hevm = pkgs.haskell.lib.dontHaddock ((
self-hs.callCabal2nix "hevm" (./src/hevm) {
# Haskell libs with the same names as C libs...
# Depend on the C libs, not the Haskell libs.
# These are system deps, not Cabal deps.
inherit (pkgs) secp256k1;
ff = pkgs.libff;
}
).overrideAttrs (attrs: {
postInstall = ''
wrapProgram $out/bin/hevm --prefix PATH \
: "${lib.makeBinPath (with pkgs; [bash coreutils git solc])}"
'';
enableSeparateDataOutput = true;
buildInputs = attrs.buildInputs ++ [pkgs.solc];
nativeBuildInputs = attrs.nativeBuildInputs ++ [pkgs.makeWrapper];
configureFlags = attrs.configureFlags ++ [
"--ghc-option=-O2"
];
}));
}