summary refs log tree commit diff
path: root/pkgs/development/compilers/bs-platform/ocaml.nix
blob: 3fe0e0b2eede55f52ca636041f6b15175cd35523 (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
{ lib, stdenv, src, version }:
stdenv.mkDerivation rec {
  inherit src version;
  pname = "ocaml-bs";
  configurePhase = ''
    ./configure -prefix $out
  '';

  # Workaround ocaml-4.06 limitation of duplicate definitions.
  #   ld: libcamlrun.a(minor_gc.o):/build/ocaml/byterun/caml/major_gc.h:67: multiple definition of
  #     `caml_major_ring'; libcamlrun.a(stacks.o):/build/ocaml/byterun/caml/major_gc.h:67: first defined here
  # Match -fcommon workaround in ocaml-4.06 itself.
  NIX_CFLAGS_COMPILE = "-fcommon";

  buildPhase = ''
    make -j9 world.opt
  '';

  meta = with lib; {
    branch = "4.06";
    platforms = platforms.all;
  };
}