summary refs log tree commit diff
path: root/gnu/packages/plotutils.scm
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-04 00:43:36 +0200
committerAlex Kost <alezost@gmail.com>2016-05-16 18:01:18 +0300
commit80ed14d38f098f25f87efb01288cd6df8b307b7b (patch)
tree48c4d3c9827c24cd790384f269920f9fbbfb6f43 /gnu/packages/plotutils.scm
parent47c96a577d82034d5a7b0d1062faf4ad0dd097d3 (diff)
downloadguix-80ed14d38f098f25f87efb01288cd6df8b307b7b.tar.gz
gnu: asymptote: Install Emacs data.
* gnu/packages/plotutils.scm (asymptote)[arguments]: Add a phase to
  install Emacs-Lisp files in an appropriate place.

Signed-off-by: Alex Kost <alezost@gmail.com>
Diffstat (limited to 'gnu/packages/plotutils.scm')
-rw-r--r--gnu/packages/plotutils.scm27
1 files changed, 23 insertions, 4 deletions
diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm
index 3fdd539835..ef61239cab 100644
--- a/gnu/packages/plotutils.scm
+++ b/gnu/packages/plotutils.scm
@@ -25,6 +25,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ghostscript)
@@ -188,6 +189,7 @@ colors, styles, options and details.")
      `(("gs" ,ghostscript)              ;For tests
        ("texinfo" ,texinfo)             ;For generating documentation
        ("texlive" ,texlive)             ;For tests and documentation
+       ("emacs" ,emacs-no-x)
        ("perl" ,perl)))
     (inputs
      `(("fftw" ,fftw)
@@ -198,7 +200,13 @@ colors, styles, options and details.")
        ("readline" ,readline)
        ("zlib" ,zlib)))
     (arguments
-     `(#:configure-flags
+     `(#:modules ((guix build emacs-utils)
+                  (guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-26))
+       #:imported-modules (,@%gnu-build-system-modules
+                           (guix build emacs-utils))
+       #:configure-flags
        (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc"))
              (string-append "--with-latex="
                             (assoc-ref %outputs "out")
@@ -210,15 +218,26 @@ colors, styles, options and details.")
        (modify-phases %standard-phases
          (add-before 'build 'patch-pdf-viewer
            (lambda _
-             ;; Default to a free pdf viewer
+             ;; Default to a free pdf viewer.
              (substitute* "settings.cc"
                (("defaultPDFViewer=\"acroread\"")
-                "defaultPDFViewer=\"gv\""))))
+                "defaultPDFViewer=\"gv\""))
+             #t))
          (add-before 'check 'set-HOME
            ;; Some tests require write access to $HOME, otherwise leading to
            ;; "failed to create directory /homeless-shelter/.asy" error.
            (lambda _
-             (setenv "HOME" "/tmp"))))))
+             (setenv "HOME" "/tmp")
+             #t))
+         (add-after 'install 'install-Emacs-data
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Install related Emacs libraries into an appropriate location.
+             (let* ((out (assoc-ref outputs "out"))
+                    (lisp-dir (string-append out "/share/emacs/site-lisp")))
+               (for-each (cut install-file <> lisp-dir)
+                         (find-files "." "\\.el$"))
+               (emacs-generate-autoloads ,name lisp-dir))
+             #t)))))
     (home-page "http://asymptote.sourceforge.net")
     (synopsis "Script-based vector graphics language")
     (description