diff mbox series

[bug#64114,v2,2/2] gnu: Add fftw-documentation.

Message ID 20240114155516.12457-3-david.elsing@posteo.net
State New
Headers show
Series [bug#64114] gnu: fftw: Update to 3.3.10 and build entirely from source. | expand

Commit Message

David Elsing Jan. 14, 2024, 3:55 p.m. UTC
* gnu/packages/algebra.scm (fftw-documentation): New variable.
---
 gnu/packages/algebra.scm | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index dbed683bef..1b2694400d 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -807,6 +807,48 @@  (define-public fftw
 cosine/ sine transforms or DCT/DST).")
     (license license:gpl2+)))
 
+;; Separate package to prevent dependency cycle
+(define-public fftw-documentation
+  (package/inherit fftw
+    (name "fftw-documentation")
+    (arguments
+     (substitute-keyword-arguments (package-arguments fftw)
+       ((#:tests? _ #f) #f)
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            (replace 'build
+              (lambda _
+                ;; Reproducibility
+                (substitute* "doc/FAQ/m-html.pl"
+                  (("- \\$html_date\\\\n") "")
+                  (("\\$html_year \\$user_copyholder")
+                   "2021 $user_copyholder"))
+                (substitute* "doc/FAQ/fftw-faq.bfnn"
+                  ((".*`date.*") ""))
+                (invoke "make" "-C" "doc")
+                (invoke "make" "-C" "doc" "html")
+                (invoke "make" "-C" "doc/FAQ" "faq")))
+            (replace 'install
+              (let ((doc (string-append #$output "/share/doc/"
+                                        #$(package-name this-package) "-"
+                                        #$(package-version this-package))))
+                (lambda _
+                  (copy-recursively "doc/html" (string-append doc "/html"))
+                  (copy-recursively "doc/FAQ/fftw-faq.html"
+                                    (string-append doc "/fftw-faq.html"))
+                  (install-file "doc/FAQ/fftw-faq.ascii" doc))))))))
+    (native-inputs
+     (modify-inputs (package-native-inputs fftw)
+       (prepend ghostscript texinfo fig2dev)))
+    (home-page "https://fftw.org")
+    (synopsis "Computing the discrete Fourier transform")
+    (description
+     "FFTW is a C subroutine library for computing the discrete Fourier
+transform (DFT) in one or more dimensions, of arbitrary input size, and of
+both real and complex data (as well as of even/odd data---i.e. the discrete
+cosine/ sine transforms or DCT/DST).")
+    (license license:gpl2+)))
+
 (define-public fftwf
   (package/inherit fftw
     (name "fftwf")