[PATCH] gnu: add ocaml-bibtex2html

  • Done
  • quality assurance status badge
Details
2 participants
  • Ivan Gankevich
  • Julien Lepiller
Owner
unassigned
Submitted by
Ivan Gankevich
Severity
normal

Debbugs page

Ivan Gankevich wrote 4 years ago
(address . guix-patches@gnu.org)(name . Ivan Gankevich)(address . i.gankevich@spbu.ru)
20210706175748.30800-1-i.gankevich@spbu.ru
---
gnu/packages/ocaml.scm | 66 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)

Toggle diff (76 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index cec6eb4f89..b01088f46a 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -7175,3 +7175,69 @@ libraries.")
It makes it possible to run pure OCaml programs in JavaScript environment like
browsers and Node.js.")
(license license:lgpl2.1+)))
+
+(define-public ocaml-hevea
+ (package
+ (name "ocaml-hevea")
+ (version "2.35")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/maranget/hevea")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "1ziai2pl1k2qi4v3wc4xjvh8qdk2prfsg8k64bh8vi1ichnp7mqw"))))
+ (build-system ocaml-build-system)
+ (arguments
+ `(#:tests? #f ;; no tests
+ #:make-flags
+ (list
+ "TARGET=opt"
+ (string-append "LIBDIR=" (assoc-ref %outputs "out") "/lib")
+ (string-append "BINDIR=" (assoc-ref %outputs "out") "/bin")
+ (string-append "PREFIX=" %output))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-/bin/sh
+ (lambda _
+ (substitute* "_tags"
+ (("/bin/sh") (which "bash"))))))))
+ (native-inputs
+ `(("ocamlbuild" ,ocamlbuild)
+ ("which" ,which)))
+ (home-page "http://hevea.inria.fr/")
+ (synopsis "Quite complete and fast LATEX to HTML translator")
+ (description "HEVEA is fast and efficient translator that is able to
+convert large LATEX documents into HTML.")
+ (license (list license:qpl license:gpl2))))
+
+(define-public ocaml-bibtex2html
+ (package
+ (name "ocaml-bibtex2html")
+ (version "1.99-1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri "https://www.lri.fr/~filliatr/ftp/bibtex2html/bibtex2html-1.99.tar.gz")
+ (sha256 (base32 "07gzrs4lfrkvbn48cgn2gn6c7cx3jsanakkrb2irj0gmjzfxl96j"))))
+ (build-system ocaml-build-system)
+ (arguments
+ `(#:tests? #f ;; tests require bibtex binary from texlive-bin package
+ ;; that pulls a lot of dependencies
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-/bin/sh
+ (lambda _
+ (substitute* "configure" (("/bin/sh") (which "bash")))
+ #t)))))
+ (native-inputs
+ `(("which" ,which)))
+ (propagated-inputs
+ `(("ocaml-hevea" ,ocaml-hevea)))
+ (home-page "https://www.lri.fr/~filliatr/bibtex2html/")
+ (synopsis "BibTeX to HTML translator")
+ (description "Allows to produce, from a set of bibliography files
+in BibTeX format, a bibliography in HTML format.")
+ (license license:gpl2)))
--
2.32.0
Julien Lepiller wrote 4 years ago
(address . guix-patches@gnu.org)(name . Ivan Gankevich)(address . i.gankevich@spbu.ru)(address . 49445@debbugs.gnu.org)
AB80D144-37FE-47E0-9995-0042250AE7FA@lepiller.eu
Thanks for the patch!

Le 6 juillet 2021 13:57:49 GMT-04:00, Ivan Gankevich <i.gankevich@spbu.ru> a écrit :
Toggle quote (16 lines)
>---
> gnu/packages/ocaml.scm | 66 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 66 insertions(+)
>
>diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
>index cec6eb4f89..b01088f46a 100644
>--- a/gnu/packages/ocaml.scm
>+++ b/gnu/packages/ocaml.scm
>@@ -7175,3 +7175,69 @@ libraries.")
>It makes it possible to run pure OCaml programs in JavaScript
>environment like
> browsers and Node.js.")
> (license license:lgpl2.1+)))
>+
>+(define-public ocaml-hevea

Mh… we already have hevea as the "hevea" package (not "ocaml-hevea"), although at version 2.34. Would you like to send a patch that updates hevea instead?

Toggle quote (43 lines)
>+ (package
>+ (name "ocaml-hevea")
>+ (version "2.35")
>+ (source
>+ (origin
>+ (method git-fetch)
>+ (uri (git-reference
>+ (url "https://github.com/maranget/hevea")
>+ (commit (string-append "v" version))))
>+ (file-name (git-file-name name version))
>+ (sha256 (base32
>"1ziai2pl1k2qi4v3wc4xjvh8qdk2prfsg8k64bh8vi1ichnp7mqw"))))
>+ (build-system ocaml-build-system)
>+ (arguments
>+ `(#:tests? #f ;; no tests
>+ #:make-flags
>+ (list
>+ "TARGET=opt"
>+ (string-append "LIBDIR=" (assoc-ref %outputs "out") "/lib")
>+ (string-append "BINDIR=" (assoc-ref %outputs "out") "/bin")
>+ (string-append "PREFIX=" %output))
>+ #:phases
>+ (modify-phases %standard-phases
>+ (delete 'configure)
>+ (add-after 'unpack 'patch-/bin/sh
>+ (lambda _
>+ (substitute* "_tags"
>+ (("/bin/sh") (which "bash"))))))))
>+ (native-inputs
>+ `(("ocamlbuild" ,ocamlbuild)
>+ ("which" ,which)))
>+ (home-page "http://hevea.inria.fr/")
>+ (synopsis "Quite complete and fast LATEX to HTML translator")
>+ (description "HEVEA is fast and efficient translator that is able
>to
>+convert large LATEX documents into HTML.")
>+ (license (list license:qpl license:gpl2))))
>+
>+(define-public ocaml-bibtex2html
>+ (package
>+ (name "ocaml-bibtex2html")
>+ (version "1.99-1")

What does -1 mean? It won't me understood well by guix, so if there's a chace a -2 might exist, maybe we should make it .1 instead?

Toggle quote (6 lines)
>+ (source
>+ (origin
>+ (method url-fetch)
>+ (uri
>"https://www.lri.fr/~filliatr/ftp/bibtex2html/bibtex2html-1.99.tar.gz")

I don't see -1 in the file namc, so maybe it's useless?

Toggle quote (8 lines)
>+ (sha256 (base32
>"07gzrs4lfrkvbn48cgn2gn6c7cx3jsanakkrb2irj0gmjzfxl96j"))))
>+ (build-system ocaml-build-system)
>+ (arguments
>+ `(#:tests? #f ;; tests require bibtex binary from texlive-bin
>package
>+ ;; that pulls a lot of dependencies

fine, but that would only be a concern at build-time, right?

Toggle quote (11 lines)
>+ #:phases
>+ (modify-phases %standard-phases
>+ (add-after 'unpack 'patch-/bin/sh
>+ (lambda _
>+ (substitute* "configure" (("/bin/sh") (which "bash")))
>+ #t)))))
>+ (native-inputs
>+ `(("which" ,which)))
>+ (propagated-inputs
>+ `(("ocaml-hevea" ,ocaml-hevea)))

Make this hevea instead :)

Toggle quote (6 lines)
>+ (synopsis "BibTeX to HTML translator")
>+ (description "Allows to produce, from a set of bibliography files
>+in BibTeX format, a bibliography in HTML format.")
>+ (license license:gpl2)))

Otherwise looks good! Can you send a v2 with a patch to update hevea and a separate patch to add bibtex2html?
Ivan Gankevich wrote 4 years ago
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 49445@debbugs.gnu.org)(address . guix-patches@gnu.org)
YOVT9vVszQJ4NeLS@surge
Toggle quote (2 lines)
>Mh… we already have hevea as the "hevea" package (not "ocaml-hevea"), although at version 2.34. Would you like to send a patch that updates hevea instead?

Oops! I thought all ocaml packages start with “ocaml-”.


Toggle quote (2 lines)
>What does -1 mean? It won't me understood well by guix, so if there's a chace a -2 might exist, maybe we should make it .1 instead?

I’ve imported this package with “guix import opam”. This “-1” came from there.


Toggle quote (2 lines)
>I don't see -1 in the file namc, so maybe it's useless?

You’re right. There is no such version in git repo and source tarball. Removed it.


Toggle quote (5 lines)
>>+ `(#:tests? #f ;; tests require bibtex binary from texlive-bin
>>package
>>+ ;; that pulls a lot of dependencies
>fine, but that would only be a concern at build-time, right?

Added “texlive” as native dependency. Adding “texlive-bin” is not enough, since the tests
also need “pdflatex”.


Toggle quote (2 lines)
>Make this hevea instead :)

Done.


Toggle quote (2 lines)
>Otherwise looks good! Can you send a v2 with a patch to update hevea and a separate patch to add bibtex2html?

I’ve sent the two separate patches for “hevea” and “bibtex2html”. Thank you for your
corrections!
Ivan Gankevich wrote 4 years ago
[bug#49445] [PATCH] gnu: add ocaml-bibtex2html
(address . guix-patches@gnu.org)(name . Ivan Gankevich)(address . i.gankevich@spbu.ru)
20210707071339.23265-1-i.gankevich@spbu.ru
---
gnu/packages/ocaml.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 652ad3c5f4..2e48d16b4b 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -7175,3 +7175,33 @@ libraries.")
It makes it possible to run pure OCaml programs in JavaScript environment like
browsers and Node.js.")
(license license:lgpl2.1+)))
+
+(define-public ocaml-bibtex2html
+ (package
+ (name "ocaml-bibtex2html")
+ (version "1.99")
+ (source
+ (origin
+ (method url-fetch)
+ (uri "https://www.lri.fr/~filliatr/ftp/bibtex2html/bibtex2html-1.99.tar.gz")
+ (sha256 (base32 "07gzrs4lfrkvbn48cgn2gn6c7cx3jsanakkrb2irj0gmjzfxl96j"))))
+ (build-system ocaml-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-/bin/sh
+ (lambda _
+ (substitute* "configure" (("/bin/sh") (which "bash")))
+ (setenv "HOME" (getcwd)) ;; mktexfmt needs writable home directory
+ #t)))))
+ (native-inputs
+ `(("which" ,which)
+ ("texlive" ,texlive) ;; bibtex and pdflatex executables are needed for tests
+ ))
+ (propagated-inputs
+ `(("hevea" ,hevea)))
+ (home-page "https://www.lri.fr/~filliatr/bibtex2html/")
+ (synopsis "BibTeX to HTML translator")
+ (description "Allows to produce, from a set of bibliography files
+in BibTeX format, a bibliography in HTML format.")
+ (license license:gpl2)))
--
2.32.0
Julien Lepiller wrote 4 years ago
(name . Ivan Gankevich)(address . i.gankevich@spbu.ru)(address . 49445-done@debbugs.gnu.org)
20210710150829.7a1e1ae3@tachikoma.lepiller.eu
Pushed as c21ccbf14e211bf3417c04f5add733a1e49b44fa, thank you!

I fixed the commit message:

gnu: Add ocaml-bibtex2html.

* gnu/packages/ocaml.scm (ocaml-bibtex2html): New variable.

I also managed to find a more minimal set of packages required to run
the tests. Instead of the monolithic texlive, we usually use
texlive-bin or texlive-tiny, but it was still missing some modules.
I had to add texlive-preprint to Guix first, and used a texlive-union,
which creates a texlive package that adds some packages on top of
texlive-tiny.

Thanks again for the patch!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 49445@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 49445
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help