-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.nix
More file actions
107 lines (90 loc) · 2.54 KB
/
default.nix
File metadata and controls
107 lines (90 loc) · 2.54 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
with (builtins.fromJSON (builtins.readFile ./nixpkgs.json));
{ nixpkgs ? builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
}
}:
let
# all the nix things
pkgs = import nixpkgs {};
sources = builtins.fromJSON (builtins.readFile ./source.json);
ghc-wpo-src =
pkgs.fetchFromGitHub sources.ghc-whole-program-compiler-project;
# this is the reachability analysis binary (cretaed by souffle) that runs
# the mark n' sweep GC pass. This is call by the external-stg-intepreter.
ext-stg-gc =
pkgs.stdenv.mkDerivation {
name = "ext-stg-gc";
src = "${ghc-wpo-src}/external-stg-interpreter";
buildInputs = with pkgs; [ souffle openmpi ];
buildPhase = ''
mkdir -pv $out/bin
g++ -fopenmp $src/datalog/ext-stg-gc.cpp \
-Wl,-u,__factory_Sf_ext_stg_gc_instance \
-std=c++17 \
-o $out/bin/ext-stg-gc
'';
};
overrides = self: super: with pkgs.haskell.lib; {
type-errors-pretty = dontCheck (
doJailbreak (
self.callCabal2nix
"type-errors-pretty"
(pkgs.fetchFromGitHub sources.type-errors-pretty)
{}
)
);
digest =
self.callCabal2nix
"digest"
(pkgs.fetchFromGitHub sources.digest)
{};
final-pretty-printer = doJailbreak (
self.callCabal2nix
"final-pretty-printer"
(pkgs.fetchFromGitHub sources.final-pretty-printer)
{}
);
dap = doJailbreak (
self.callCabal2nix
"dap"
(pkgs.fetchFromGitHub sources.dap)
{}
);
dap-estgi-server =
self.callCabal2nix
"dap-estgi-server"
./dap-estgi-server
{};
external-stg =
self.callCabal2nix
"external-stg"
"${ghc-wpo-src}/external-stg"
{};
external-stg-syntax =
self.callCabal2nix
"external-stg-syntax"
"${ghc-wpo-src}/external-stg-syntax"
{};
external-stg-interpreter =
self.callCabal2nixWithOptions
"external-stg-interpreter"
"${ghc-wpo-src}/external-stg-interpreter"
"-fexternal-ext-stg-gc"
{};
souffle-haskell =
dontCheck
(doJailbreak
(self.callCabal2nix "souffle-haskell"
(pkgs.fetchFromGitHub sources.souffle-haskell) {}
));
};
hPkgs =
pkgs.haskellPackages.override { inherit overrides; };
in
# this is the set we export for CI, and for shell.nix
{
inherit (hPkgs) dap-estgi-server;
inherit ext-stg-gc;
inherit pkgs;
}