[PATCH] gnu: emacs-deadgrep: Add missing input.

  • Done
  • quality assurance status badge
Details
2 participants
  • Matthew James Kraai
  • Nicolas Goaziou
Owner
unassigned
Submitted by
Matthew James Kraai
Severity
normal
M
M
Matthew James Kraai wrote on 7 Jul 2021 05:18
(address . guix-patches@gnu.org)(name . Matthew James Kraai)(address . kraai@ftbfs.org)
20210707031810.27321-1-kraai@ftbfs.org
* gnu/packages/emacs-xyz.scm (emacs-deadgrep)[propagated-inputs]: Add
ripgrep.
---
gnu/packages/emacs-xyz.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Add ripgrep as propagated-input, as is done for emacs-ripgrep and emacs-rg.

Toggle diff (16 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 9591a4e6e7..029b20ee72 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -20805,7 +20805,8 @@ accept and reject GitHub pull requests.")
(propagated-inputs
`(("emacs-dash" ,emacs-dash)
("emacs-s" ,emacs-s)
- ("emacs-spinner" ,emacs-spinner)))
+ ("emacs-spinner" ,emacs-spinner)
+ ("ripgrep" ,ripgrep)))
(home-page "https://github.com/Wilfred/deadgrep")
(synopsis "Frontend for @code{ripgrep}")
(description "This package provides an Emacs interface for performing
--
2.32.0
N
N
Nicolas Goaziou wrote on 7 Jul 2021 16:20
(name . Matthew James Kraai)(address . kraai@ftbfs.org)(address . 49450@debbugs.gnu.org)
878s2itdc4.fsf@nicolasgoaziou.fr
Hello,

Matthew James Kraai <kraai@ftbfs.org> writes:

Toggle quote (9 lines)
> * gnu/packages/emacs-xyz.scm (emacs-deadgrep)[propagated-inputs]: Add
> ripgrep.
> ---
> gnu/packages/emacs-xyz.scm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Add ripgrep as propagated-input, as is done for emacs-ripgrep and
> emacs-rg.

I think ripgrep should be an input. Both emacs-ripgrep and emacs-rg
needs to be fixed, too.

Regards,
--
Nicolas Goaziou
M
M
Matthew Kraai wrote on 7 Jul 2021 17:42
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 49450@debbugs.gnu.org)
859C1BD7-D59C-4990-949F-376ADF47AF26@ftbfs.org
Hi Nicolas,

I was trying to ensure that when emacs-deadgrep is installed, ripgrep is also installed. The former doesn’t need the latter to build but does require it at runtime. Isn’t propagated-inputs the right field for that?

Sent from my iPhone

Toggle quote (21 lines)
> On Jul 7, 2021, at 7:20 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>
> ?Hello,
>
> Matthew James Kraai <kraai@ftbfs.org> writes:
>
>> * gnu/packages/emacs-xyz.scm (emacs-deadgrep)[propagated-inputs]: Add
>> ripgrep.
>> ---
>> gnu/packages/emacs-xyz.scm | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> Add ripgrep as propagated-input, as is done for emacs-ripgrep and
>> emacs-rg.
>
> I think ripgrep should be an input. Both emacs-ripgrep and emacs-rg
> needs to be fixed, too.
>
> Regards,
> --
> Nicolas Goaziou
N
N
Nicolas Goaziou wrote on 7 Jul 2021 17:53
(name . Matthew Kraai)(address . kraai@ftbfs.org)(address . 49450@debbugs.gnu.org)
874kd6t925.fsf@nicolasgoaziou.fr
Matthew Kraai <kraai@ftbfs.org> writes:

Toggle quote (5 lines)
> I was trying to ensure that when emacs-deadgrep is installed, ripgrep
> is also installed. The former doesn’t need the latter to build but
> does require it at runtime. Isn’t propagated-inputs the right field
> for that?

Inputs are also available at runtime, but do not clobber user's profile.
It's preferable to use them, when it's reasonably possible.

In this case, it means you just need to modify the Elisp source to make
sure code points to the right ripgrep executable in the store. See,
e.g., emacs-flycheck-grammalecte.
M
M
Matthew James Kraai wrote on 8 Jul 2021 01:56
[PATCH] gnu: emacs-deadgrep: Add missing input.
(address . 49450@debbugs.gnu.org)(name . Matthew James Kraai)(address . kraai@ftbfs.org)
20210707235624.25962-1-kraai@ftbfs.org
* gnu/packages/emacs-xyz.scm (emacs-deadgrep)[inputs]: Add ripgrep.
[arguments]: Add configure phase to set deadgrep-executable to absolute path.
---
gnu/packages/emacs-xyz.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (32 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 9591a4e6e7..fd7f1b54d3 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -20802,10 +20802,25 @@ accept and reject GitHub pull requests.")
(base32
"1vjhrq02l8gvdn2haygzq7277hnhjchs9xrfpcnh76gqip200gx4"))))
(build-system emacs-build-system)
+ (inputs `(("ripgrep" ,ripgrep)))
(propagated-inputs
`(("emacs-dash" ,emacs-dash)
("emacs-s" ,emacs-s)
("emacs-spinner" ,emacs-spinner)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'configure
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((ripgrep (assoc-ref inputs "ripgrep")))
+ ;; .el is read-only in git.
+ (chmod "deadgrep.el" #o644)
+ ;; Specify the absolute file names of rg so that everything
+ ;; works out-of-the-box.
+ (emacs-substitute-variables
+ "deadgrep.el"
+ ("deadgrep-executable"
+ (string-append ripgrep "/bin/rg")))))))))
(home-page "https://github.com/Wilfred/deadgrep")
(synopsis "Frontend for @code{ripgrep}")
(description "This package provides an Emacs interface for performing
--
2.32.0
N
N
Nicolas Goaziou wrote on 8 Jul 2021 09:33
(name . Matthew James Kraai)(address . kraai@ftbfs.org)(address . 49450-done@debbugs.gnu.org)
87h7h5qmyd.fsf@nicolasgoaziou.fr
Hello,

Matthew James Kraai <kraai@ftbfs.org> writes:

Toggle quote (4 lines)
> * gnu/packages/emacs-xyz.scm (emacs-deadgrep)[inputs]: Add ripgrep.
> [arguments]: Add configure phase to set deadgrep-executable to
> absolute path.

Thank you.

Toggle quote (3 lines)
> + ;; .el is read-only in git.
> + (chmod "deadgrep.el" #o644)

I used `make-file-writable' function instead of chmod.

Applied. Thank you.

Regards,
--
Nicolas Goaziou
Closed
?