gnu: haskell-mode: Fix test failure.

Fixes <https://bugs.gnu.org/31726>.

Thanks to Jack Hill <jackhill@jackhill.us> for exploring different solutions
at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31726>.

* gnu/packages/patches/haskell-mode-unused-variables.patch,
gnu/packages/patches/haskell-mode-make-check.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/emacs.scm (haskell-mode)[source]: Use them.
[arguments]: Adjust 'pre-build' phase to embed file name.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Alex Vong 2018-09-02 07:47:05 +08:00 committed by Ludovic Courtès
parent b21a55a9f2
commit 2bd6ed9e4c
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
4 changed files with 91 additions and 7 deletions

View file

@ -646,7 +646,11 @@ only a handful of functions that are not resource-specific.")
"https://github.com/haskell/haskell-mode/archive/v"
version ".tar.gz"))
(sha256
(base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"))))
(base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"))
(patches
(search-patches ; backport test failure fixes
"haskell-mode-unused-variables.patch"
"haskell-mode-make-check.patch"))))
(inputs
`(("emacs-el-search" ,emacs-el-search) ; for tests
("emacs-stream" ,emacs-stream))) ; for tests
@ -686,12 +690,11 @@ only a handful of functions that are not resource-specific.")
(_ ""))
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"))
;; embed filename to fix test failure
(let ((file "tests/haskell-cabal-tests.el"))
(substitute* file
(("\\(buffer-file-name\\)")
(format #f "(or (buffer-file-name) ~s)" file))))
#t)))
(replace
'install