Fix GHCJS 8.4/8.2 in sandboxed builds (#41411)

This commit is contained in:
Will Fancher 2018-06-03 17:28:17 -04:00 committed by xeji
parent 0644b4d948
commit ea52ca64e8
2 changed files with 10 additions and 6 deletions

View file

@ -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"

View file

@ -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