[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51364] [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an
Morgan . J . Smith
[bug#51364] [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input
Tue, 2 Nov 2021 19:23:50 -0400
From: Morgan Smith <Morgan.J.Smith@outlook.com>
* gnu/packages/emacs-xyz.scm (emacs-flymake-shellcheck)
[inputs]: Add shellcheck.
[arguments]: Add substitute-shellcheck-path phase.
Sorry for the late reply, I didn't see this in my email.
People would still have been able to set the variable from their configuration.
The value I'm editing just determines the default value. However, I think I
came up with a nice solution that should make everyone happy. It first checks
if there is shellcheck in your path and only hard codes the path if you don't
have it. Apparently Emacs even re-evaluates defcustoms in certain situations
so this *might* even work if someone installs shellcheck after this file has
gnu/packages/emacs-xyz.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 624fe957e3..dad555cae3 100644
@@ -1649,6 +1649,19 @@ (define-public emacs-flymake-shellcheck
+ (modify-phases %standard-phases
+ (add-after 'unpack 'substitute-shellcheck-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (make-file-writable "flymake-shellcheck.el")
+ (emacs-substitute-sexps "flymake-shellcheck.el"
+ ("defcustom flymake-shellcheck-path"
+ `(or (executable-find "shellcheck")
+ ,(string-append (assoc-ref inputs "shellcheck")
+ `(("shellcheck" ,shellcheck)))
(synopsis "Flymake backend for Bash/Sh powered by ShellCheck")
|[Prev in Thread]
||[Next in Thread]|
- [bug#51364] [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input,
Morgan . J . Smith <=