-
Notifications
You must be signed in to change notification settings - Fork 44
/
Simplicity.Haskell.nix
40 lines (38 loc) · 1.83 KB
/
Simplicity.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
{ mkDerivation, base, binary, cereal, lens-family, lib, MemoTrie, mtl, prettyprinter, QuickCheck, stdenv, split, tasty, tasty-hunit, tasty-quickcheck, tardis, unification-fd, vector, entropy
, doCheck ? true
, withValgrind ? false, valgrind ? null
}:
assert withValgrind -> valgrind != null;
mkDerivation (rec {
pname = "Simplicity";
version = "0.0.0";
src = lib.sourceFilesBySuffices
(lib.sourceByRegex ./. ["^LICENSE$" "^Simplicity\.cabal$" "^Setup.hs$" "^Tests.hs$" "^Haskell$" "^Haskell/.*"
"^Haskell-Generate$" "^Haskell-Generate/.*"
"^Haskell-Examples$" "^Haskell-Examples/.*"
"^C$" "^C/.*"])
["LICENSE" ".cabal" ".hs" ".hsig" ".h" ".c" ".inc"];
libraryHaskellDepends = [ base binary cereal lens-family MemoTrie mtl split tardis unification-fd vector ];
executableHaskellDepends = [ prettyprinter entropy ];
testHaskellDepends = libraryHaskellDepends ++ [ QuickCheck tasty tasty-hunit tasty-quickcheck ] ++ lib.optionals withValgrind [ valgrind ];
enableParallelBuilding = true;
inherit doCheck;
preCheck = [ ''
export GHCRTS=-N$NIX_BUILD_CORES
'' ] ++ lib.optional withValgrind ''
valgrind --leak-check=yes dist/build/testsuite/testsuite -p '$2=="C / SPEC"'
'';
postCheck = ''
unset GHCRTS
'';
# Uncomment to make testing deterministic.
# testFlags = ["--quickcheck-replay=582534"];
# Cabal's haddock doesn't work for Backpack / internal libraries / modules reexports.
# Until that is fix we manually generate some documentation pages
haddockFlags = ["--haddock-option='--use-contents=index.html'"];
postHaddock = ''
cp ${./manual-index.html} dist/doc/html/Simplicity/index.html
cp ${./Simplicity-Primitive.html} dist/doc/html/Simplicity/Simplicity-Primitive.html
'';
license = lib.licenses.mit;
})