nixpkgs/pkgs/build-support/ocaml/oasis.nix

32 lines
597 B
Nix
Raw Normal View History

{ buildOcaml, ocaml_oasis }:
2019-08-06 04:46:03 +00:00
{ 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
'';
})