summary refs log tree commit diff
path: root/pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix
blob: 56b69ea267f95a4476f92b185e9963132e16ae2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ perl
, autoconf
, automake
, python3
, gcc
, cabal-install
, runCommand
, lib
, stdenv

, ghc
, happy
, alex

, ghcjsSrc
}:

runCommand "configured-ghcjs-src" {
  buildInputs = [
    perl
    autoconf
    automake
    python3
    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"

  # 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
  mkdir -p ghc/compiler/vectorise
  mkdir -p ghc/utils/haddock/haddock-library/vendor

  patchShebangs .
  ./utils/makePackages.sh copy
''