all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Morgan.J.Smith@outlook.com
To: 51364@debbugs.gnu.org
Cc: Morgan Smith <Morgan.J.Smith@outlook.com>
Subject: [bug#51364] [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input
Date: Tue,  2 Nov 2021 19:23:50 -0400	[thread overview]
Message-ID: <BYAPR05MB402350C92D4D2F0E6BEA55F3C58B9@BYAPR05MB4023.namprd05.prod.outlook.com> (raw)
In-Reply-To: <BYAPR05MB4023A6FD0C1527D04116C7F3C5819@BYAPR05MB4023.namprd05.prod.outlook.com>

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
been loaded.

 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
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -1649,6 +1649,19 @@ (define-public emacs-flymake-shellcheck
          (sha256
           (base32 "04yfb4sy41spjzk9mhm4gy0h8vnjx09p2g6nm1yzgd9a5ph9sqgl"))))
       (build-system emacs-build-system)
+      (arguments
+       '(#:phases
+         (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")
+                                       "/bin/shellcheck")))))))))
+      (inputs
+       `(("shellcheck" ,shellcheck)))
       (home-page "https://github.com/federicotdn/flymake-shellcheck")
       (synopsis "Flymake backend for Bash/Sh powered by ShellCheck")
       (description
-- 
2.33.1





      parent reply	other threads:[~2021-11-02 23:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23 22:21 [bug#51364] [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input Morgan.J.Smith
2021-10-25 11:39 ` Efraim Flashner
2021-11-02 23:23 ` Morgan.J.Smith [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR05MB402350C92D4D2F0E6BEA55F3C58B9@BYAPR05MB4023.namprd05.prod.outlook.com \
    --to=morgan.j.smith@outlook.com \
    --cc=51364@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.