|
| 1 | +;; haskell-check-external.el --- Test if packages depending on haskell-mode install okay -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +(require 'package) |
| 4 | +(require 'bytecomp) |
| 5 | + |
| 6 | +(defun haskell-check-external-batch-and-exit () |
| 7 | + "Check if packages depending on haskell-mode bytecompile. |
| 8 | +
|
| 9 | +Haskell Mode should not break packages that depend on it and this |
| 10 | +function checks if officially released versions still compile." |
| 11 | + |
| 12 | + (let ((byte-compile-error-on-warn t) |
| 13 | + ;; where to install temporary packages |
| 14 | + (package-user-dir (concat command-line-default-directory "/external/elpa")) |
| 15 | + ;; use haskell-mode directly from sources, it takes priority |
| 16 | + ;; over haskell-mode in packages. note that this works from |
| 17 | + ;; Emacs 24.4 onward, there is something wrong about this |
| 18 | + ;; variable in Emacs 24.3 |
| 19 | + (package-directory-list (list command-line-default-directory)) |
| 20 | + ;; packages depending on haskell-mode are in melpa |
| 21 | + (package-archives (cons '("melpa" . "http://melpa.milkbox.net/packages/") package-archives))) |
| 22 | + |
| 23 | + (unwind-protect |
| 24 | + (progn |
| 25 | + (make-directory "external") |
| 26 | + |
| 27 | + ;; We aren't really able to depend on errors and warnings in |
| 28 | + ;; bytecompilation as there are many packages that are very |
| 29 | + ;; inconsistent about following elisp best practices. |
| 30 | + (package-initialize) |
| 31 | + (package-refresh-contents) |
| 32 | + (package-install 'flycheck-haskell) |
| 33 | + (package-install 'flycheck-stack) |
| 34 | + (package-install 'ghc) |
| 35 | + (package-install 'intero)) |
| 36 | + (delete-directory "external" t)))) |
0 commit comments