gnu: haskell-mode: Update to 16.1.

* gnu/packages/emacs.scm (haskell-mode): Update to 16.1.
  [inputs]: Add 'emacs-el-search' and 'emacs-stream'.
  [propagated-inputs]: Add 'emacs-dash'.
  [arguments]: Add modules. Adapt 'pre-build' and 'install' phases.
This commit is contained in:
Federico Beffa 2016-10-20 20:23:11 +02:00
parent 0fc06f3eba
commit 08fc0d68f0
No known key found for this signature in database
GPG Key ID: 58936E0E2F1B5A4C
1 changed files with 32 additions and 4 deletions

View File

@ -575,7 +575,7 @@ process, passing on the arguments as command line arguments.")
(define-public haskell-mode (define-public haskell-mode
(package (package
(name "haskell-mode") (name "haskell-mode")
(version "13.14.2") (version "16.1")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(file-name (string-append name "-" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz"))
@ -583,7 +583,12 @@ process, passing on the arguments as command line arguments.")
"https://github.com/haskell/haskell-mode/archive/v" "https://github.com/haskell/haskell-mode/archive/v"
version ".tar.gz")) version ".tar.gz"))
(sha256 (sha256
(base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av")))) (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"))))
(inputs
`(("emacs-el-search" ,emacs-el-search) ; for tests
("emacs-stream" ,emacs-stream))) ; for tests
(propagated-inputs
`(("emacs-dash" ,emacs-dash)))
(native-inputs (native-inputs
`(("emacs" ,emacs-minimal) `(("emacs" ,emacs-minimal)
("texinfo" ,texinfo))) ("texinfo" ,texinfo)))
@ -592,15 +597,38 @@ process, passing on the arguments as command line arguments.")
`(#:make-flags (list (string-append "EMACS=" `(#:make-flags (list (string-append "EMACS="
(assoc-ref %build-inputs "emacs") (assoc-ref %build-inputs "emacs")
"/bin/emacs")) "/bin/emacs"))
#:modules ((ice-9 match)
(srfi srfi-26)
,@%gnu-build-system-modules)
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (delete 'configure)
(add-before (add-before
'build 'pre-build 'build 'pre-build
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(define (el-dir store-dir)
(match (find-files store-dir)
((f1 f2 ...) (dirname f1))
(_ "")))
(let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh"))) (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
(define emacs-prefix? (cut string-prefix? "emacs-" <>))
(setenv "SHELL" "sh") (setenv "SHELL" "sh")
(setenv "EMACSLOADPATH"
(string-concatenate
(map (match-lambda
(((? emacs-prefix? name) . dir)
(string-append (el-dir dir) ":"))
(_ ""))
inputs)))
(substitute* (find-files "." "\\.el") (("/bin/sh") sh)) (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
(substitute* "tests/haskell-code-conventions.el"
;; Function name recently changed in "emacs-el-search".
(("el-search--search-pattern") "el-search-forward")
;; Don't contact home.
(("\\(when \\(>= emacs-major-version 25\\)")
"(require 'el-search) (when nil"))
#t))) #t)))
(replace (replace
'install 'install
@ -621,9 +649,9 @@ process, passing on the arguments as command line arguments.")
(install-file "haskell-mode.info" info)) (install-file "haskell-mode.info" info))
(copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md")) (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
(copy-to-dir el-dir (find-files "." "\\.elc?")) (copy-to-dir el-dir (find-files "." "\\.elc?"))
;; these are now distributed with emacs ;; These are part of other packages.
(with-directory-excursion el-dir (with-directory-excursion el-dir
(for-each delete-file '("cl-lib.el" "ert.el"))) (for-each delete-file '("dash.el" "ert.el")))
#t)))))) #t))))))
(home-page "https://github.com/haskell/haskell-mode") (home-page "https://github.com/haskell/haskell-mode")
(synopsis "Haskell mode for Emacs") (synopsis "Haskell mode for Emacs")