unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67549] [PATCH 0/2] gnu: Add latexml.
@ 2023-11-30 17:17 Nicolas Graves via Guix-patches via
  2023-12-02 11:08 ` [bug#67549] [PATCH 1/2] gnu: Add perl-image-size Nicolas Graves via Guix-patches via
  2024-04-11 22:10 ` [bug#67549] [PATCH v2 0/2] " Steve George
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-11-30 17:17 UTC (permalink / raw)
  To: 67549; +Cc: ngraves

This patch series adds the latexml package and its perl-image-size dependency. 

Nicolas Graves (2):
  gnu: Add perl-image-size.
  gnu: Add latexml.

 gnu/packages/markup.scm | 87 ++++++++++++++++++++++++++++++++++++++++-
 gnu/packages/perl.scm   | 20 ++++++++++
 2 files changed, 106 insertions(+), 1 deletion(-)

-- 
2.41.0





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#67549] [PATCH 1/2] gnu: Add perl-image-size.
  2023-11-30 17:17 [bug#67549] [PATCH 0/2] gnu: Add latexml Nicolas Graves via Guix-patches via
@ 2023-12-02 11:08 ` Nicolas Graves via Guix-patches via
  2023-12-02 11:08   ` [bug#67549] [PATCH 2/2] gnu: Add latexml Nicolas Graves via Guix-patches via
  2024-04-11 22:10 ` [bug#67549] [PATCH v2 0/2] " Steve George
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-12-02 11:08 UTC (permalink / raw)
  To: 67549; +Cc: ngraves

* gnu/packages/perl.scm (perl-image-size): New variable.

Change-Id: Ib2b11b74451b156c4380b91334ae37032e6bb6fd
---
 gnu/packages/perl.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 8b82c272fc..47df9d1cf5 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -37,6 +37,7 @@
 ;;; Copyright © 2023 Mădălin Ionel Patrașcu <madalinionel.patrascu@mdc-berlin.de>
 ;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5555,6 +5556,25 @@ (define-public perl-hook-lexwrap
 caller function works correctly within the wrapped subroutine.")
     (license license:perl-license)))
 
+(define-public perl-image-size
+  (package
+    (name "perl-image-size")
+    (version "3.300")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/R/RJ/RJRAY/Image-Size-"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "0sq2kwdph55h4adx50fmy86brjkkv8grsw33xrhf1k9icpwb3jak"))))
+    (build-system perl-build-system)
+    (native-inputs (list perl-module-build))
+    (home-page "https://metacpan.org/release/Image-Size")
+    (synopsis "Extract height/width from images")
+    (description "This package provides a simple Perl library to extract
+height/width from images.")
+    (license license:perl-license)))
+
 (define-public perl-importer
   (package
     (name "perl-importer")
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67549] [PATCH 2/2] gnu: Add latexml.
  2023-12-02 11:08 ` [bug#67549] [PATCH 1/2] gnu: Add perl-image-size Nicolas Graves via Guix-patches via
@ 2023-12-02 11:08   ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-12-02 11:08 UTC (permalink / raw)
  To: 67549; +Cc: ngraves

* gnu/packages/markup.scm (latexml): New variable.

Change-Id: If7199a8b74b990ad29718adcb905a5ed31882cf5
---
 gnu/packages/markup.scm | 87 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 86 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm
index 4a9a382104..67c39686d0 100644
--- a/gnu/packages/markup.scm
+++ b/gnu/packages/markup.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,13 +46,18 @@ (define-module (gnu packages markup)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages perl-compression)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
-  #:use-module (gnu packages web))
+  #:use-module (gnu packages tex)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml))
 
 (define-public hoedown
   (package
@@ -125,6 +131,85 @@ (define-public markdown
     (license (license:non-copyleft "file://License.text"
                                    "See License.text in the distribution."))))
 
+(define-public latexml
+  (package
+    (name "latexml")
+    (version "0.8.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        "https://math.nist.gov/~BMiller/LaTeXML/releases/LaTeXML-0.8.7.tar.gz")
+       (sha256
+        (base32 "0yfclh3bkksd4xvrhwf06xsbisp84x12vk6lml6yr7bp82a9vni5"))))
+    (build-system perl-build-system)
+    (arguments
+     (let ((input-names (map (compose package-name cadr)
+                             (package-propagated-inputs this-package))))
+       (list
+        #:tests? #f  ; Some file tests are missing.
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'install 'find-itself
+              ;; Fix run-time 'Can't locate [].pm in @INC' failure.
+              (lambda _
+                (with-directory-excursion (string-append #$output "/bin")
+                  (for-each
+                   (lambda (program)
+                     (wrap-program program
+                       `("PERL5LIB" ":" prefix
+                         (,(string-append #$output "/lib/perl5/site_perl")
+                          ,#$@(map (lambda (in)
+                                     (file-append
+                                      (this-package-input in) "/lib/perl5/site_perl"))
+                                   input-names)))))
+                   (find-files "." ".*")))))))))
+    (inputs
+     (list perl libxml2 libxslt))
+    (propagated-inputs
+     (list perl-archive-zip
+           perl-common-sense
+           perl-db-file
+           perl-file-which
+           perl-encode-locale
+           perl-getopt-long
+           perl-http-date
+           perl-http-message
+           perl-image-magick
+           perl-image-size
+           perl-io-string
+           perl-json-xs
+           perl-libwww
+           perl-mime-base64
+           perl-parse-recdescent
+           perl-pod-parser
+           perl-text-unidecode
+           perl-time-hires
+           perl-try-tiny
+           perl-types-serialiser
+           perl-uri
+           perl-xml-libxml
+           perl-xml-libxslt
+           perl-xml-sax-base))
+    (native-inputs
+     (list texlive-bin
+           perl-test-more-utf8
+           perl-extutils-manifest
+           perl-data-dumper
+           perl-ipc-run3
+           perl-file-temp))
+    (home-page "https://math.nist.gov/~BMiller/LaTeXML")
+    (synopsis "A LaTeX to XML/HTML/MathML converter")
+    (description "This package provides a LaTeX converter, with the following goals:
+@itemize
+@item Faithful emulation of TEX’s behaviour;
+@item Easily extensible;
+@item Lossless, preserving both semantic and presentation cues;
+@item Use an abstract LATEX-like, extensible, document type;
+@item Infer the semantics of mathematical content
+@end itemize")
+    (license license:cc0)))
+
 (define-public lowdown
   (package
     (name "lowdown")
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67549] [PATCH v2 0/2] Re: Add latexml
  2023-11-30 17:17 [bug#67549] [PATCH 0/2] gnu: Add latexml Nicolas Graves via Guix-patches via
  2023-12-02 11:08 ` [bug#67549] [PATCH 1/2] gnu: Add perl-image-size Nicolas Graves via Guix-patches via
@ 2024-04-11 22:10 ` Steve George
  2024-04-11 22:10   ` [bug#67549] [PATCH v2 1/2] gnu: Add perl-image-size Steve George
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Steve George @ 2024-04-11 22:10 UTC (permalink / raw)
  To: 67549; +Cc: Steve George

Hi Nicolas,

You sent this back in November. As I reviewed I noticed that there were a lot of propagated-inputs, so I extended your wrap phase and moved everything into inputs. Some of the magic of gexps is at the edge of my current understanding, so perhaps there's a better way to do this? 

Review:
  * Move PERL5LIB propagated-inputs to wrap-program
  * Update to new minor version
  * Change to Git / enable tests
  * functionality: tested with example
  * checked with guix lint
  * reroll to trigger QA build

Nicolas Graves via Guix-patches via (2):
  gnu: Add perl-image-size.
  gnu: Add latexml.

 gnu/packages/markup.scm | 117 +++++++++++++++++++++++++++++++++++++++-
 gnu/packages/perl.scm   |  20 +++++++
 2 files changed, 136 insertions(+), 1 deletion(-)


base-commit: c1c9d6b3cdf5955f1bf5fded2a0c496ce2e631f1
-- 
2.41.0





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#67549] [PATCH v2 1/2] gnu: Add perl-image-size.
  2024-04-11 22:10 ` [bug#67549] [PATCH v2 0/2] " Steve George
@ 2024-04-11 22:10   ` Steve George
  2024-04-11 22:10   ` [bug#67549] [PATCH v2 2/2] gnu: Add latexml Steve George
  2024-04-16 22:03   ` bug#67549: [PATCH v2 0/2] " Christopher Baines
  2 siblings, 0 replies; 7+ messages in thread
From: Steve George @ 2024-04-11 22:10 UTC (permalink / raw)
  To: 67549

From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>

* gnu/packages/perl.scm (perl-image-size): New variable.

Change-Id: Ib2b11b74451b156c4380b91334ae37032e6bb6fd
---
 gnu/packages/perl.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 80b17098c7..57a06f836b 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -37,6 +37,7 @@
 ;;; Copyright © 2023 Mădălin Ionel Patrașcu <madalinionel.patrascu@mdc-berlin.de>
 ;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5554,6 +5555,25 @@ (define-public perl-hook-lexwrap
 caller function works correctly within the wrapped subroutine.")
     (license license:perl-license)))
 
+(define-public perl-image-size
+  (package
+    (name "perl-image-size")
+    (version "3.300")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/R/RJ/RJRAY/Image-Size-"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "0sq2kwdph55h4adx50fmy86brjkkv8grsw33xrhf1k9icpwb3jak"))))
+    (build-system perl-build-system)
+    (native-inputs (list perl-module-build))
+    (home-page "https://metacpan.org/release/Image-Size")
+    (synopsis "Extract height/width from images")
+    (description "This package provides a simple Perl library to extract
+height/width from images.")
+    (license license:perl-license)))
+
 (define-public perl-importer
   (package
     (name "perl-importer")
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#67549] [PATCH v2 2/2] gnu: Add latexml.
  2024-04-11 22:10 ` [bug#67549] [PATCH v2 0/2] " Steve George
  2024-04-11 22:10   ` [bug#67549] [PATCH v2 1/2] gnu: Add perl-image-size Steve George
@ 2024-04-11 22:10   ` Steve George
  2024-04-16 22:03   ` bug#67549: [PATCH v2 0/2] " Christopher Baines
  2 siblings, 0 replies; 7+ messages in thread
From: Steve George @ 2024-04-11 22:10 UTC (permalink / raw)
  To: 67549; +Cc: steve

From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>

* gnu/packages/markup.scm (latexml): New variable.

Reviewed-by: Steve George <steve@futurile.net>

Change-Id: If7199a8b74b990ad29718adcb905a5ed31882cf5
---
 gnu/packages/markup.scm | 117 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 116 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm
index 6d891ee313..2cc3d0415d 100644
--- a/gnu/packages/markup.scm
+++ b/gnu/packages/markup.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2022, 2024 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,15 +45,21 @@ (define-module (gnu packages markup)
   #:use-module (guix gexp)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages perl-compression)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
-  #:use-module (gnu packages web))
+  #:use-module (gnu packages tex)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml))
 
 (define-public hoedown
   (package
@@ -126,6 +133,114 @@ (define-public markdown
     (license (license:non-copyleft "file://License.text"
                                    "See License.text in the distribution."))))
 
+(define-public latexml
+  (package
+    (name "latexml")
+    (version "0.8.8")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/brucemiller/LaTeXML")
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+         (base32
+           "0lppm66fxadsbn73xh0nfqdi4y6d9j6xph1slvlp6ynrfbnn5p6s"))))
+    (build-system perl-build-system)
+    (arguments
+     (let ((wraplibs
+             (list "perl-archive-zip"
+                   "perl-common-sense"
+                   "perl-db-file"
+                   "perl-encode-locale"
+                   "perl-file-which"
+                   "perl-getopt-long"
+                   "perl-http-date"
+                   "perl-http-message"
+                   "perl-image-magick"
+                   "perl-image-size"
+                   "perl-io-string"
+                   "perl-json-xs"
+                   "perl-libwww"
+                   "perl-mime-base64"
+                   "perl-parse-recdescent"
+                   "perl-pod-parser"
+                   "perl-text-unidecode"
+                   "perl-time-hires"
+                   "perl-try-tiny"
+                   "perl-types-serialiser"
+                   "perl-uri"
+                   "perl-xml-libxml"
+                   "perl-xml-libxslt"
+                   "perl-xml-sax-base")))
+       (list
+        ;; some tests skip due to missing dependencies
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'install 'find-itself
+              ;; Fix run-time 'Can't locate [].pm in @INC' failure and remove
+              ;; need for extensive set of propagated inputs
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                  (with-directory-excursion (string-append #$output "/bin")
+                    (for-each
+                     (lambda* (program)
+                       (wrap-program program
+                         `("PERL5LIB" ":" prefix
+                           (,(string-append #$output "/lib/perl5/site_perl")
+                            ,#$@(map (lambda (in)
+                                       (file-append
+                                        (this-package-input in) "/lib/perl5/site_perl"))
+                                     wraplibs)))))
+                     (find-files "." ".*")))))))))
+    (inputs
+     (list bash-minimal
+           libxml2
+           libxslt
+           perl
+           perl-archive-zip
+           perl-common-sense
+           perl-db-file
+           perl-encode-locale
+           perl-file-which
+           perl-getopt-long
+           perl-http-date
+           perl-http-message
+           perl-image-magick
+           perl-image-size
+           perl-io-string
+           perl-json-xs
+           perl-libwww
+           perl-mime-base64
+           perl-parse-recdescent
+           perl-pod-parser
+           perl-text-unidecode
+           perl-time-hires
+           perl-try-tiny
+           perl-types-serialiser
+           perl-uri
+           perl-xml-libxml
+           perl-xml-libxslt
+           perl-xml-sax-base))
+    (native-inputs
+     (list texlive-bin
+           perl-test-more-utf8
+           perl-extutils-manifest
+           perl-data-dumper
+           perl-ipc-run3
+           perl-file-temp))
+    (home-page "https://math.nist.gov/~BMiller/LaTeXML/")
+    (synopsis "LaTeX to XML, HTML, MathML, epub and Jats converter")
+    (description "This package provides a LaTeX converter, with the following goals:
+@itemize
+@item Faithful emulation of TEX’s behaviour;
+@item Easily extensible;
+@item Lossless, preserving both semantic and presentation cues;
+@item Use an abstract LATEX-like, extensible, document type;
+@item Infer the semantics of mathematical content
+@end itemize")
+    (license license:cc0)))
+
 (define-public lowdown
   (package
     (name "lowdown")
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#67549: [PATCH v2 0/2] Re: Add latexml
  2024-04-11 22:10 ` [bug#67549] [PATCH v2 0/2] " Steve George
  2024-04-11 22:10   ` [bug#67549] [PATCH v2 1/2] gnu: Add perl-image-size Steve George
  2024-04-11 22:10   ` [bug#67549] [PATCH v2 2/2] gnu: Add latexml Steve George
@ 2024-04-16 22:03   ` Christopher Baines
  2 siblings, 0 replies; 7+ messages in thread
From: Christopher Baines @ 2024-04-16 22:03 UTC (permalink / raw)
  To: Steve George, ngraves; +Cc: 67549-done

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Steve George <steve@futurile.net> writes:

> Hi Nicolas,
>
> You sent this back in November. As I reviewed I noticed that there
> were a lot of propagated-inputs, so I extended your wrap phase and
> moved everything into inputs. Some of the magic of gexps is at the
> edge of my current understanding, so perhaps there's a better way to
> do this?
>
> Review:
>   * Move PERL5LIB propagated-inputs to wrap-program
>   * Update to new minor version
>   * Change to Git / enable tests
>   * functionality: tested with example
>   * checked with guix lint
>   * reroll to trigger QA build
>
> Nicolas Graves via Guix-patches via (2):
>   gnu: Add perl-image-size.
>   gnu: Add latexml.
>
>  gnu/packages/markup.scm | 117 +++++++++++++++++++++++++++++++++++++++-
>  gnu/packages/perl.scm   |  20 +++++++
>  2 files changed, 136 insertions(+), 1 deletion(-)

Thanks both, this looks good to me so I've gone ahead and pushed these
patches to master as 6a6dde505888bb1aff84bb02480f94312ac2989f.

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-16 22:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30 17:17 [bug#67549] [PATCH 0/2] gnu: Add latexml Nicolas Graves via Guix-patches via
2023-12-02 11:08 ` [bug#67549] [PATCH 1/2] gnu: Add perl-image-size Nicolas Graves via Guix-patches via
2023-12-02 11:08   ` [bug#67549] [PATCH 2/2] gnu: Add latexml Nicolas Graves via Guix-patches via
2024-04-11 22:10 ` [bug#67549] [PATCH v2 0/2] " Steve George
2024-04-11 22:10   ` [bug#67549] [PATCH v2 1/2] gnu: Add perl-image-size Steve George
2024-04-11 22:10   ` [bug#67549] [PATCH v2 2/2] gnu: Add latexml Steve George
2024-04-16 22:03   ` bug#67549: [PATCH v2 0/2] " Christopher Baines

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).