Skip to content

Commit

Permalink
ghcjs8_6: Overrides for building against nixpkgs-21.05
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-abrar committed Jul 15, 2022
1 parent ffc973c commit de5e113
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 9 deletions.
12 changes: 6 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ let iosSupport = system == "x86_64-darwin";
ghcjs = if __useNewerCompiler then ghcjs8_10 else ghcjs8_6;
ghcjs8_6 = (makeRecursivelyOverridable (nixpkgsCross.ghcjs.haskell.packages.ghcjs86.override (old: {
ghc = old.ghc.override {
bootPkgs = nixpkgsCross.ghcjs.buildPackages.haskell.packages.ghc865;
ghcjsSrc = fetchgit {
url = "https://github.com/obsidiansystems/ghcjs.git";
rev = "a00ecf0b2eaddbc4101c76e6ac95fc97b0f75840"; # ghc-8.6 branch
sha256 = "06cwpijwhj4jpprn07y3pkxmv40pwmqqw5jbdv4s7c67j5pmirnc";
fetchSubmodules = true;
bootPkgs = with nixpkgsCross.ghcjs.buildPackages.haskell.packages;
ghc865 // { happy = ghc865.callHackage "happy" "1.19.9" {}; };
cabal-install = import ./haskell-overlays/ghcjs-8.6/cabal-install.nix { inherit nixpkgs; };
ghcjsSrc = import ./haskell-overlays/ghcjs-8.6/src.nix {
inherit (nixpkgs.stdenvNoCC) mkDerivation;
inherit (nixpkgs) fetchgit;
};
};
}))).override {
Expand Down
13 changes: 13 additions & 0 deletions haskell-overlays/ghcjs-8.6/autoreconf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/ghc/aclocal.m4 b/ghc/aclocal.m4
index 6eda094315..c14c83914d 100644
--- a/ghc/aclocal.m4
+++ b/ghc/aclocal.m4
@@ -613,7 +613,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
CPPFLAGS="$$3"
unset ac_cv_prog_cc_c99
dnl perform detection
- _AC_PROG_CC_C99
+ AC_PROG_CC_C99
fp_cc_c99="$ac_cv_prog_cc_c99"
case "x$ac_cv_prog_cc_c99" in
x) ;; # noop
10 changes: 10 additions & 0 deletions haskell-overlays/ghcjs-8.6/cabal-install.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# The build of ghcjs8.6 uses cabal v1 commands, including v1-sdist, so we need an older cabal-install
{ nixpkgs }:
(nixpkgs.haskell.packages.ghc865.callHackage "cabal-install" "2.4.1.0" {}).overrideScope
(self: super: {
Cabal = self.Cabal_2_4_1_0;
base16-bytestring = self.base16-bytestring_0_1_1_7;
hackage-security = nixpkgs.haskell.lib.dontCheck
(nixpkgs.haskell.lib.doJailbreak
(self.callHackage "hackage-security" "0.5.3.0" {}));
})
22 changes: 22 additions & 0 deletions haskell-overlays/ghcjs-8.6/src.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ fetchgit, mkDerivation }:
let
rawSrc = fetchgit {
url = "https://github.com/obsidiansystems/ghcjs.git";
rev = "a00ecf0b2eaddbc4101c76e6ac95fc97b0f75840"; # ghc-8.6 branch
sha256 = "06cwpijwhj4jpprn07y3pkxmv40pwmqqw5jbdv4s7c67j5pmirnc";
fetchSubmodules = true;
};
# See https://gitlab.haskell.org/ghc/ghc/-/commit/ad2ef3a13f1eb000eab8e3d64592373b91a52806
autoreconfPatch = ./autoreconf.patch;
patchedSrc = mkDerivation {
name = "ghcjs-src-autoreconf-patched";
src = rawSrc;
buildPhase = ''
cp -r $src $out
chmod -R +w $out/*
cd $out
patch -p1 < ${autoreconfPatch}
'';
dontInstall = true;
};
in patchedSrc
2 changes: 1 addition & 1 deletion haskell-overlays/ghcjs-text-jsstring-8.6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ self: super: {
sha256 = "1vy7a81b1vcbfhv7l3m7p4hx365ss13mzbzkjn9751bn4n7x2ydd";
};
ghcjsBaseTextJSStringSrc = super.ghcjs-base.src.overrideAttrs (drv: {
outputHash = "1pdxlb67f94bl2b6k0m4flpjbf07g7fgqbyjnki4y57a5r0iympd";
outputHash = "19bsvv8g4kgjj2z7a8r8in4g8sshvvwn717n4664fnfn6xhzm2i6";
postFetch = (drv.postFetch or "") + ''
( cd $out
patch -p1 < ${./ghcjs-base-text-jsstring.patch}
Expand Down
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": "aa/reflex-platform-21.05-backport-ghc8.6.5",
"private": false,
"rev": "fac4ce2cc08051fa54558878a7ffa82b7ad850b4",
"sha256": "1y7mybgdqj77nkx7ll0m8lfl08r5asxmbdfyjp9gmjdzxr8psang"
"rev": "c459a50dd34f23d39405a9b6656936d8498db731",
"sha256": "0g4l0hn2az75rb357gz487769441vq70awzahzv84k4hhh974vri"
}

0 comments on commit de5e113

Please sign in to comment.