diff --git a/pkgs/development/tools/ocaml/oasis/default.nix b/pkgs/development/tools/ocaml/oasis/default.nix index 4d3536ad6524..38a11db77626 100644 --- a/pkgs/development/tools/ocaml/oasis/default.nix +++ b/pkgs/development/tools/ocaml/oasis/default.nix @@ -9,54 +9,57 @@ ocamlify, }: -stdenv.mkDerivation { - version = "0.4.11"; - pname = "ocaml-oasis"; +lib.throwIf (lib.versionAtLeast ocaml.version "5.0") "oasis is not available for OCaml ≥ 5.0" - src = fetchurl { - url = "https://download.ocamlcore.org/oasis/oasis/0.4.11/oasis-0.4.11.tar.gz"; - hash = "sha256-GLc97vTtbpqDM38ks7vi3tZSaLP/cwn8wA0l5X4dwS4="; - }; + stdenv.mkDerivation + { + version = "0.4.11"; + pname = "ocaml-oasis"; - createFindlibDestdir = true; + src = fetchurl { + url = "https://download.ocamlcore.org/oasis/oasis/0.4.11/oasis-0.4.11.tar.gz"; + hash = "sha256-GLc97vTtbpqDM38ks7vi3tZSaLP/cwn8wA0l5X4dwS4="; + }; - strictDeps = true; + createFindlibDestdir = true; - nativeBuildInputs = [ - ocaml - findlib - ocamlbuild - ocamlmod - ocamlify - ]; + strictDeps = true; - buildInputs = [ ocamlbuild ]; - - configurePhase = '' - runHook preConfigure - ocaml setup.ml -configure --prefix $out - runHook postConfigure - ''; - buildPhase = '' - runHook preBuild - ocaml setup.ml -build - runHook postBuild - ''; - installPhase = '' - runHook preInstall - ocaml setup.ml -install - runHook postInstall - ''; - - meta = with lib; { - description = "Configure, build and install system for OCaml projects"; - homepage = "https://github.com/ocaml/oasis"; - license = licenses.lgpl21; - maintainers = with maintainers; [ - vbgl - maggesi + nativeBuildInputs = [ + ocaml + findlib + ocamlbuild + ocamlmod + ocamlify ]; - mainProgram = "oasis"; - inherit (ocaml.meta) platforms; - }; -} + + buildInputs = [ ocamlbuild ]; + + configurePhase = '' + runHook preConfigure + ocaml setup.ml -configure --prefix $out + runHook postConfigure + ''; + buildPhase = '' + runHook preBuild + ocaml setup.ml -build + runHook postBuild + ''; + installPhase = '' + runHook preInstall + ocaml setup.ml -install + runHook postInstall + ''; + + meta = with lib; { + description = "Configure, build and install system for OCaml projects"; + homepage = "https://github.com/ocaml/oasis"; + license = licenses.lgpl21; + maintainers = with maintainers; [ + vbgl + maggesi + ]; + mainProgram = "oasis"; + inherit (ocaml.meta) platforms; + }; + }