|
1 |
| -{ rp ? import ./dep/reflex-platform {} |
| 1 | +{ reflex-platform-fun ? import ./dep/reflex-platform |
2 | 2 | }:
|
| 3 | + |
3 | 4 | let
|
4 |
| - inherit (rp.nixpkgs) lib; |
5 |
| - compilers = ["ghc8_4" "ghc8_0" "ghcjs8_4" "ghcjs8_0"]; |
6 |
| -in lib.attrValues (lib.genAttrs compilers (ghc: { |
7 |
| - reflex-useTemplateHaskell = rp.${ghc}.callPackage ./. { useTemplateHaskell = true; splitThese = false; }; |
8 |
| - reflex = rp.${ghc}.callPackage ./. { useTemplateHaskell = false; splitThese = false; }; |
9 |
| -})) |
| 5 | + native-reflex-platform = reflex-platform-fun {}; |
| 6 | + inherit (native-reflex-platform.nixpkgs) lib; |
| 7 | + systems = ["x86_64-linux" "x86_64-darwin"]; |
| 8 | + |
| 9 | + perPlatform = lib.genAttrs systems (system: let |
| 10 | + reflex-platform = reflex-platform-fun { inherit system; }; |
| 11 | + compilers = [ |
| 12 | + "ghc" |
| 13 | + "ghcjs" |
| 14 | + ] ++ lib.optionals (reflex-platform.androidSupport) [ |
| 15 | + "ghcAndroidAarch64" |
| 16 | + "ghcAndroidAarch32" |
| 17 | + ] ++ lib.optionals (reflex-platform.iosSupport) [ |
| 18 | + "ghcIosAarch64" |
| 19 | + ]; |
| 20 | + hsPkgs = lib.genAttrs compilers (ghc: let |
| 21 | + ghc' = reflex-platform.${ghc}.override { |
| 22 | + overrides = self: super: { |
| 23 | + reflex-useTemplateHaskell = self.callPackage ./. { useTemplateHaskell = true; splitThese = false; }; |
| 24 | + reflex = self.callPackage ./. { useTemplateHaskell = false; splitThese = false; }; |
| 25 | + }; |
| 26 | + }; |
| 27 | + in { |
| 28 | + inherit (ghc') reflex reflex-useTemplateHaskell; |
| 29 | + }); |
| 30 | + in hsPkgs // { |
| 31 | + cache = reflex-platform.pinBuildInputs "reflex-${system}" |
| 32 | + (lib.concatLists (map builtins.attrValues (builtins.attrValues hsPkgs))); |
| 33 | + }); |
| 34 | + |
| 35 | + metaCache = native-reflex-platform.pinBuildInputs "reflex-everywhere" |
| 36 | + (map (a: a.cache) (builtins.attrValues perPlatform)); |
| 37 | + |
| 38 | +in perPlatform // { inherit metaCache; } |
0 commit comments