-
Notifications
You must be signed in to change notification settings - Fork 149
/
release.nix
107 lines (100 loc) · 3.99 KB
/
release.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
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
{ reflex-platform-fun ? import ./dep/reflex-platform
, supportedSystems ? ["x86_64-linux" "x86_64-darwin"]
}:
let
native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; };
inherit (native-reflex-platform.nixpkgs) lib;
perPlatform = lib.genAttrs supportedSystems (system: let
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; };
compilers = [
"ghc"
"ghcjs"
] ++ lib.optionals (reflex-platform.androidSupport) [
"ghcAndroidAarch64"
"ghcAndroidAarch32"
] ++ lib.optionals (reflex-platform.iosSupport) [
"ghcIosAarch64"
];
variations = map (v: "reflex" + v) [
"-dontUseTemplateHaskell"
""
];
pkgs = import ./nixpkgs { inherit system; };
sharedOverrides = self: super: {
exception-transformers = pkgs.haskell.lib.dontCheck super.exception-transformers;
};
nixpkgsGhcs =
let
nixGhc902 = pkgs.haskell.packages.ghc902.override { overrides = sharedOverrides; };
nixGhc945 = pkgs.haskell.packages.ghc945.override { overrides = sharedOverrides; };
nixGhc961 = pkgs.haskell.packages.ghc961.override {
overrides = self: super: sharedOverrides self super // {
these-lens = self.callHackageDirect {
pkg = "these-lens";
ver = "1.0.1.3";
sha256 = "0n1vkr57jz5yvy4jm15v5cs42rp342ni0gisib7aqyhibpicqs5c";
} {};
these = self.callHackageDirect {
pkg = "these";
ver = "1.2";
sha256 = "1iaaq1fsvg8c3l0czcicshkmbbr00hnwkdamjbkljsa1qvlilaf0";
} {};
lens = self.callHackageDirect {
pkg = "lens";
ver = "5.2.2";
sha256 = "0c4a421sxfjm1cj3nvgwkr4glll23mqnsvs2iv5qh85931h2f3cy";
} {};
assoc = self.callHackageDirect {
pkg = "assoc";
ver = "1.1";
sha256 = "1krvcafrbj98z5hv55gq4zb1in5yd71nmz9zdiqgnywjzbrvpf75";
} {};
strict = self.callHackageDirect {
pkg = "strict";
ver = "0.5";
sha256 = "02iyvrr7nd7fnivz78lzdchy8zw1cghqj1qx2yzbbb9869h1mny7";
} {};
hlint = self.callHackageDirect {
pkg = "hlint";
ver = "3.5";
sha256 = "1np43k54918v54saqqgnd82ccd6225njwxpg2031asi70jam80x9";
} {};
patch = self.callHackageDirect {
pkg = "patch";
ver = "0.0.8.3";
sha256 = "054slcrlsdcs6azwph6v3vgsgk939ax7ax9xw76whywkrim20n1w";
} {};
};
};
in
{
ghc902 = nixGhc902.callCabal2nix "reflex" (import ./src.nix) {};
ghc945 = nixGhc945.callCabal2nix "reflex" (import ./src.nix) {};
ghc961 = nixGhc961.callCabal2nix "reflex" (import ./src.nix) {};
};
compilerPkgs = lib.genAttrs compilers (ghc: let
variationPkgs = lib.genAttrs variations (variation: let
reflex-platform = reflex-platform-fun {
inherit system;
__useNewerCompiler = true;
__useTemplateHaskell = variation == "reflex"; # TODO hack
haskellOverlays = [
(self: super: import ./overlay.nix { inherit self super; haskellLib = native-reflex-platform.nixpkgs.haskell.lib; })
# Use this package's source for reflex
(self: super: {
_dep = super._dep // { reflex = import ./src.nix; };
})
];
};
in reflex-platform.${ghc}.reflex);
in variationPkgs // {
cache = reflex-platform.pinBuildInputs "reflex-${system}-${ghc}"
(builtins.attrValues variationPkgs);
});
in compilerPkgs // nixpkgsGhcs // {
cache = reflex-platform.pinBuildInputs "reflex-${system}"
(map (a: a.cache) (builtins.attrValues compilerPkgs));
});
metaCache = native-reflex-platform.pinBuildInputs "reflex-everywhere"
(map (a: a.cache) (builtins.attrValues perPlatform));
in perPlatform // { inherit metaCache; }