[bug#77915,1/2] gnu: Add ocaml-camlpdf.

Message ID 9d5f92619286e54ae868d1f03d53737390a41c37.1745039829.git.jussi.timperi@iki.fi
State New
Headers
Series Add cpdf |

Commit Message

Jussi Timperi April 19, 2025, 5:43 a.m. UTC
* gnu/packages/ocaml.scm (ocaml-camlpdf): New variable.

Change-Id: I097280bdd16eaf810f83fbca13f615a03e4d6702
---
 gnu/packages/ocaml.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
  

Comments

André Batista May 16, 2025, 8:09 p.m. UTC | #1
Hi Jussi,

sáb 19 abr 2025 às 08:43:15 (1745062995), jussi.timperi@iki.fi enviou:
> (...)
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "1cbqgwh62cqnsbax4k4iv9gb63k1v545izmbffxj8gj1q6sm0k34"))))
> +    (build-system ocaml-build-system)
> +    (arguments
> +     (list
> +      #:tests? #f ;no tests
> +      #:make-flags
> +      #~(list (string-append "CC=" #$(cc-for-target)))

These should be indented relative to the #:make-flags key, so that we can
see that they are arguments to it by just a glance to the code.  Two spaces
should be enough.

> +      #:phases
> +      #~(modify-phases %standard-phases

Same as above.

> +          (delete 'configure)
> +          (add-after 'unpack 'patch-makefile-shell
> +            (lambda _
> +              (patch-makefile-SHELL "OCamlMakefile")))
> +          (add-after 'install 'install-doc
> +            (lambda _
> +              (let ((doc (string-append #$output "/share/doc/"
> +                                        #$name "-" #$version)))
> +                (copy-recursively "doc/camlpdf/html"
> +                                  (string-append doc "/html"))))))))
> +    (home-page "https://github.com/johnwhitington/camlpdf")
> +    (synopsis "OCaml library for PDF file manipulation")
> +    (description
> +     "CamlPDF is an OCaml library that provides functionality for reading,
> +writing, and modifying PDF files.  It serves as the foundation for the
> +@command{cpdf} command-line tool and various API bindings.")
> +    (license license:lgpl2.1+)))
> +
>  (define-public ocaml-cudf
>    (package
>      (name "ocaml-cudf")
> -- 
> 2.49.0

On cpdf there are similar indentation issues.  Other than that LGTM.  I've
successfuly build and made minimal testing.

Could you send a v2 patch fixing the indentation?

Cheers!
  
Jussi Timperi May 27, 2025, 11:49 a.m. UTC | #2
Hi André,

On 16 May 2025 17:09, André Batista <nandre@riseup.net> wrote:

> Could you send a v2 patch fixing the indentation?

Thanks for the review. I'll send the v2 with the fixed indentation.

Best,
--
Jussi
  
André Batista May 27, 2025, 3:20 p.m. UTC | #3
usertag 77915 reviewed-looks-good
quit

Hi Jussi,

ter 27 mai 2025 às 14:49:48 (1748368188), jussi.timperi@iki.fi enviou:
> Hi André,
> 
> On 16 May 2025 17:09, André Batista <nandre@riseup.net> wrote:
> 
> > Could you send a v2 patch fixing the indentation?
> 
> Thanks for the review. I'll send the v2 with the fixed indentation.
> 

After sending that review, I saw others indenting like you did and
indeed I've found out that that seems to be correct by guix standards.

Sorry for the noise, I've mixed my personal preference with what guix
actually do.  So you can disregard that.

I've tagged this patch as reviewed and you don't need to send a v2.

Thanks!
  

Patch

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index a5632c6ad1..b4813c5049 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -31,6 +31,7 @@ 
 ;;; Copyright © 2023, 2024 Foundation Devices, Inc. <hello@foundation.xyz>
 ;;; Copyright © 2023 Arnaud DABY-SEESARAM <ds-ac@nanein.fr>
 ;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
+;;; Copyright © 2025 Jussi Timperi <jussi.timperi@iki.fi>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -659,6 +660,45 @@  (define-public ocaml-extlib
     ;; With static-linking exception
     (license license:lgpl2.1+)))
 
+(define-public ocaml-camlpdf
+  (package
+    (name "ocaml-camlpdf")
+    (version "2.8.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/johnwhitington/camlpdf")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1cbqgwh62cqnsbax4k4iv9gb63k1v545izmbffxj8gj1q6sm0k34"))))
+    (build-system ocaml-build-system)
+    (arguments
+     (list
+      #:tests? #f ;no tests
+      #:make-flags
+      #~(list (string-append "CC=" #$(cc-for-target)))
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (add-after 'unpack 'patch-makefile-shell
+            (lambda _
+              (patch-makefile-SHELL "OCamlMakefile")))
+          (add-after 'install 'install-doc
+            (lambda _
+              (let ((doc (string-append #$output "/share/doc/"
+                                        #$name "-" #$version)))
+                (copy-recursively "doc/camlpdf/html"
+                                  (string-append doc "/html"))))))))
+    (home-page "https://github.com/johnwhitington/camlpdf")
+    (synopsis "OCaml library for PDF file manipulation")
+    (description
+     "CamlPDF is an OCaml library that provides functionality for reading,
+writing, and modifying PDF files.  It serves as the foundation for the
+@command{cpdf} command-line tool and various API bindings.")
+    (license license:lgpl2.1+)))
+
 (define-public ocaml-cudf
   (package
     (name "ocaml-cudf")