forked from reflex-frp/patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.nix
49 lines (45 loc) · 1.49 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
{ reflex-platform-fun ? import ./dep/reflex-platform
}:
let
native-reflex-platform = reflex-platform-fun {};
inherit (native-reflex-platform.nixpkgs) lib;
systems = ["x86_64-linux" "x86_64-darwin"];
perPlatform = lib.genAttrs systems (system: let
reflex-platform = reflex-platform-fun { inherit system; };
compilers = [
"ghc"
"ghcjs"
] ++ lib.optionals (reflex-platform.androidSupport) [
"ghcAndroidAarch64"
"ghcAndroidAarch32"
] ++ lib.optionals (reflex-platform.iosSupport) [
"ghcIosAarch64"
];
compilerPkgs = lib.genAttrs compilers (ghc: let
reflex-platform = reflex-platform-fun {
inherit system;
haskellOverlays = [
# Use this package's source for reflex
(self: super: {
_dep = super._dep // {
patch = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
"release.nix"
".git"
"dist"
"dist-newstyle"
"cabal.haskell-ci"
"cabal.project"
".travis.yml"
])) ./.;
};
})
];
};
in reflex-platform.${ghc}.patch);
in compilerPkgs // {
cache = reflex-platform.pinBuildInputs "patch-${system}"
(builtins.attrValues compilerPkgs);
});
metaCache = native-reflex-platform.pinBuildInputs "patch-everywhere"
(map (a: a.cache) (builtins.attrValues perPlatform));
in perPlatform // { inherit metaCache; }