Skip to content

Commit

Permalink
Try just addding ghc 8.10 native, no mobile or ghcjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Oct 21, 2021
1 parent 1aba6f3 commit c95c095
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 17 deletions.
4 changes: 4 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ let iosSupport = system == "x86_64-darwin";
ghcHEAD = (makeRecursivelyOverridable nixpkgs.haskell.packages.ghcHEAD).override {
overrides = nixpkgs.haskell.overlays.combined;
};
ghc8_10 = (makeRecursivelyOverridable nixpkgs.haskell.packages.ghc8104).override {
overrides = nixpkgs.haskell.overlays.combined;
};
ghc8_6 = (makeRecursivelyOverridable nixpkgs.haskell.packages.ghc865).override {
overrides = nixpkgs.haskell.overlays.combined;
};
Expand Down Expand Up @@ -305,6 +308,7 @@ in let this = rec {
ghc
ghcHEAD
ghc8_6
ghc8_10
ghcIosSimulator64
ghcIosAarch64
ghcIosAarch64-8_6
Expand Down
17 changes: 10 additions & 7 deletions haskell-overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ rec {

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

getGhcVersion = ghc:
if ghc.isGhcjs or false
then ghc.ghcVersion
else ghc.version;
getGhcVersion = ghc: ghc.version;

##
## Conventional roll ups of all the constituent overlays below.
Expand Down Expand Up @@ -67,20 +64,21 @@ rec {
any-8
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) any-8_6)
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) haskell-gi-8_6)
(optionalExtension (lib.versionOlder "8.7" (getGhcVersion super.ghc)) any-head)
(optionalExtension (versionWildcard [ 8 10 ] (getGhcVersion super.ghc)) haskell-gi-8_10)
(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.7" super.ghc.version) ghc-head)
(optionalExtension (lib.versionOlder "8.11" super.ghc.version) ghc-head)
] self super;

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

combined-ghcjs-8_6 = self: super: foldExtensions [
ghcjs
(optionalExtension useTextJSString textJSString-8_6)
(optionalExtension useTextJSString ghcjs-8_6-textJSString)
(optionalExtension useFastWeak ghcjs-fast-weak_8_6)
Expand Down Expand Up @@ -159,6 +157,11 @@ rec {
inherit fetchFromGitHub;
inherit nixpkgs;
};
haskell-gi-8_10 = import ./haskell-gi-8.10 {
inherit haskellLib;
inherit fetchFromGitHub;
inherit nixpkgs;
};

untriaged = import ./untriaged.nix {
inherit haskellLib;
Expand Down
37 changes: 37 additions & 0 deletions haskell-overlays/haskell-gi-8.10/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ haskellLib
, fetchFromGitHub
, nixpkgs
}:
with haskellLib;
let # Adds additional arguments to 'buildInputs' and the 'HASKELL_GI_GIR_SEARCH_PATH' environment variable
# used by haskell-gi to specify non-standard locations .gir file locations
# addGIDeps :: haskellPackage -> [nixPackage] -> [nixPackage] -> haskellPackage
addGIDeps = p: extraBuildInputs: girSearchPathPackages: p.overrideAttrs (drv: {
# cabal2nix puts these deps in libraryPkgconfigDepends but that doesn't seem to suffice.
buildInputs = with nixpkgs; drv.buildInputs or [] ++ [ pkgconfig gobjectIntrospection ] ++ extraBuildInputs;
libraryPkgconfigDepends = drv.libraryPkgconfigDepends or [] ++ [nixpkgs.gobject-introspection];
# This preConfigure should have been added by cabal2nix according to this commit: https://github.com/NixOS/cabal2nix/commit/426fde8847370c32731a1db314283f5ebcbabeb7
# though that functionality was removed in a later commit: https://github.com/NixOS/cabal2nix/commit/2d278a8a1527b278939ba478fe915aa2f87cc22e#diff-387ec31295a66a4f73b8d4b507a239a2
# Cf. https://github.com/haskell-gi/haskell-gi/issues/36
preConfigure = "export HASKELL_GI_GIR_SEARCH_PATH=" +
nixpkgs.lib.concatStringsSep ":"
(map (x: "${x.dev}/share/gir-1.0") ([nixpkgs.gobjectIntrospection] ++ girSearchPathPackages));
});
in self: super: {

# Overrides for gi-* family of libraries. See addGIDeps, above.
haskell-gi-base = addGIDeps (super.haskell-gi-base) [nixpkgs.glib] [];
gi-glib = addGIDeps (super.gi-glib) [] [];
gi-cairo = addGIDeps (super.gi-cairo) [nixpkgs.cairo] [];
gi-gobject = addGIDeps (super.gi-gobject) [] [];
gi-pango = addGIDeps (super.gi-pango) [nixpkgs.pango] [];
gi-gio = addGIDeps (super.gi-gio) [] [];
gi-atk = addGIDeps (super.gi-atk) [] [];
gi-javascriptcore = addGIDeps (super.gi-javascriptcore) [] [];
gi-gdkpixbuf = addGIDeps (super.gi-gdkpixbuf) [nixpkgs.gdk_pixbuf nixpkgs.gtk3] [nixpkgs.gtk3];
gi-gdk = addGIDeps (super.gi-gdk) [nixpkgs.gdk_pixbuf nixpkgs.pango nixpkgs.gtk3] [nixpkgs.gtk3];
gi-soup = addGIDeps (super.gi-soup) [nixpkgs.gdk_pixbuf] [nixpkgs.libsoup];
gi-gtk = addGIDeps (super.gi-gtk) [nixpkgs.gdk_pixbuf nixpkgs.gtk3] [nixpkgs.gtk3 nixpkgs.atk nixpkgs.pango];
gi-webkit2 = addGIDeps (super.gi-webkit2) [] [nixpkgs.webkitgtk];

}
4 changes: 2 additions & 2 deletions haskell-overlays/reflex-packages/dep/jsaddle/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "jsaddle",
"branch": "master",
"private": false,
"rev": "97273656e28790ab6e35c827f8086cf47bfbedca",
"sha256": "1bdgi348ndhjvsr60q1vl9f12yigqy604y6wrrsp4bkb79hfax3d"
"rev": "9cb3534b6b2dc948c6fa88fce281e59e904b43e4",
"sha256": "1drgrgjnxamq8vh6mrqg62xcj7vb9makpy89bls485d6ckigv3ha"
}
6 changes: 3 additions & 3 deletions haskell-overlays/reflex-packages/dep/reflex-ghci/github.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"owner": "reflex-frp",
"repo": "reflex-ghci",
"branch": "release/0.1.5.2",
"branch": "[email protected]",
"private": false,
"rev": "b4d00759c2f855d9aff2bf75b351ccecd519cfe6",
"sha256": "0labgcb9alhw1zid4a5ln561231c96aqab4i9bnk2fbyz2sz53pc"
"rev": "6db4e08be2ed8c8cec7e83d18d02fecfff6a8c5c",
"sha256": "1y1b1i7xdyk3dwq2sz64pwnlacrqw6bv0xhv5cvz7h4yg9yfshm2"
}
2 changes: 2 additions & 0 deletions haskell-overlays/untriaged.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ self: super: {
data-fix = self.callHackage "data-fix" "0.3.0" {};
neat-interpolation = self.callHackage "neat-interpolation" "0.4" {};
prettyprinter = self.callHackage "prettyprinter" "1.7.0" {};
cryptohash-sha512 = doJailbreak super.cryptohash-sha512;
ListLike = self.callHackage "ListLike" "4.7.3" {};

}
4 changes: 2 additions & 2 deletions nixpkgs-overlays/all-cabal-hashes/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
self: _: {

all-cabal-hashes = self.fetchurl {
url = https://github.com/commercialhaskell/all-cabal-hashes/archive/0830e8b2bb708de5619928a52044a90e9d3dad29.tar.gz;
sha256 = "1w7svsx8lvsp421220xnmh312an09gcqxmik72y28cvxk7zi0375";
url = https://github.com/commercialhaskell/all-cabal-hashes/archive/05301ee6f2076533bdd2a6b1f0c26d2912f1fe4d.tar.gz;
sha256 = "1v43gg0pm8mr20n5ifh4hgwvxya71rmipfi291wj0hhwssy6zkq2";
};

}
4 changes: 2 additions & 2 deletions nixpkgs/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "nixpkgs",
"branch": "reflex-platform-20.09",
"private": false,
"rev": "9c9b49a68d4fa4075f288cba01f2284bad4e8610",
"sha256": "03jk387bxxglfwbzyhlqrb2qgj46ffkvqzd5wb1v2ciijl2f579k"
"rev": "198e8aba0d5225765323a8a958ebf7732d8b3ce8",
"sha256": "0ww6v1pm8r5lyxnfvps6hs3pl8v3p78jzs64qgqwihmd4wydxppz"
}
5 changes: 4 additions & 1 deletion release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ let
# tryReflexShell = reflex-platform.tryReflexShell;
ghc.ReflexTodomvc = reflex-platform.ghc.reflex-todomvc;
ghc8_6.reflexTodomvc = reflex-platform.ghc8_6.reflex-todomvc;
ghc8_10.reflexTodomvc = reflex-platform.ghc8_10.reflex-todomvc;
ghc.reflex-vty = reflex-platform.ghc.reflex-vty;
ghc.reflex-process = reflex-platform.ghc.reflex-process;
ghc.reflex-fsnotify = reflex-platform.ghc.reflex-fsnotify;
Expand All @@ -91,7 +92,9 @@ let
};
skeleton-test-project-android = skeleton-test.project.android;
} // lib.optionalAttrs (reflex-platform.iosSupport) {
inherit (reflex-platform) iosReflexTodomvc iosReflexTodomvc-8_6 iosSimulatorReflexTodomvc;
inherit (reflex-platform) iosReflexTodomvc;
inherit (reflex-platform) iosReflexTodomvc-8_6;
inherit (reflex-platform) iosSimulatorReflexTodomvc;
skeleton-test-project-ios = skeleton-test.project.ios;
} // drvListToAttrs otherDeps
# TODO fix GHCJS profiling builds
Expand Down
6 changes: 6 additions & 0 deletions scripts/run-in-ios-sim
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq

# NB: Running the "xcrun simctl" command below may result in the error:
#
# xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
#
# The fix is to open up Xcode Preferences, go to Locations, and set the "Command Line Tools" option.

set -euo pipefail

name="${1##*/}"
Expand Down

0 comments on commit c95c095

Please sign in to comment.