diff mbox series

[bug#49443] gnu: Add blitz.

Message ID 20210714115713.24675-1-i.gankevich@spbu.ru
State Accepted
Headers show
Series [bug#49443] gnu: Add blitz. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Ivan Gankevich July 14, 2021, 11:57 a.m. UTC
* gnu/packages/maths.scm (blitz): New variable.
---
 gnu/packages/maths.scm | 54 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Comments

Arun Isaac July 15, 2021, 1:39 p.m. UTC | #1
Hi Ivan,

Thanks for the quick response! Save a few minor changes, this patch LGTM. I am
sending a v3 patch with the necessary changes in a following email. Let me
know if it works, and I'll push it to master. Below, I note some of the
changes I've made.

1. I added a copyright header for you.

> +          (add-after 'build 'build-doc
> +            (lambda _
> +              (define jobs (format #f "-j~a" (parallel-job-count)))
> +              (invoke "make" jobs "blitz-doc")
> +              #t))

2. We do not need format for this. See how I've done it. It's simpler and does
not use a heavy-weight function like format.

> +          (add-after 'check 'check-examples
> +            (lambda _
> +              (define jobs (format #f "-j~a" (parallel-job-count)))
> +              (invoke "make" jobs "check-examples")
> +              #t)))))

3. Just check-testsuite should be good enough. So, this phase is not required.

> +    (native-inputs
> +      `(("python" ,python)
> +        ("texinfo" ,texinfo)
> +        ("texlive-tex-texinfo" ,texlive-tex-texinfo)
> +        ("texlive" ,(texlive-union (list texlive-epsf))) ;; for texi2dvi
> +        ("texi2html" ,texi2html)

4. Actually, I only wanted you to build the info manual, not the pdf and html
manuals. Sorry, I should have been clearer. So, I removed the texlive,
texlive-tex-texinfo, texi2html, doxygen, graphviz dependencies and other
related things from the package.

> +    (synopsis "C++ template class library for multidimensional arrays")
> +    (description
> +      "High-performance multidimensional array containers for scientific computing.")

5. Description should be a complete sentence.

Regards,
Arun

Ivan Gankevich (1):
  gnu: Add blitz.

 gnu/packages/maths.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
Ivan Gankevich July 15, 2021, 5:20 p.m. UTC | #2
>Thanks for the quick response! Save a few minor changes, this patch LGTM. I am
>sending a v3 patch with the necessary changes in a following email. Let me
>know if it works, and I'll push it to master. Below, I note some of the
>changes I've made.

Thank you, Arun!. The patch works fine on my machine.


>4. Actually, I only wanted you to build the info manual, not the pdf and html
>manuals. Sorry, I should have been clearer. So, I removed the texlive,
>texlive-tex-texinfo, texi2html, doxygen, graphviz dependencies and other
>related things from the package.

You’re right, texinfo documentation is enough for this simple library.
Arun Isaac July 16, 2021, 4:40 a.m. UTC | #3
Hi Ivan,

> Thank you, Arun!. The patch works fine on my machine.

Pushed to master!

>>4. Actually, I only wanted you to build the info manual, not the pdf and html
>>manuals. Sorry, I should have been clearer. So, I removed the texlive,
>>texlive-tex-texinfo, texi2html, doxygen, graphviz dependencies and other
>>related things from the package.
>
> You’re right, texinfo documentation is enough for this simple library.

I don't think there is any Guix package that includes the PDF and HTML
documentation. It would make the packages much too heavy what with all
the texlive dependencies you'll have to add. And, I guess the consensus
is that the added size is not worth it.

Regards,
Arun
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index b4cf0b5409..eb92fb083a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -6440,3 +6440,57 @@  to source-code analysis of C software.  The Frama-C analyzers assist you in
 various source-code-related activities, from the navigation through unfamiliar
 projects up to the certification of critical software.")
     (license license:lgpl2.1+)))
+
+(define-public blitz
+  (package
+    (name "blitz")
+    (version "1.0.2")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/blitzpp/blitz")
+               (commit version)))
+        (file-name (git-file-name name version))
+        (sha256 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
+    (build-system cmake-build-system)
+    (arguments
+      `(#:configure-flags
+        '("-DBUILD_DOC=ON"
+          "-DDISABLE_REFMAN_PDF=ON" ;; refman.pdf requires array-2016-10-06.sty
+          "-DBUILD_TESTING=ON")
+        ;; default "check" target also includes examples and benchmarks
+        #:test-target "check-testsuite"
+        #:phases
+        (modify-phases %standard-phases
+          (add-after 'unpack 'patch-locations
+            (lambda _
+              ;; replace "texinfo.tex" location
+              (substitute* "doc/CMakeLists.txt"
+                (("/usr/share/texmf/tex/texinfo/")
+                 (format #f "~a/share/texmf-dist/tex/texinfo/"
+                         (assoc-ref %build-inputs "texlive-tex-texinfo"))))
+              #t))
+          (add-after 'build 'build-doc
+            (lambda _
+              (define jobs (format #f "-j~a" (parallel-job-count)))
+              (invoke "make" jobs "blitz-doc")
+              #t))
+          (add-after 'check 'check-examples
+            (lambda _
+              (define jobs (format #f "-j~a" (parallel-job-count)))
+              (invoke "make" jobs "check-examples")
+              #t)))))
+    (native-inputs
+      `(("python" ,python)
+        ("texinfo" ,texinfo)
+        ("texlive-tex-texinfo" ,texlive-tex-texinfo)
+        ("texlive" ,(texlive-union (list texlive-epsf))) ;; for texi2dvi
+        ("texi2html" ,texi2html)
+        ("doxygen" ,doxygen)
+        ("graphviz" ,graphviz)))
+    (synopsis "C++ template class library for multidimensional arrays")
+    (description
+      "High-performance multidimensional array containers for scientific computing.")
+    (home-page "https://github.com/blitzpp/blitz")
+    (license (list license:artistic2.0 license:bsd-3 license:lgpl3+))))