diff mbox series

[bug#56806,4/9] gnu: Add ocaml-xml-light.

Message ID 4uEkvxdO9wKNr_NlJqIucgyi7X8nk4MjGUnza5ANlBqa8CQ1-41OsubmA3x5gvtTY9mYfq-O7347Ny_PuU57vbrlfeZSbgc65ZOsegiDB9E=@protonmail.com
State Accepted
Headers show
Series Add the Haxe language and tools. | 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

John Kehayias July 28, 2022, 4:10 a.m. UTC
Empty Message
diff mbox series

Patch

From 2733ca5c0a423155a9db5f6dfbda678463f39647 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:32:04 -0400
Subject: [PATCH 4/9] gnu: Add ocaml-xml-light.

* gnu/packages/ocaml.scm (ocaml-xml-light): New variable.
---
 gnu/packages/ocaml.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 8620d2bde3..3df81e498b 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2812,6 +2812,45 @@  (define-public ocaml-bos
 run command line programs.")
     (license license:isc)))
 
+(define-public ocaml-xml-light
+  (package
+    (name "ocaml-xml-light")
+    (version "2.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ncannasse/xml-light")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "089ywjz84y4p5iln94y54vh03b5fm2zrl2dld1398dyrby96dp6s"))))
+    (build-system ocaml-build-system)
+    (arguments
+     (list #:tests? #f ; There are no tests.
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'prefix
+                 (lambda _
+                   (substitute* "Makefile"
+                     (("`\\$\\(OCAMLC\\) -where`")
+                      (string-append #$output "/lib/ocaml/site-lib/xml-light")))))
+               (delete 'configure) ; no configure
+               (add-before 'install 'mkdir
+                 (lambda _
+                   (mkdir-p (string-append #$output "/lib/ocaml/site-lib/xml-light"))))
+               (replace 'install
+                 (lambda _
+                   (invoke "make" "install_ocamlfind"))))))
+    (home-page "https://github.com/ncannasse/xml-light")
+    (synopsis "Xml-Light is a minimal XML parser & printer for OCaml")
+    (description
+     "Xml-Light provides functions to parse an XML document into an OCaml data
+structure, work with it, and print it back to an XML document.  It also
+supports DTD parsing and checking, and is entirely written in OCaml, hence it
+does not require additional C libraries.")
+    (license license:lgpl2.1+))) ; with linking exception
+
 (define-public ocaml-xmlm
   (package
     (name "ocaml-xmlm")
-- 
2.37.1