3
0
Fork 0
forked from mirrors/nixpkgs

OCaml build support: add oasis build system

This commit is contained in:
Merlin Göttlinger 2019-08-01 10:44:04 +02:00
parent ff13b6f1ac
commit 2ea2643b13
No known key found for this signature in database
GPG key ID: F3DD4A06EDED86E5
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,31 @@
{ buildOcaml, ocaml_oasis }:
{ name, version, buildInputs ? [], ...
}@args:
buildOcaml (args // {
buildInputs = [ ocaml_oasis ] ++ buildInputs;
buildPhase = ''
runHook preBuild
oasis setup
ocaml setup.ml -configure
ocaml setup.ml -build
runHook postBuild
'';
checkPhase = ''
runHook preCheck
ocaml setup.ml -test
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out
sed -i s+/usr/local+$out+g setup.ml
sed -i s+/usr/local+$out+g setup.data
prefix=$OCAMLFIND_DESTDIR ocaml setup.ml -install
runHook postInstall
'';
})

View file

@ -12,6 +12,8 @@ let
buildOcaml = callPackage ../build-support/ocaml { };
buildOasisPackage = callPackage ../build-support/ocaml/oasis.nix { buildOcaml = buildOcaml; };
buildDunePackage = callPackage ../build-support/ocaml/dune.nix {};
alcotest = callPackage ../development/ocaml-modules/alcotest {};