nixpkgs/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix

36 lines
815 B
Nix
Raw Normal View History

{ buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } :
2016-09-13 21:42:26 +00:00
2021-10-31 12:35:20 +00:00
{ pname, version ? "113.33.03", buildInputs ? [],
2016-09-13 21:42:26 +00:00
hash ? "",
minimumSupportedOcamlVersion ? "4.02", ...
}@args:
buildOcaml (args // {
2021-10-31 12:35:20 +00:00
inherit pname version minimumSupportedOcamlVersion;
2016-09-13 21:42:26 +00:00
src = fetchurl {
2021-10-31 12:35:20 +00:00
url = "https://github.com/janestreet/${pname}/archive/${version}.tar.gz";
2016-09-13 21:42:26 +00:00
sha256 = hash;
};
hasSharedObjects = true;
buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs;
2016-09-13 21:42:26 +00:00
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
2016-09-13 21:42:26 +00:00
2021-10-31 12:35:20 +00:00
configurePhase = ''
./configure --prefix $out
'';
2016-09-13 21:42:26 +00:00
2021-10-31 12:35:20 +00:00
buildPhase = ''
OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make
'';
2016-09-13 21:42:26 +00:00
2021-10-31 12:35:20 +00:00
installPhase = ''
opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${pname}.install
'';
2016-09-13 21:42:26 +00:00
})