* [PATCH 3/3] gnu: haskell-mode: Update to 16.1.
@ 2016-10-21 6:29 Federico Beffa
2016-10-24 21:38 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Federico Beffa @ 2016-10-21 6:29 UTC (permalink / raw)
To: Guix-devel
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0003-gnu-haskell-mode-Update-to-16.1.patch --]
[-- Type: text/x-patch, Size: 4141 bytes --]
From 46bd8735643b50c9c13ebce595943ad20aa1c7f1 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Thu, 20 Oct 2016 20:23:11 +0200
Subject: [PATCH 3/3] 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.
---
gnu/packages/emacs.scm | 35 +++++++++++++++++++++++++++++++----
1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 3efced2..ebca936 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -575,7 +575,7 @@ process, passing on the arguments as command line arguments.")
(define-public haskell-mode
(package
(name "haskell-mode")
- (version "13.14.2")
+ (version "16.1")
(source (origin
(method url-fetch)
(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"
version ".tar.gz"))
(sha256
- (base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av"))))
+ (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"))))
+ (inputs
+ `(("emacs-el-search" ,emacs-el-search)
+ ("emacs-stream" ,emacs-stream)))
+ (propagated-inputs
+ `(("emacs-dash" ,emacs-dash)))
(native-inputs
`(("emacs" ,emacs-minimal)
("texinfo" ,texinfo)))
@@ -592,15 +597,37 @@ process, passing on the arguments as command line arguments.")
`(#:make-flags (list (string-append "EMACS="
(assoc-ref %build-inputs "emacs")
"/bin/emacs"))
+ #:modules ((ice-9 match)
+ ,@%gnu-build-system-modules)
#:phases
(modify-phases %standard-phases
(delete 'configure)
(add-before
'build 'pre-build
(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")))
(setenv "SHELL" "sh")
+ (setenv "EMACSLOADPATH"
+ (apply string-append
+ (map (match-lambda
+ (((? (lambda (n)
+ (string-prefix? "emacs-" n)) name)
+ . dir)
+ (string-append (el-dir dir) ":"))
+ (_ ""))
+ inputs)))
(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)))
(replace
'install
@@ -621,9 +648,9 @@ process, passing on the arguments as command line arguments.")
(install-file "haskell-mode.info" info))
(copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
(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
- (for-each delete-file '("cl-lib.el" "ert.el")))
+ (for-each delete-file '("dash.el" "ert.el")))
#t))))))
(home-page "https://github.com/haskell/haskell-mode")
(synopsis "Haskell mode for Emacs")
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3] gnu: haskell-mode: Update to 16.1.
2016-10-21 6:29 [PATCH 3/3] gnu: haskell-mode: Update to 16.1 Federico Beffa
@ 2016-10-24 21:38 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2016-10-24 21:38 UTC (permalink / raw)
To: Federico Beffa; +Cc: Guix-devel
Federico Beffa <beffa@ieee.org> skribis:
> From 46bd8735643b50c9c13ebce595943ad20aa1c7f1 Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Thu, 20 Oct 2016 20:23:11 +0200
> Subject: [PATCH 3/3] 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.
[...]
> + (inputs
> + `(("emacs-el-search" ,emacs-el-search)
> + ("emacs-stream" ,emacs-stream)))
So these are only used at build time? Might be worth adding a comment
to make it clear why they are not propagated.
> (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
> (setenv "SHELL" "sh")
> + (setenv "EMACSLOADPATH"
> + (apply string-append
> + (map (match-lambda
> + (((? (lambda (n)
> + (string-prefix? "emacs-" n)) name)
> + . dir)
> + (string-append (el-dir dir) ":"))
For readability, I’d suggest moving the lambda just below the ‘let’ and
giving it a name:
(define emacs-prefix?
(cut string-prefix "emacs-" <>))
Also, (string-concatenate …) instead of (apply string-append …).
OK with these changes, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-24 21:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-21 6:29 [PATCH 3/3] gnu: haskell-mode: Update to 16.1 Federico Beffa
2016-10-24 21:38 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).