From 7a23f1accaccdbadfb28da89e00c2489aa96245c Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Tue, 29 May 2018 17:39:21 -0400 Subject: [PATCH] GHCJS darwin fixes (#41120) * GHCJS darwin fixes * Fix ghcjs 80 and 710 packages * Add socket-io to ghcjs 82 and 84 passthru --- pkgs/development/compilers/ghcjs-ng/default.nix | 8 +++++++- pkgs/top-level/haskell-packages.nix | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix index 035687a64f3a..7f13c373942d 100644 --- a/pkgs/development/compilers/ghcjs-ng/default.nix +++ b/pkgs/development/compilers/ghcjs-ng/default.nix @@ -14,7 +14,9 @@ , xorg , gmp , pkgconfig +, gcc , lib +, nodePackages , ghcjsDepOverrides ? (_:_:{}) }: @@ -40,6 +42,8 @@ let inherit (bootGhcjs) version; isGhcjs = true; + socket-io = nodePackages."socket.io"; + # Relics of the old GHCJS build system stage1Packages = []; mkStage2 = _: {}; @@ -49,7 +53,7 @@ let libexec = if builtins.compareVersions bootGhcjs.version "8.3" <= 0 then "${bootGhcjs}/bin" - else "${bootGhcjs}/libexec/${stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}"; + else "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin"] ["osx"] stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}"; in stdenv.mkDerivation { name = "ghcjs"; @@ -63,6 +67,8 @@ in stdenv.mkDerivation { xorg.lndir gmp pkgconfig + ] ++ lib.optionals stdenv.isDarwin [ + gcc # https://github.com/ghcjs/ghcjs/issues/663 ]; phases = ["unpackPhase" "buildPhase"]; buildPhase = '' diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 2e6bd5ebb853..fab88ab180b5 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -159,13 +159,13 @@ in rec { ghcjs = packages.ghcjs82; ghcjs710 = callPackage ../development/haskell-modules rec { buildHaskellPackages = ghc.bootPkgs; - ghc = bh.compiler.ghcjs; + ghc = bh.compiler.ghcjs710; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; }; ghcjs80 = callPackage ../development/haskell-modules rec { buildHaskellPackages = ghc.bootPkgs; - ghc = bh.compiler.ghcjsHEAD; + ghc = bh.compiler.ghcjs80; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; };