summary refs log blame commit diff
path: root/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
blob: fdb0d8034e690e6a0d62ad33246031cd9adc20e3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
                                                                














                                                                            
                                                                      






                                                                       
                                                                                      

  
{ buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } :

{ name, version ? "113.33.03", buildInputs ? [],
  hash ? "",
  minimumSupportedOcamlVersion ? "4.02", ...
}@args:

buildOcaml (args // {
  inherit name version minimumSupportedOcamlVersion;
  src = fetchurl {
    url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz";
    sha256 = hash;
  };

  hasSharedObjects = true;

  buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs;

  dontAddPrefix = true;

  configurePhase = "./configure --prefix $out";

  buildPhase = "OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make";

  installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install";

})