From 682ef85c6fdb19b1e8cd0d0a430ea4ec6dfa3954 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 15 Jul 2018 22:13:52 -0400 Subject: [PATCH 1/6] Make GHCJS 8.4 the default, in line with LTS 12.x --- pkgs/development/compilers/ghcjs-ng/README.md | 6 +++--- pkgs/top-level/haskell-packages.nix | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ghcjs-ng/README.md b/pkgs/development/compilers/ghcjs-ng/README.md index 3e1598c83b05..b75e4331651f 100644 --- a/pkgs/development/compilers/ghcjs-ng/README.md +++ b/pkgs/development/compilers/ghcjs-ng/README.md @@ -12,9 +12,9 @@ Updating --- ``` -$ nix-prefetch-git https://github.com/ghcjs/ghcjs --rev refs/heads/ghc-8.2 \ +$ nix-prefetch-git https://github.com/ghcjs/ghcjs --rev refs/heads/ghc-8.4 \ | jq '{ url, rev, fetchSubmodules, sha256 }' \ - > 8.2/git.json -$ cat $(nix-build ../../../.. -A haskell.compiler.ghcjs82.genStage0 --no-out-link) > 8.2/stage0.nix + > 8.4/git.json +$ cat $(nix-build ../../../.. -A haskell.compiler.ghcjs82.genStage0 --no-out-link) > 8.4/stage0.nix ``` diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index cca0b7ba3460..5fef4872db21 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -84,7 +84,7 @@ in rec { buildLlvmPackages = buildPackages.llvmPackages_5; llvmPackages = pkgs.llvmPackages_5; }; - ghcjs = compiler.ghcjs82; + ghcjs = compiler.ghcjs84; ghcjs710 = packages.ghc7103.callPackage ../development/compilers/ghcjs { bootPkgs = packages.ghc7103; inherit (pkgs) cabal-install; @@ -166,7 +166,7 @@ in rec { ghc = bh.compiler.ghcHEAD; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; }; - ghcjs = packages.ghcjs82; + ghcjs = packages.ghcjs84; ghcjs710 = callPackage ../development/haskell-modules rec { buildHaskellPackages = ghc.bootPkgs; ghc = bh.compiler.ghcjs710; From 8488982ee3863678e5b013100de6cb1b4e4a1c7c Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 15 Jul 2018 22:41:27 -0400 Subject: [PATCH 2/6] Fixed some core packages in GHCJS 8.4 --- pkgs/development/haskell-modules/configuration-ghcjs.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs.nix index f1a60f5ea878..1e9492f3ec9a 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs.nix @@ -23,6 +23,11 @@ self: super: }; in stage1 // stage2 // { + # GHCJS does not ship with the same core packages as GHC. + # https://github.com/ghcjs/ghcjs/issues/676 + stm = self.stm_2_4_5_0; + ghc-compact = self.ghc-compact_0_1_0_0; + network = addBuildTools super.network (pkgs.lib.optional pkgs.buildPlatform.isDarwin pkgs.buildPackages.darwin.libiconv); zlib = addBuildTools super.zlib (pkgs.lib.optional pkgs.buildPlatform.isDarwin pkgs.buildPackages.darwin.libiconv); unix-compat = addBuildTools super.unix-compat (pkgs.lib.optional pkgs.buildPlatform.isDarwin pkgs.buildPackages.darwin.libiconv); From 68ea661bb438ec995fc26c0a2a3cc8040421e1b3 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 15 Jul 2018 22:53:28 -0400 Subject: [PATCH 3/6] Fix various packages under GHCJS --- pkgs/development/haskell-modules/configuration-ghcjs.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs.nix index 1e9492f3ec9a..dfb500f27f81 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs.nix @@ -202,4 +202,11 @@ self: super: base-orphans = dontCheck super.base-orphans; distributive = dontCheck super.distributive; + + # https://github.com/glguy/th-abstraction/issues/53 + th-abstraction = dontCheck super.th-abstraction; + # https://github.com/dreixel/syb/issues/21 + syb = dontCheck super.syb; + # https://github.com/ghcjs/ghcjs/issues/677 + hspec-core = dontCheck super.hspec-core; } From ff83aca51139a21a2dc6a2c20a25a0fad12358f6 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 15 Jul 2018 22:53:54 -0400 Subject: [PATCH 4/6] Added ghcjs-base to GHCJS 8.4 / 8.2 --- pkgs/development/compilers/ghcjs-ng/README.md | 1 + .../compilers/ghcjs-ng/default.nix | 7 ++++- .../compilers/ghcjs-ng/ghcjs-base.nix | 29 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix diff --git a/pkgs/development/compilers/ghcjs-ng/README.md b/pkgs/development/compilers/ghcjs-ng/README.md index b75e4331651f..6292f0cd4d23 100644 --- a/pkgs/development/compilers/ghcjs-ng/README.md +++ b/pkgs/development/compilers/ghcjs-ng/README.md @@ -16,5 +16,6 @@ $ nix-prefetch-git https://github.com/ghcjs/ghcjs --rev refs/heads/ghc-8.4 \ | jq '{ url, rev, fetchSubmodules, sha256 }' \ > 8.4/git.json $ cat $(nix-build ../../../.. -A haskell.compiler.ghcjs82.genStage0 --no-out-link) > 8.4/stage0.nix +$ cabal2nix git://github.com/ghcjs/ghcjs-base > ghcjs-base.nix ``` diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix index 9aa3efe614eb..ddabb7ca6bfc 100644 --- a/pkgs/development/compilers/ghcjs-ng/default.nix +++ b/pkgs/development/compilers/ghcjs-ng/default.nix @@ -18,6 +18,7 @@ , lib , nodePackages , ghcjsDepOverrides ? (_:_:{}) +, haskell }: let @@ -48,7 +49,11 @@ let # Relics of the old GHCJS build system stage1Packages = []; - mkStage2 = _: {}; + mkStage2 = { callPackage }: { + # https://github.com/ghcjs/ghcjs-base/issues/110 + # https://github.com/ghcjs/ghcjs-base/pull/111 + ghcjs-base = haskell.lib.dontCheck (haskell.lib.doJailbreak (callPackage ./ghcjs-base.nix {})); + }; haskellCompilerName = "ghcjs-${bootGhcjs.version}"; }; diff --git a/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix b/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix new file mode 100644 index 000000000000..d03843aa336a --- /dev/null +++ b/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix @@ -0,0 +1,29 @@ +{ mkDerivation, aeson, array, attoparsec, base, binary, bytestring +, containers, deepseq, directory, dlist, fetchgit, ghc-prim +, ghcjs-prim, hashable, HUnit, integer-gmp, primitive, QuickCheck +, quickcheck-unicode, random, scientific, stdenv, test-framework +, test-framework-hunit, test-framework-quickcheck2, text, time +, transformers, unordered-containers, vector +}: +mkDerivation { + pname = "ghcjs-base"; + version = "0.2.0.0"; + src = fetchgit { + url = "git://github.com/ghcjs/ghcjs-base"; + sha256 = "0qr05m0djll3x38dhl85pl798arsndmwfhil8yklhb70lxrbvfrs"; + rev = "01014ade3f8f5ae677df192d7c2a208bd795b96c"; + }; + libraryHaskellDepends = [ + aeson attoparsec base binary bytestring containers deepseq dlist + ghc-prim ghcjs-prim hashable integer-gmp primitive scientific text + time transformers unordered-containers vector + ]; + testHaskellDepends = [ + array base bytestring deepseq directory ghc-prim ghcjs-prim HUnit + primitive QuickCheck quickcheck-unicode random test-framework + test-framework-hunit test-framework-quickcheck2 text + ]; + homepage = "http://github.com/ghcjs/ghcjs-base"; + description = "base library for GHCJS"; + license = stdenv.lib.licenses.mit; +} From 2781b1fcbc71f1140f715d9c064b92354e5ef5a1 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 15 Jul 2018 22:54:19 -0400 Subject: [PATCH 5/6] Fix ghcjs-dom-jsffi with GHCJS 8.4 --- pkgs/development/haskell-modules/configuration-ghcjs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs.nix index dfb500f27f81..c79406a94727 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs.nix @@ -126,7 +126,6 @@ self: super: }); ghcjs-dom-jsffi = overrideCabal super.ghcjs-dom-jsffi (drv: { - setupHaskellDepends = (drv.setupHaskellDepends or []) ++ [ self.buildHaskellPackages.Cabal_1_24_2_0 ]; libraryHaskellDepends = (drv.libraryHaskellDepends or []) ++ [ self.ghcjs-base self.text ]; isLibrary = true; }); From 79362be2832b9ed1db72ae057305afb89960b950 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Mon, 16 Jul 2018 01:14:55 -0400 Subject: [PATCH 6/6] Update readme with --compiler option for GHCJS --- pkgs/development/compilers/ghcjs-ng/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ghcjs-ng/README.md b/pkgs/development/compilers/ghcjs-ng/README.md index 6292f0cd4d23..99ad980c965e 100644 --- a/pkgs/development/compilers/ghcjs-ng/README.md +++ b/pkgs/development/compilers/ghcjs-ng/README.md @@ -16,6 +16,6 @@ $ nix-prefetch-git https://github.com/ghcjs/ghcjs --rev refs/heads/ghc-8.4 \ | jq '{ url, rev, fetchSubmodules, sha256 }' \ > 8.4/git.json $ cat $(nix-build ../../../.. -A haskell.compiler.ghcjs82.genStage0 --no-out-link) > 8.4/stage0.nix -$ cabal2nix git://github.com/ghcjs/ghcjs-base > ghcjs-base.nix +$ cabal2nix --compiler ghcjs git://github.com/ghcjs/ghcjs-base > ghcjs-base.nix ```