diff options
| author | Alex Vong <alexvong1995@gmail.com> | 2018-09-02 07:47:05 +0800 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2018-09-02 17:06:43 +0200 |
| commit | 2bd6ed9e4c32928312eee9cd71137d5adf09f955 (patch) | |
| tree | 6f8733985b7c5d7a66692ab56c5a948ea8fccda4 /gnu | |
| parent | b21a55a9f218c32cf9df561ad0e8d10d1b596cf0 (diff) | |
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>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/local.mk | 2 | ||||
| -rw-r--r-- | gnu/packages/emacs.scm | 17 | ||||
| -rw-r--r-- | gnu/packages/patches/haskell-mode-make-check.patch | 35 | ||||
| -rw-r--r-- | gnu/packages/patches/haskell-mode-unused-variables.patch | 44 |
4 files changed, 91 insertions, 7 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 91de38c5a39..d929ec0da8f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -791,6 +791,8 @@ dist_patch_DATA = \ | |||
| 791 | %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \ | 791 | %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \ |
| 792 | %D%/packages/patches/gzdoom-search-in-installed-share.patch \ | 792 | %D%/packages/patches/gzdoom-search-in-installed-share.patch \ |
| 793 | %D%/packages/patches/handbrake-pkg-config-path.patch \ | 793 | %D%/packages/patches/handbrake-pkg-config-path.patch \ |
| 794 | %D%/packages/patches/haskell-mode-unused-variables.patch \ | ||
| 795 | %D%/packages/patches/haskell-mode-make-check.patch \ | ||
| 794 | %D%/packages/patches/hdf4-architectures.patch \ | 796 | %D%/packages/patches/hdf4-architectures.patch \ |
| 795 | %D%/packages/patches/hdf4-reproducibility.patch \ | 797 | %D%/packages/patches/hdf4-reproducibility.patch \ |
| 796 | %D%/packages/patches/hdf4-shared-fortran.patch \ | 798 | %D%/packages/patches/hdf4-shared-fortran.patch \ |
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 2b8796f72e9..08554280c72 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm | |||
| @@ -646,7 +646,11 @@ only a handful of functions that are not resource-specific.") | |||
| 646 | "https://github.com/haskell/haskell-mode/archive/v" | 646 | "https://github.com/haskell/haskell-mode/archive/v" |
| 647 | version ".tar.gz")) | 647 | version ".tar.gz")) |
| 648 | (sha256 | 648 | (sha256 |
| 649 | (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h")))) | 649 | (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h")) |
| 650 | (patches | ||
| 651 | (search-patches ; backport test failure fixes | ||
| 652 | "haskell-mode-unused-variables.patch" | ||
| 653 | "haskell-mode-make-check.patch")))) | ||
| 650 | (inputs | 654 | (inputs |
| 651 | `(("emacs-el-search" ,emacs-el-search) ; for tests | 655 | `(("emacs-el-search" ,emacs-el-search) ; for tests |
| 652 | ("emacs-stream" ,emacs-stream))) ; for tests | 656 | ("emacs-stream" ,emacs-stream))) ; for tests |
| @@ -686,12 +690,11 @@ only a handful of functions that are not resource-specific.") | |||
| 686 | (_ "")) | 690 | (_ "")) |
| 687 | inputs))) | 691 | inputs))) |
| 688 | (substitute* (find-files "." "\\.el") (("/bin/sh") sh)) | 692 | (substitute* (find-files "." "\\.el") (("/bin/sh") sh)) |
| 689 | (substitute* "tests/haskell-code-conventions.el" | 693 | ;; embed filename to fix test failure |
| 690 | ;; Function name recently changed in "emacs-el-search". | 694 | (let ((file "tests/haskell-cabal-tests.el")) |
| 691 | (("el-search--search-pattern") "el-search-forward") | 695 | (substitute* file |
| 692 | ;; Don't contact home. | 696 | (("\\(buffer-file-name\\)") |
| 693 | (("\\(when \\(>= emacs-major-version 25\\)") | 697 | (format #f "(or (buffer-file-name) ~s)" file)))) |
| 694 | "(require 'el-search) (when nil")) | ||
| 695 | #t))) | 698 | #t))) |
| 696 | (replace | 699 | (replace |
| 697 | 'install | 700 | 'install |
diff --git a/gnu/packages/patches/haskell-mode-make-check.patch b/gnu/packages/patches/haskell-mode-make-check.patch new file mode 100644 index 00000000000..a4d4d525f25 --- /dev/null +++ b/gnu/packages/patches/haskell-mode-make-check.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | Copied from upstream repository. | ||
| 2 | Hunk #2 is removed since it cannot be applied and it is not needed. | ||
| 3 | |||
| 4 | From 7cead7137bf54851c1b7df5a3854351296d21276 Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Vasantha Ganesh K <vasanthaganesh.k@tuta.io> | ||
| 6 | Date: Thu, 22 Jun 2017 23:38:40 +0530 | ||
| 7 | Subject: [PATCH] removed `check-conventions' from make | ||
| 8 | |||
| 9 | --- | ||
| 10 | Makefile | 7 +- | ||
| 11 | tests/haskell-code-conventions.el | 165 ------------------------------ | ||
| 12 | 2 files changed, 1 insertion(+), 171 deletions(-) | ||
| 13 | delete mode 100644 tests/haskell-code-conventions.el | ||
| 14 | |||
| 15 | diff --git a/Makefile b/Makefile | ||
| 16 | index b2c89d6..aa907c5 100644 | ||
| 17 | --- a/Makefile | ||
| 18 | +++ b/Makefile | ||
| 19 | @@ -79,12 +79,7 @@ build-$(EMACS_VERSION)/build-flag : build-$(EMACS_VERSION) $(patsubst %.el,build | ||
| 20 | check-%: tests/%-tests.el | ||
| 21 | $(BATCH) -l "$<" -f ert-run-tests-batch-and-exit; | ||
| 22 | |||
| 23 | -check: compile $(AUTOLOADS) check-ert check-conventions | ||
| 24 | - | ||
| 25 | -check-conventions : | ||
| 26 | - $(BATCH) -l tests/haskell-code-conventions.el \ | ||
| 27 | - -f haskell-check-conventions-batch-and-exit | ||
| 28 | - @echo "conventions are okay" | ||
| 29 | +check: compile $(AUTOLOADS) check-ert | ||
| 30 | |||
| 31 | check-ert: $(ELCHECKS) | ||
| 32 | $(BATCH) --eval "(when (= emacs-major-version 24) \ | ||
| 33 | -- | ||
| 34 | 2.18.0 | ||
| 35 | |||
diff --git a/gnu/packages/patches/haskell-mode-unused-variables.patch b/gnu/packages/patches/haskell-mode-unused-variables.patch new file mode 100644 index 00000000000..b175fae28c2 --- /dev/null +++ b/gnu/packages/patches/haskell-mode-unused-variables.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | Copied verbatim from upstream repository. | ||
| 2 | |||
| 3 | From cee22450ee30e79952f594796721dc6b17798ee6 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Sascha Wilde <wilde@sha-bang.de> | ||
| 5 | Date: Fri, 23 Sep 2016 15:35:59 +0200 | ||
| 6 | Subject: [PATCH] Removed unused lexical variables. | ||
| 7 | |||
| 8 | --- | ||
| 9 | haskell-lexeme.el | 3 +-- | ||
| 10 | haskell-process.el | 4 +--- | ||
| 11 | 2 files changed, 2 insertions(+), 5 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/haskell-lexeme.el b/haskell-lexeme.el | ||
| 14 | index 4256a79..b832560 100644 | ||
| 15 | --- a/haskell-lexeme.el | ||
| 16 | +++ b/haskell-lexeme.el | ||
| 17 | @@ -138,8 +138,7 @@ When match is successful, match-data will contain: | ||
| 18 | (match-text 2) - whole qualified identifier | ||
| 19 | (match-text 3) - unqualified part of identifier | ||
| 20 | (match-text 4) - closing backtick" | ||
| 21 | - (let ((begin (point)) | ||
| 22 | - (match-data-old (match-data)) | ||
| 23 | + (let ((match-data-old (match-data)) | ||
| 24 | first-backtick-start | ||
| 25 | last-backtick-start | ||
| 26 | qid-start | ||
| 27 | diff --git a/haskell-process.el b/haskell-process.el | ||
| 28 | index b4efba2..4f3f859 100644 | ||
| 29 | --- a/haskell-process.el | ||
| 30 | +++ b/haskell-process.el | ||
| 31 | @@ -160,9 +160,7 @@ HPTYPE is the result of calling `'haskell-process-type`' function." | ||
| 32 | (defun haskell-process-log (msg) | ||
| 33 | "Effective append MSG to the process log (if enabled)." | ||
| 34 | (when haskell-process-log | ||
| 35 | - (let* ((append-to (get-buffer-create "*haskell-process-log*")) | ||
| 36 | - (windows (get-buffer-window-list append-to t t)) | ||
| 37 | - move-point-in-windows) | ||
| 38 | + (let* ((append-to (get-buffer-create "*haskell-process-log*"))) | ||
| 39 | (with-current-buffer append-to | ||
| 40 | ;; point should follow insertion so that it stays at the end | ||
| 41 | ;; of the buffer | ||
| 42 | -- | ||
| 43 | 2.18.0 | ||
| 44 | |||
