diff mbox series

[bug#49867,15/29] gnu: Add ocaml-ptime.

Message ID 20210804071545.21181-15-pukkamustard@posteo.net
State Accepted
Headers show
Series gnu: Add ocaml-cohttp-lwt-unix. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

pukkamustard Aug. 4, 2021, 7:15 a.m. UTC
* gnu/packages/ocaml.scm (ocaml-ptime): New variable.
---
 gnu/packages/ocaml.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

Comments

Xinglu Chen Aug. 5, 2021, 3:48 p.m. UTC | #1
On Wed, Aug 04 2021, pukkamustard wrote:

> * gnu/packages/ocaml.scm (ocaml-ptime): New variable.
> ---
>  gnu/packages/ocaml.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>
> diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
> index a34c844059..ab385eb26f 100644
> --- a/gnu/packages/ocaml.scm
> +++ b/gnu/packages/ocaml.scm
> @@ -7487,6 +7487,48 @@ number generator interface, and implementations.")))
>      (description "@code{ocaml-mirage-crypto-pk} provides public-key
>  cryptography (RSA, DSA, DH) for OCaml.")))
>  
> +(define-public ocaml-ptime
> +  (package
> +    (name "ocaml-ptime")
> +    (version "0.8.5")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri "https://erratique.ch/software/ptime/releases/ptime-0.8.5.tbz")

Use (string-append "https://erratique.ch..." version ".tbz") to make it
easier to update the package in the future.

> +       (sha256
> +        (base32
> +         "1fxq57xy1ajzfdnvv5zfm7ap2nf49znw5f9gbi4kb9vds942ij27"))))
> +    (build-system ocaml-build-system)
> +    (arguments
> +     `(#:tests? #f

What’s the reason for disabling tests?

> +       #:build-flags (list "build" "--with-js_of_ocaml" "false")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure))))
> +    (propagated-inputs
> +     `(("ocaml-result" ,ocaml-result)))
> +    (native-inputs
> +     `(("ocamlbuild" ,ocamlbuild)
> +       ("ocaml-topkg" ,ocaml-topkg)
> +       ("opam" ,opam)))
> +    (home-page "https://erratique.ch/software/ptime")
> +    (synopsis "POSIX time for OCaml")
> +    (description "Ptime has platform independent POSIX time support in pure
> +OCaml. It provides a type to represent a well-defined range of POSIX
         ^
Double spacing.  :-)

> +timestamps with picosecond precision, conversion with date-time values,
> +conversion with RFC 3339 timestamps and pretty printing to a human-readable,
> +locale-independent representation.
> +
> +The additional Ptime_clock library provides access to a system POSIX clock and
> +to the system's current time zone offset.
> +
> +Ptime is not a calendar library.

Not really sure if this sentence is necessary.  I think the previous
sentences has hade it pretty clear that it a time and date library.

> +Ptime depends on the @code{ocaml-result} compatibility package. Ptime_clock
> +depends on your system library. Ptime_clock's optional JavaScript support
> +depends on @code{js-of-ocaml}.")

This two sentences are probably also not necessary for users of the
package.  It should be the packager’s job to specify the dependencies.  :-)
pukkamustard Aug. 8, 2021, 11:13 a.m. UTC | #2
Xinglu Chen <public@yoctocell.xyz> writes:

> Use (string-append "https://erratique.ch..." version ".tbz") to 
> make it
> easier to update the package in the future.

Done.

>> +       (sha256
>> +        (base32
>> + 
>> "1fxq57xy1ajzfdnvv5zfm7ap2nf49znw5f9gbi4kb9vds942ij27"))))
>> +    (build-system ocaml-build-system)
>> +    (arguments
>> +     `(#:tests? #f
>
> What’s the reason for disabling tests?
>

Laziness, I guess.. :)

Enabled in V2.

>> +    (description "Ptime has platform independent POSIX time 
>> support in pure
>> +OCaml. It provides a type to represent a well-defined range of 
>> POSIX
>          ^
> Double spacing.  :-)
>

Thanks!

>> +Ptime is not a calendar library.
>
> Not really sure if this sentence is necessary.  I think the 
> previous
> sentences has hade it pretty clear that it a time and date 
> library.
>

Agree, removed sentence.

>> +Ptime depends on the @code{ocaml-result} compatibility 
>> package. Ptime_clock
>> +depends on your system library. Ptime_clock's optional 
>> JavaScript support
>> +depends on @code{js-of-ocaml}.")
>
> This two sentences are probably also not necessary for users of 
> the
> package.  It should be the packager’s job to specify the 
> dependencies.  :-)

Also agree. Removed sentences.
diff mbox series

Patch

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index a34c844059..ab385eb26f 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -7487,6 +7487,48 @@  number generator interface, and implementations.")))
     (description "@code{ocaml-mirage-crypto-pk} provides public-key
 cryptography (RSA, DSA, DH) for OCaml.")))
 
+(define-public ocaml-ptime
+  (package
+    (name "ocaml-ptime")
+    (version "0.8.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri "https://erratique.ch/software/ptime/releases/ptime-0.8.5.tbz")
+       (sha256
+        (base32
+         "1fxq57xy1ajzfdnvv5zfm7ap2nf49znw5f9gbi4kb9vds942ij27"))))
+    (build-system ocaml-build-system)
+    (arguments
+     `(#:tests? #f
+       #:build-flags (list "build" "--with-js_of_ocaml" "false")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure))))
+    (propagated-inputs
+     `(("ocaml-result" ,ocaml-result)))
+    (native-inputs
+     `(("ocamlbuild" ,ocamlbuild)
+       ("ocaml-topkg" ,ocaml-topkg)
+       ("opam" ,opam)))
+    (home-page "https://erratique.ch/software/ptime")
+    (synopsis "POSIX time for OCaml")
+    (description "Ptime has platform independent POSIX time support in pure
+OCaml. It provides a type to represent a well-defined range of POSIX
+timestamps with picosecond precision, conversion with date-time values,
+conversion with RFC 3339 timestamps and pretty printing to a human-readable,
+locale-independent representation.
+
+The additional Ptime_clock library provides access to a system POSIX clock and
+to the system's current time zone offset.
+
+Ptime is not a calendar library.
+
+Ptime depends on the @code{ocaml-result} compatibility package. Ptime_clock
+depends on your system library. Ptime_clock's optional JavaScript support
+depends on @code{js-of-ocaml}.")
+    (license license:isc)))
+
 (define-public js-of-ocaml
   (package
     (name "js-of-ocaml")