summary refs log tree commit diff
path: root/gnu/packages/guile-xyz.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/guile-xyz.scm')
-rw-r--r--gnu/packages/guile-xyz.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 3a55585251..d5c7325ba4 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -41,6 +41,7 @@
 (define-module (gnu packages guile-xyz)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages aspell)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
@@ -2608,3 +2609,47 @@ bindings to Vigra C (a C wrapper to most of the Vigra functionality) and is
 enriched with pure Guile Scheme algorithms, all accessible through a nice,
 clean and easy to use high level API.")
     (license license:gpl3+)))
+
+(define-public guile-ffi-fftw
+  (let ((commit "95d7ffb55860f3163c5283ecec1ef43bc3d174dd")
+        (revision "1"))
+    (package
+      (name "guile-ffi-fftw")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/lloda/guile-ffi-fftw.git")
+                      (commit commit)))
+                (file-name (git-file-name "guile-ffi-fftw" version))
+                (sha256
+                 (base32
+                  "0v9vk9cr4x9gn36lihi9gfkxyiqak0i598v5li6qw8bg95004p49"))))
+      (build-system guile-build-system)
+      (arguments
+       `(#:source-directory "mod"
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'prepare-build
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "mod/ffi/fftw.scm"
+                 (("\\(getenv \"GUILE_FFI_FFTW_LIBFFTW3_PATH\"\\)")
+                  (format #f "\"~a/lib\"" (assoc-ref inputs "fftw"))))
+               #t))
+           (add-after 'build 'check
+             (lambda _
+               (invoke "guile" "-L" "mod"
+                       "-s" "test/test-ffi-fftw.scm"))))))
+      (inputs
+       `(("fftw" ,fftw)
+         ("guile" ,guile-2.2)))
+      (home-page "https://github.com/lloda/guile-ffi-fftw/")
+      (synopsis "Access FFTW through Guile's FFI")
+      (description "This is a minimal set of Guile FFI bindings for the FFTW
+library's ‘guru interface’.  It provides two functions: @code{fftw-dft! rank
+sign in out} and @code{fftw-dft rank sign in}.  These bindings being minimal,
+there is no support for computing & reusing plans, or split r/i transforms, or
+anything other than straight complex DFTs.")
+      ;; TODO: This might actually be LGPLv3+
+      ;; See https://github.com/lloda/guile-ffi-fftw/issues/1
+      (license license:gpl3+))))