I started with the 'trivial-build-system' and the switched to the GNU
one and forgot to delete the module imports...
Updated.

Regards,
Fede

On Fri, Jun 12, 2015 at 10:10 PM, Federico Beffa <be...@ieee.org> wrote:
> An emacs mode for Haskell.
>
> Regards,
> Fede
From d08df1568688701e20582c74acc85b3d9b5da01a Mon Sep 17 00:00:00 2001
From: Federico Beffa <be...@fbengineering.ch>
Date: Fri, 12 Jun 2015 18:58:35 +0200
Subject: [PATCH] gnu: Add haskell-mode.

* gnu/packages/emacs.scm (haskell-mode): New variable.
---
 gnu/packages/emacs.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index fbddff1..2312711 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -430,6 +430,68 @@ operations.")
 support for Git-SVN.")
     (license license:gpl3+)))
 
+(define-public haskell-mode
+  (package
+    (name "haskell-mode")
+    (version "13.14.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/haskell/haskell-mode/archive/v";
+                    version ".tar.gz"))
+             (sha256
+              (base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av"))))
+    (inputs `(("emacs" ,emacs-no-x)))
+    (native-inputs
+     `(("texinfo" ,texinfo)))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags (list (string-append "EMACS="
+                                         (assoc-ref %build-inputs "emacs")
+                                         "/bin/emacs"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before
+          'build 'pre-build
+          (lambda _
+            (setenv "SHELL" "sh")
+            (substitute* (find-files "." ".*\\.el") (("/bin/sh") "sh"))
+            #t))
+         (replace
+          'install
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                   (el-dir (string-append out "/share/emacs/site-lisp"))
+                   (doc (string-append
+                         out "/share/doc/haskell-mode-" ,version))
+                   (info (string-append out "/share/info")))
+              (with-directory-excursion "doc"
+                (system* "makeinfo" "haskell-mode.texi")
+                (mkdir-p info)
+                (copy-file "haskell-mode.info"
+                           (string-append info "/haskell-mode.info")))
+              (for-each
+               (lambda (dir files)
+                 (mkdir-p dir)
+                 (for-each
+                  (lambda (f)
+                    (copy-file f (string-append dir "/" (basename f))))
+                  files))
+               (list doc el-dir)
+               (list '("CONTRIBUTING.md" "NEWS" "README.md")
+                     (find-files "." ".*\\.elc?")))
+               ;; these are now distributed with emacs
+               (with-directory-excursion el-dir
+                 (for-each delete-file '("cl-lib.el" "ert.el")))
+              #t))))))
+    (home-page "https://github.com/haskell/haskell-mode";)
+    (synopsis "Haskell mode for Emacs")
+    (description
+     "This is an Emacs mode for editing, debugging and developing Haskell
+programs.")
+    (license license:gpl3+)))
+
 
 ;;;
 ;;; Web browsing.
-- 
2.2.1

Reply via email to