diff --git a/pkgs/development/ocaml-modules/ptime/default.nix b/pkgs/development/ocaml-modules/ptime/default.nix index ee12abd3e3b1..9c1914b0f322 100644 --- a/pkgs/development/ocaml-modules/ptime/default.nix +++ b/pkgs/development/ocaml-modules/ptime/default.nix @@ -1,28 +1,40 @@ -{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg +{ stdenv +, lib +, fetchurl +, ocaml +, findlib +, ocamlbuild +, topkg }: -lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08") - "ptime is not available for OCaml ${ocaml.version}" - -stdenv.mkDerivation rec { - version = "1.0.0"; +stdenv.mkDerivation (finalAttrs: { + version = "1.1.0"; pname = "ocaml${ocaml.version}-ptime"; src = fetchurl { - url = "https://erratique.ch/software/ptime/releases/ptime-${version}.tbz"; - sha256 = "sha256-RByDjAFiyDdR8G663/MxabuSHTTuwVn7urtw7Z3iEQs="; + url = "https://erratique.ch/software/ptime/releases/ptime-${finalAttrs.version}.tbz"; + hash = "sha256-y/WxVFT7JxBeLDNAI+HhHY+TnXF4hw9cvo7SbfcBPrE="; }; - nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; - buildInputs = [ topkg ]; + nativeBuildInputs = [ + findlib + ocaml + ocamlbuild + topkg + ]; + + buildInputs = [ + topkg + ]; strictDeps = true; inherit (topkg) buildPhase installPhase; meta = { - homepage = "https://erratique.ch/software/ptime"; description = "POSIX time for OCaml"; + homepage = "https://erratique.ch/software/ptime"; + license = lib.licenses.isc; longDescription = '' Ptime has platform independent POSIX time support in pure OCaml. It provides a type to represent a well-defined range of POSIX timestamps @@ -35,7 +47,6 @@ stdenv.mkDerivation rec { Ptime is not a calendar library. ''; - license = lib.licenses.isc; maintainers = with lib.maintainers; [ sternenseemann ]; }; -} +}) diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 85c79981cc00..02e659de3a99 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1433,7 +1433,10 @@ let psq = callPackage ../development/ocaml-modules/psq { }; - ptime = callPackage ../development/ocaml-modules/ptime { }; + ptime = + if lib.versionAtLeast ocaml.version "4.08" + then callPackage ../development/ocaml-modules/ptime { } + else null; ptmap = callPackage ../development/ocaml-modules/ptmap { };