diff --git a/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix b/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix index e8c24b21134..57d9fccd266 100644 --- a/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix +++ b/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix @@ -6,6 +6,8 @@ , cabal-install , gmp , runCommand +, lib +, stdenv , ghc , happy @@ -20,15 +22,18 @@ runCommand "configured-ghcjs-src" { autoconf automake python3 - gcc ghc happy alex cabal-install + ] ++ lib.optionals stdenv.isDarwin [ + gcc # https://github.com/ghcjs/ghcjs/issues/663 ]; inherit ghcjsSrc; } '' export HOME=$(pwd) + mkdir $HOME/.cabal + touch $HOME/.cabal/config cp -r "$ghcjsSrc" "$out" chmod -R +w "$out" cd "$out" diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix index 7f13c373942..04c3431f6f2 100644 --- a/pkgs/development/compilers/ghcjs-ng/default.nix +++ b/pkgs/development/compilers/ghcjs-ng/default.nix @@ -50,13 +50,10 @@ let }; bootGhcjs = haskellLib.justStaticExecutables passthru.bootPkgs.ghcjs; - libexec = - if builtins.compareVersions bootGhcjs.version "8.3" <= 0 - then "${bootGhcjs}/bin" - else "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin"] ["osx"] stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}"; + libexec = "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin"] ["osx"] stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}"; in stdenv.mkDerivation { - name = "ghcjs"; + name = bootGhcjs.name; src = passthru.configuredSrc; nativeBuildInputs = [ bootGhcjs @@ -73,6 +70,8 @@ in stdenv.mkDerivation { phases = ["unpackPhase" "buildPhase"]; buildPhase = '' export HOME=$TMP + mkdir $HOME/.cabal + touch $HOME/.cabal/config cd lib/boot mkdir -p $out/bin