Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Splices repo + GHCJS splices #787

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
821 changes: 413 additions & 408 deletions default.nix

Large diffs are not rendered by default.

93 changes: 59 additions & 34 deletions haskell-overlays/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{ lib
, haskellLib
, nixpkgs
, useFastWeak, useReflexOptimizer, enableLibraryProfiling, enableTraceReflexEvents
, useTextJSString, enableExposeAllUnfoldings, __useTemplateHaskell
, useFastWeak
, useReflexOptimizer
, enableLibraryProfiling
, enableTraceReflexEvents
, useTextJSString
, enableExposeAllUnfoldings
, __useTemplateHaskell
, ghcSavedSplices-8_6
, ghcSavedSplices-8_10
, haskellOverlaysPre
, haskellOverlaysPost
, splices-func
}:

let
Expand All @@ -15,22 +21,20 @@ let
in

rec {
optionalExtension = cond: overlay: if cond then overlay else _: _: {};
optionalExtension = cond: overlay: if cond then overlay else _: _: { };

versionWildcard = versionList: let
versionListInc = lib.init versionList ++ [ (lib.last versionList + 1) ];
bottom = lib.concatStringsSep "." (map toString versionList);
top = lib.concatStringsSep "." (map toString versionListInc);
in version: lib.versionOlder version top && lib.versionAtLeast version bottom;
versionWildcard = versionList:
let
versionListInc = lib.init versionList ++ [ (lib.last versionList + 1) ];
bottom = lib.concatStringsSep "." (map toString versionList);
top = lib.concatStringsSep "." (map toString versionListInc);
in
version: lib.versionOlder version top && lib.versionAtLeast version bottom;

foldExtensions = lib.foldr lib.composeExtensions (_: _: {});
foldExtensions = lib.foldr lib.composeExtensions (_: _: { });

getGhcVersion = ghc: ghc.version;

##
## Conventional roll ups of all the constituent overlays below.
##

# `super.ghc` is used so that the use of an overlay does not depend on that
# overlay. At the cost of violating the usual rules on using `self` vs
# `super`, this avoids a bunch of strictness issues keeping us terminating.
Expand All @@ -47,53 +51,73 @@ rec {
(optionalExtension (!(super.ghc.isGhcjs or false)) combined-ghc)
(optionalExtension (super.ghc.isGhcjs or false) combined-ghcjs)

(optionalExtension (with nixpkgs.stdenv; versionWildcard [ 8 6 ] super.ghc.version && !(super.ghc.isGhcjs or false) && hostPlatform != buildPlatform) loadSplices-8_6)
(optionalExtension (with nixpkgs.stdenv; versionWildcard [ 8 10 ] super.ghc.version && !(super.ghc.isGhcjs or false) && hostPlatform != buildPlatform) loadSplices-8_10)
(optionalExtension (with nixpkgs.stdenv; versionWildcard [ 8 6 ] super.ghc.version && hostPlatform != buildPlatform) (lsplices8_6 ghcSavedSplices-8_6))
(optionalExtension (with nixpkgs.stdenv; versionWildcard [ 8 10 ] super.ghc.version && hostPlatform != buildPlatform) (lsplices8_10 ghcSavedSplices-8_10))

(optionalExtension (nixpkgs.stdenv.hostPlatform.useAndroidPrebuilt or false) android)
(optionalExtension (nixpkgs.stdenv.hostPlatform.isiOS or false) ios)
(optionalExtension (nixpkgs.stdenv.hostPlatform.isWasm or false) wasm)

user-custom-post
] self super;
]
self
super;

combined-any = self: super: foldExtensions [
any
(optionalExtension (versionWildcard [ 8 ] (getGhcVersion super.ghc)) combined-any-8)
] self super;
]
self
super;

combined-any-8 = self: super: foldExtensions [
any-8
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) any-8_6)
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) haskell-gi-8_6)
(optionalExtension (versionWildcard [ 8 10 ] (getGhcVersion super.ghc)) haskell-gi-8_10)
(optionalExtension (lib.versionOlder "8.11" (getGhcVersion super.ghc)) any-head)
] self super;
(optionalExtension (lib.versionOlder "8.11" (getGhcVersion super.ghc)) any-head)
]
self
super;

combined-ghc = self: super: foldExtensions [
(optionalExtension (versionWildcard [ 8 6 ] super.ghc.version) ghc-8_6)
(optionalExtension (lib.versionOlder "8.11" super.ghc.version) ghc-head)
] self super;
(optionalExtension (lib.versionOlder "8.11" super.ghc.version) ghc-head)
]
self
super;

combined-ghcjs = self: super: foldExtensions [
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) combined-ghcjs-8_6)
(optionalExtension (versionWildcard [ 8 10 ] (getGhcVersion super.ghc)) combined-ghcjs-8_10)
] self super;
]
self
super;

combined-ghcjs-8_6 = self: super: foldExtensions [
ghcjs_8_6
(optionalExtension useTextJSString textJSString)
(optionalExtension useTextJSString textJSString-8_6)
(optionalExtension useTextJSString ghcjs-textJSString-8_6)
(optionalExtension useFastWeak ghcjs-fast-weak_8_6)
] self super;
]
self
super;

combined-ghcjs-8_10 = self: super: foldExtensions [
(optionalExtension useTextJSString textJSString)
(optionalExtension useTextJSString textJSString-8_10)
(optionalExtension useTextJSString ghcjs-textJSString-8_10)
(optionalExtension useFastWeak ghcjs-fast-weak_8_10)
] self super;
]
self
super;

ghcjs-splices = self: super: foldExtensions [
(lsplices8_10 ghcSavedSplices-8_10)
]
self
super;

##
## Constituent
Expand All @@ -108,35 +132,36 @@ rec {
exposeAllUnfoldings = import ./expose-all-unfoldings.nix { };

# For GHC and GHCJS
any = _: _: {};
any = _: _: { };
any-8 = import ./any-8.nix { inherit haskellLib lib getGhcVersion; };
any-8_6 = import ./any-8.6.nix { inherit haskellLib fetchFromGitHub; inherit (nixpkgs) pkgs; };
any-head = import ./any-head.nix { inherit haskellLib fetchFromGitHub; };

# Just for GHC, usually to sync with GHCJS
ghc-8_6 = _: _: {};
ghc-head = _: _: {};
ghc-8_6 = _: _: { };
ghc-head = _: _: { };

profiling = import ./profiling.nix {
inherit haskellLib;
inherit enableLibraryProfiling;
};

saveSplices = ghcVersion: import ./splices-load-save/save-splices.nix {
inherit lib haskellLib fetchFromGitHub ghcVersion;
};
saveSplices = name: splices-func.saveSplices name;
lsplices8_10 = splicepkgs: splices-func.loadSplices8_10 splicepkgs;
lsplices8_6 = splicepkgs: splices-func.loadSplices8_6 splicepkgs;

loadSplices-8_6 = import ./splices-load-save/load-splices.nix {
/*loadSplices-8_6 = import "${splices-load-save-nix}/load-splices.nix" {
inherit lib haskellLib fetchFromGitHub;
isExternalPlugin = false;
splicedHaskellPackages = ghcSavedSplices-8_6;
};
};

loadSplices-8_10 = import ./splices-load-save/load-splices.nix {
loadSplices-8_10 = import "${splices-load-save-nix}/load-splices.nix" {
inherit lib haskellLib fetchFromGitHub;
isExternalPlugin = true;
splicedHaskellPackages = ghcSavedSplices-8_10;
};
};
*/

# Just for GHCJS
ghcjs_8_6 = import ./ghcjs-8.6 {
Expand Down
2 changes: 0 additions & 2 deletions haskell-overlays/splices-load-save/dep/ghc-8.10/default.nix

This file was deleted.

7 changes: 0 additions & 7 deletions haskell-overlays/splices-load-save/dep/ghc-8.10/github.json

This file was deleted.

9 changes: 0 additions & 9 deletions haskell-overlays/splices-load-save/dep/ghc-8.10/thunk.nix

This file was deleted.

2 changes: 0 additions & 2 deletions haskell-overlays/splices-load-save/dep/ghc-8.6/default.nix

This file was deleted.

8 changes: 0 additions & 8 deletions haskell-overlays/splices-load-save/dep/ghc-8.6/git.json

This file was deleted.

14 changes: 0 additions & 14 deletions haskell-overlays/splices-load-save/dep/ghc-8.6/thunk.nix

This file was deleted.

57 changes: 0 additions & 57 deletions haskell-overlays/splices-load-save/load-splices.nix

This file was deleted.

38 changes: 0 additions & 38 deletions haskell-overlays/splices-load-save/save-splices.nix

This file was deleted.

Loading