[PATCH 2/3] gnu: Add ocaml-macaddr.

  • Open
  • quality assurance status badge
Details
2 participants
  • Christopher Baines
  • raingloom
Owner
unassigned
Submitted by
raingloom
Severity
normal
Merged with
R
R
raingloom wrote on 29 Sep 2022 18:47
(address . guix-patches@gnu.org)(name . raingloom)(address . raingloom@riseup.net)
20220929164718.16973-2-raingloom@riseup.net
* gnu/packages/ocaml-mirage.scm
(ipaddr-arguments) (ocaml-macaddr): New variables.
---
gnu/packages/ocaml-mirage.scm | 38 +++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/ocaml-mirage.scm b/gnu/packages/ocaml-mirage.scm
index 67514c4932..b1389507d5 100644
--- a/gnu/packages/ocaml-mirage.scm
+++ b/gnu/packages/ocaml-mirage.scm
@@ -54,3 +54,41 @@ (define-public ocaml-domain-name
"Parses and constructs RFC compliant domain names. The invariants on the
length of domain names are preserved throughout the module.")
(license license:isc)))
+
+(define (ipaddr-arguments pkg)
+ `(#:package ,pkg
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ ;; no separate tests directory
+ (invoke "dune" "runtest" "-p" ,pkg)))))))
+
+(define-public ocaml-macaddr
+ (package
+ (name "ocaml-macaddr")
+ (version "5.3.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mirage/ocaml-ipaddr/")
+ (commit (string-append "v" version))))
+ (file-name name)
+ (sha256
+ (base32
+ "1zgwx0ms3l4k4dzwnkrwq4zzqjrddjsvqn66mbd0rm6aq1ib019d"))))
+ (build-system dune-build-system)
+ (arguments (ipaddr-arguments "macaddr"))
+ (propagated-inputs (list ocaml-cstruct))
+ (native-inputs (list ocaml-ounit2 ocaml-ppx-sexp-conv))
+ (home-page "https://github.com/mirage/ocaml-ipaddr")
+ (synopsis "OCaml library for manipulation of MAC address representations")
+ (description
+ "@itemize
+@item MAC-48 (Ethernet) address support
+@item `Macaddr` is a @code{Map.OrderedType}
+@item All types have sexplib serializers/deserializers optionally via the
+`Macaddr_sexp` library
+@end itemize")
+ (license license:isc)))
--
2.37.3
C
C
Christopher Baines wrote on 21 Nov 2022 14:50
(no subject)
(name . GNU Debbugs)(address . control@debbugs.gnu.org)
87a64kv2kn.fsf@cbaines.net
merge 58172 58173 58174
thanks
C
C
Christopher Baines wrote on 21 Nov 2022 15:52
tag 58173 moreinfo
(address . control@debbugs.gnu.org)
877czo742f.fsf@cbaines.net
tags 58173 + moreinfo
quit
?