summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-02 14:52:30 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-02 14:54:24 +0100
commit1a49a10a94e90dc8bb4ce80d2dc2fa21acf76424 (patch)
treeec013ff92555a8a354f1126e526a6b1bf87fd10e /gnu
parent7355634db3ccf0d86f8e34c4aea37392c1a0ab0a (diff)
downloadguix-1a49a10a94e90dc8bb4ce80d2dc2fa21acf76424.tar.gz
gnu: fftw: Factorize creation of the --enable-threads variant.
* gnu/packages/algebra.scm (pthread-variant): New procedure.
(fftw-with-threads, fftwf-with-threads): Use it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/algebra.scm21
1 files changed, 10 insertions, 11 deletions
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 892b6cf525..d09e2e83b2 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -577,23 +577,22 @@ cosine/ sine transforms or DCT/DST).")
      (string-append (package-description fftw)
                     "  Single-precision version."))))
 
-;; FIXME: These packages are used temporarily by packages like Ardour until
-;; "--enable-flags" is added to the fftw and fftwf packages.
-(define-public fftw-with-threads
-  (package (inherit fftw)
-    (name "fftw-pthreads")
+(define (pthread-variant p)
+  (package
+    (inherit p)
+    (name (string-append (package-name p) "-pthreads"))
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags flags)
         `(cons "--enable-threads" ,flags))))))
 
+;; FIXME: These packages are used temporarily by packages like Ardour until
+;; "--enable-flags" is added to the fftw and fftwf packages.
+(define-public fftw-with-threads
+  (pthread-variant fftw))
+
 (define-public fftwf-with-threads
-  (package (inherit fftwf)
-    (name "fftwf-pthreads")
-    (arguments
-     (substitute-keyword-arguments (package-arguments fftwf)
-       ((#:configure-flags flags)
-        `(cons "--enable-threads" ,flags))))))
+  (pthread-variant fftwf))
 
 (define-public fftw-openmpi
   (package (inherit fftw)