GNU bug report logs - #58173
[PATCH 2/3] gnu: Add ocaml-macaddr.

Previous Next

Package: guix-patches;

Reported by: raingloom <raingloom <at> riseup.net>

Date: Thu, 29 Sep 2022 16:48:02 UTC

Severity: normal

Tags: moreinfo, patch

Merged with 58172, 58174

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: raingloom <raingloom <at> riseup.net>
To: guix-patches <at> gnu.org
Cc: raingloom <raingloom <at> riseup.net>
Subject: [PATCH 2/3] gnu: Add ocaml-macaddr.
Date: Thu, 29 Sep 2022 18:47:17 +0200
* gnu/packages/ocaml-mirage.scm
  (ipaddr-arguments) (ocaml-macaddr): New variables.
---
 gnu/packages/ocaml-mirage.scm | 38 +++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

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





This bug report was last modified 2 years and 206 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.