summary refs log tree commit diff
path: root/gnu/packages/guile.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-02-10 15:13:21 +0100
committerLudovic Courtès <ludo@gnu.org>2016-02-10 15:15:17 +0100
commit4ecbf6d2827849f3de57b0f185487a274bcbe758 (patch)
tree3c01e5029ed57741e31beffa160eb80a7888db31 /gnu/packages/guile.scm
parentf5582b2c1d7cb73f36d5278bec99d7279f813a39 (diff)
downloadguix-4ecbf6d2827849f3de57b0f185487a274bcbe758.tar.gz
gnu: haunt: Wrap 'haunt' command so that it finds its modules.
* gnu/packages/guile.scm (haunt)[arguments]: New field.
Diffstat (limited to 'gnu/packages/guile.scm')
-rw-r--r--gnu/packages/guile.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 6cbca7a478..e6e722883f 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -700,6 +700,28 @@ Guile's foreign function interface.")
                (base32
                 "15q1qwjnay7k90ppqrzqsmikvwyj61mjvf1zahyd9gm4vi2fgb3x"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:modules ((ice-9 match) (ice-9 ftw)
+                  ,@%gnu-build-system-modules)
+
+       #:phases (modify-phases %standard-phases
+                  (add-after 'install 'wrap-haunt
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; Wrap the 'haunt' command to refer to the right
+                      ;; modules.
+                      (let* ((out  (assoc-ref outputs "out"))
+                             (bin  (string-append out "/bin"))
+                             (site (string-append
+                                    out "/share/guile/site")))
+                        (match (scandir site)
+                          (("." ".." version)
+                           (let ((modules (string-append site "/" version)))
+                             (wrap-program (string-append bin "/haunt")
+                               `("GUILE_LOAD_PATH" ":" prefix
+                                 (,modules))
+                               `("GUILE_LOAD_COMPILED_PATH" ":" prefix
+                                 (,modules)))
+                             #t)))))))))
     (inputs
      `(("guile" ,guile-2.0)))
     (synopsis "Functional static site generator")