2018-05-12 06:06:47 +01:00
|
|
|
{ perl
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, python3
|
|
|
|
, gcc
|
|
|
|
, cabal-install
|
|
|
|
, runCommand
|
2018-06-03 22:28:17 +01:00
|
|
|
, lib
|
|
|
|
, stdenv
|
2018-05-12 06:06:47 +01:00
|
|
|
|
|
|
|
, ghc
|
|
|
|
, happy
|
|
|
|
, alex
|
|
|
|
|
|
|
|
, ghcjsSrc
|
|
|
|
}:
|
|
|
|
|
|
|
|
runCommand "configured-ghcjs-src" {
|
|
|
|
buildInputs = [
|
|
|
|
perl
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
python3
|
|
|
|
ghc
|
|
|
|
happy
|
|
|
|
alex
|
|
|
|
cabal-install
|
2018-06-03 22:28:17 +01:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
gcc # https://github.com/ghcjs/ghcjs/issues/663
|
2018-05-12 06:06:47 +01:00
|
|
|
];
|
|
|
|
inherit ghcjsSrc;
|
|
|
|
} ''
|
|
|
|
export HOME=$(pwd)
|
2018-06-03 22:28:17 +01:00
|
|
|
mkdir $HOME/.cabal
|
|
|
|
touch $HOME/.cabal/config
|
2018-05-12 06:06:47 +01:00
|
|
|
cp -r "$ghcjsSrc" "$out"
|
|
|
|
chmod -R +w "$out"
|
|
|
|
cd "$out"
|
|
|
|
|
|
|
|
# TODO: Find a better way to avoid impure version numbers
|
|
|
|
sed -i 's/RELEASE=NO/RELEASE=YES/' ghc/configure.ac
|
|
|
|
|
|
|
|
# TODO: How to actually fix this?
|
|
|
|
# Seems to work fine and produce the right files.
|
|
|
|
touch ghc/includes/ghcautoconf.h
|
2019-01-14 23:04:19 +00:00
|
|
|
mkdir -p ghc/compiler/vectorise
|
|
|
|
mkdir -p ghc/utils/haddock/haddock-library/vendor
|
2018-05-12 06:06:47 +01:00
|
|
|
|
|
|
|
patchShebangs .
|
|
|
|
./utils/makePackages.sh copy
|
|
|
|
''
|