From 2bd6ed9e4c32928312eee9cd71137d5adf09f955 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 2 Sep 2018 07:47:05 +0800 Subject: gnu: haskell-mode: Fix test failure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Thanks to Jack Hill for exploring different solutions at . * 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 --- gnu/packages/emacs.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'gnu/packages/emacs.scm') diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 2b8796f72e..08554280c7 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -646,7 +646,11 @@ (define-public haskell-mode "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 @@ (define emacs-prefix? (cut string-prefix? "emacs-" <>)) (_ "")) 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 -- cgit v1.2.3