From db1341ba2533987ded23b366040755c90023f38a Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 17 Nov 2020 16:50:12 +0700 Subject: [PATCH] Make odate work with OCaml >4.06 and OPAM >2.0 (#5) * Use new-style Stdlib rather than Pervasives. * Update the opam file for opam 2.x --- odate.opam | 15 +++++++++++---- src/duration_private.ml | 2 +- src/oDate.ml | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/odate.opam b/odate.opam index c6713ea..b0cdaf3 100644 --- a/odate.opam +++ b/odate.opam @@ -1,16 +1,23 @@ -opam-version: "1.2" +opam-version: "2.0" maintainer: "hugo.heuzard@gmail.com" authors: [ "Hugo Heuzard" ] license: "LGPL-2.1 with OCaml linking exception" homepage: "https://github.com/hhugo/odate" build: [ - ["dune" "build" "--only" "odate" "--root" "." "-j" jobs "@install"] + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] ] depends: [ + "ocaml" {>= "4.07.0"} "dune" {build} "menhir" {build} "base-unix" ] +synopsis: "Date & Duration Library" +description: """ +Simple date and duration manipulation. Also implement duration printer +based on string format. Already implemented in opalang +[http://opalang.org/]. For documentation about the format, see : +[http://doc.opalang.org/value/stdlib.core.date/Duration/try_generate_printer]. +""" dev-repo: "git://github.com/hhugo/odate" -available: [ ocaml-version >= "4.00.0" ] - diff --git a/src/duration_private.ml b/src/duration_private.ml index 8d14264..98f8af6 100644 --- a/src/duration_private.ml +++ b/src/duration_private.ml @@ -1,4 +1,4 @@ -module P = Pervasives +module P = Stdlib module O : sig diff --git a/src/oDate.ml b/src/oDate.ml index 6f9ada4..42e3a53 100644 --- a/src/oDate.ml +++ b/src/oDate.ml @@ -939,7 +939,7 @@ end module MakeImplem(C : Clock) : Implem = struct type t = float - let compare = Pervasives.compare + let compare = Stdlib.compare let add f i = f +. i let from_seconds x = x