GNU bug report logs - #42216
[PATCH] gnu: Add emacs-flycheck-ledger.

Previous Next

Package: guix-patches;

Reported by: Morgan.J.Smith <at> outlook.com

Date: Sun, 5 Jul 2020 18:36:02 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42216 in the body.
You can then email your comments to 42216 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#42216; Package guix-patches. (Sun, 05 Jul 2020 18:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Morgan.J.Smith <at> outlook.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 05 Jul 2020 18:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: guix-patches <at> gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Subject: [PATCH] gnu: Add emacs-flycheck-ledger.
Date: Sun,  5 Jul 2020 14:20:23 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* gnu/packages/emacs-xyz.scm (emacs-flycheck-ledger): New variable.
---
 gnu/packages/emacs-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index a67fe06610..486c93dce3 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -179,6 +179,7 @@
   #:use-module (gnu packages wordnet)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages uml)
+  #:use-module (gnu packages finance)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match))
@@ -4074,6 +4075,28 @@ repetitions for example).")
 compile}.")
     (license license:gpl3+)))
 
+(define-public emacs-flycheck-ledger
+  (package
+    (name "emacs-flycheck-ledger")
+    (version "20200304.2204")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://melpa.org/packages/flycheck-ledger-"
+                                  version ".el"))
+              (sha256
+               (base32
+                "036xn52xjxbbvag9slqi4xqlvzg9p2q544hhxhqqi7jz1kap0yx8"))))
+    (inputs `(("ledger" ,ledger)))
+    (propagated-inputs
+     `(("emacs-flycheck" ,emacs-flycheck)))
+    (build-system emacs-build-system)
+    (home-page "https://github.com/purcell/flycheck-ledger")
+    (synopsis "Ledger support for Flycheck")
+    (description "This flychecker uses the output of @code{ledger balance} on
+the current file to find errors such as unbalanced transactions and syntax
+errors.")
+    (license license:gpl3+)))
+
 (define-public emacs-flycheck-rust
   (package
     (name "emacs-flycheck-rust")
-- 
2.27.0





Information forwarded to guix-patches <at> gnu.org:
bug#42216; Package guix-patches. (Mon, 06 Jul 2020 12:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 42216 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Morgan.J.Smith <at> outlook.com
Cc: 42216 <at> debbugs.gnu.org
Subject: Re: [bug#42216] [PATCH] gnu: Add emacs-flycheck-ledger.
Date: Mon, 06 Jul 2020 14:24:47 +0200
Hello,

Morgan.J.Smith <at> outlook.com writes:

> * gnu/packages/emacs-xyz.scm (emacs-flycheck-ledger): New variable.

Thank you. Some comments follow.

> +(define-public emacs-flycheck-ledger
> +  (package
> +    (name "emacs-flycheck-ledger")
> +    (version "20200304.2204")

There's a stable "0.5" release. We should use it instead.

> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://melpa.org/packages/flycheck-ledger-"
> +                                  version ".el"))

We don't use source files from MELPA, as they are somewhat modified
in-place. Use git-fetch instead.

Also, could you move `origin' behind `source'?

> +              (sha256
> +               (base32
> +                "036xn52xjxbbvag9slqi4xqlvzg9p2q544hhxhqqi7jz1kap0yx8"))))
> +    (inputs `(("ledger" ,ledger)))

I think this is not sufficient, because Emacs Flycheck Ledger will not
find the Ledger executable. You need to tweak
`flycheck-ledger-executable', using `emacs-substitute-variables'.

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#42216; Package guix-patches. (Sat, 11 Jul 2020 01:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 42216 <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: 42216 <at> debbugs.gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Subject: [PATCH] gnu: Add emacs-flycheck-ledger.
Date: Fri, 10 Jul 2020 21:34:23 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* gnu/packages/emacs-xyz.scm (emacs-flycheck-ledger): New variable.
---

Your idea of using `emacs-substitute-variables' was a good one, but
the variable in question is autogenerated somehow I think. I decided
to do a regex replace instead. I'm not super happy about this because
I think it could break easily but I saw emacs-flycheck-grammalecte
doing the same thing

 gnu/packages/emacs-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 89fed81059..4de95a4f0a 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -181,6 +181,7 @@
   #:use-module (gnu packages wordnet)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages uml)
+  #:use-module (gnu packages finance)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match))
@@ -4076,6 +4077,40 @@ repetitions for example).")
 compile}.")
     (license license:gpl3+)))
 
+(define-public emacs-flycheck-ledger
+  (package
+    (name "emacs-flycheck-ledger")
+    (version "0.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/purcell/flycheck-ledger.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1djrj3is0dzrl2703bw7bclf33dp4xqmy144q7xj5pvpb9v3kf50"))))
+    (inputs `(("ledger" ,ledger)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((ledger (assoc-ref inputs "ledger")))
+               ;; Specify the absolute executable location of ledger
+               (substitute* "flycheck-ledger.el"
+                 (("\"ledger\"") (string-append "\"" ledger "\""))))
+             #t)))))
+    (propagated-inputs
+     `(("emacs-flycheck" ,emacs-flycheck)))
+    (build-system emacs-build-system)
+    (home-page "https://github.com/purcell/flycheck-ledger")
+    (synopsis "Ledger support for Flycheck")
+    (description "This flychecker uses the output of @code{ledger balance} on
+the current file to find errors such as unbalanced transactions and syntax
+errors.")
+    (license license:gpl3+)))
+
 (define-public emacs-flycheck-rust
   (package
     (name "emacs-flycheck-rust")
-- 
2.27.0





Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Tue, 14 Jul 2020 09:14:02 GMT) Full text and rfc822 format available.

Notification sent to Morgan.J.Smith <at> outlook.com:
bug acknowledged by developer. (Tue, 14 Jul 2020 09:14:02 GMT) Full text and rfc822 format available.

Message #16 received at 42216-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Morgan.J.Smith <at> outlook.com
Cc: 42216-done <at> debbugs.gnu.org
Subject: Re: [bug#42216] [PATCH] gnu: Add emacs-flycheck-ledger.
Date: Tue, 14 Jul 2020 11:13:36 +0200
Hello,

Morgan.J.Smith <at> outlook.com writes:

> From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
>
> * gnu/packages/emacs-xyz.scm (emacs-flycheck-ledger): New variable.

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Aug 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.