forked from reflex-frp/reflex-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
64 lines (59 loc) · 2.81 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
let local-reflex-platform = import ./. {};
inherit (local-reflex-platform.nixpkgs) lib;
getOtherDeps = reflex-platform: [
reflex-platform.stage2Script
reflex-platform.nixpkgs.cabal2nix
reflex-platform.ghc.cabal2nix
] ++ builtins.concatLists (map
(crossPkgs: lib.optionals (crossPkgs != null) [
crossPkgs.buildPackages.haskellPackages.cabal2nix
]) [
reflex-platform.nixpkgsCross.ios.aarch64
reflex-platform.nixpkgsCross.android.aarch64
reflex-platform.nixpkgsCross.android.aarch32
]
);
drvListToAttrs = drvs:
lib.listToAttrs (map (drv: { inherit (drv) name; value = drv; }) drvs);
perPlatform = lib.genAttrs local-reflex-platform.cacheBuildSystems (system:
let
reflex-platform = import ./. { inherit system; iosSupportForce = system == "x86_64-darwin"; };
otherDeps = getOtherDeps reflex-platform;
jsexeHydra = exe: exe.overrideAttrs (attrs: {
postInstall = ''
${attrs.postInstall or ""}
mkdir -p $out/nix-support
echo $out/bin/reflex-todomvc.jsexe >> $out/nix-support/hydra-build-products
'';
});
in {
inherit (reflex-platform) sources;
tryReflexShell = reflex-platform.tryReflexShell;
ghcjs.reflexTodomvc = jsexeHydra reflex-platform.ghcjs.reflex-todomvc;
ghcjs8_0.reflexTodomvc = jsexeHydra reflex-platform.ghcjs8_0.reflex-todomvc;
ghc.ReflexTodomvc = reflex-platform.ghc.reflex-todomvc;
ghc8_0.reflexTodomvc = reflex-platform.ghc8_0.reflex-todomvc;
ghc8_2.reflexTodomvc = reflex-platform.ghc8_2.reflex-todomvc;
skeleton-test = import ./skeleton-test.nix { inherit reflex-platform; };
cache = reflex-platform.pinBuildInputs
"reflex-platform-${system}"
(lib.concatMap builtins.attrValues (builtins.attrValues reflex-platform.sources)
++ reflex-platform.cachePackages)
(otherDeps);
} // lib.optionalAttrs (system == "x86_64-linux") {
# The node build is uncached and slow
benchmark = import ./scripts/benchmark.nix { inherit reflex-platform; };
} // lib.optionalAttrs (reflex-platform.androidSupport) {
inherit (reflex-platform) androidReflexTodomvc;
inherit (reflex-platform) androidReflexTodomvc-8_2;
} // lib.optionalAttrs (reflex-platform.iosSupport) {
inherit (reflex-platform) iosReflexTodomvc;
inherit (reflex-platform) iosReflexTodomvc-8_2;
} // drvListToAttrs otherDeps
// drvListToAttrs (lib.filter lib.isDerivation reflex-platform.cachePackages) # TODO no filter
);
metaCache = local-reflex-platform.pinBuildInputs
"reflex-platform-everywhere"
(map (a: a.cache) (builtins.attrValues perPlatform))
[];
in perPlatform // { inherit metaCache; }