diff mbox series

[bug#48272,v2] gnu: emacs-ledger-mode: Simplify build

Message ID BYAPR05MB40238C89A77199BB3543BA09C5579@BYAPR05MB4023.namprd05.prod.outlook.com
State Accepted
Headers show
Series [bug#48272,v2] gnu: emacs-ledger-mode: Simplify build | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Morgan Smith May 7, 2021, 3:58 a.m. UTC
From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/finance.scm (emacs-ledger-mode)
[build-system]: Use emacs-build-system instead of cmake
[arguments]:
- Remove modules and imported-modules.
- Move patch-path phase to after unpack so that the substitution actually
causes a change.
- Remove generate-autoload phase as that's built into the build system.
- Remove patch-site-dir as that only affected cmake things
- Set #:exclude to '() so we install ledger-test.el
[native-inputs]: Remove emacs-minimal
---
 gnu/packages/finance.scm | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

Comments

Nicolas Goaziou May 14, 2021, 9:47 p.m. UTC | #1
Hello,

Morgan.J.Smith@outlook.com writes:

> * gnu/packages/finance.scm (emacs-ledger-mode)
> [build-system]: Use emacs-build-system instead of cmake
> [arguments]:
> - Remove modules and imported-modules.
> - Move patch-path phase to after unpack so that the substitution actually
> causes a change.
> - Remove generate-autoload phase as that's built into the build system.
> - Remove patch-site-dir as that only affected cmake things
> - Set #:exclude to '() so we install ledger-test.el
> [native-inputs]: Remove emacs-minimal

Applied. Thank you.

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index b8ec4a9dc0..3e03805fa7 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -400,22 +400,13 @@  (define-public emacs-ledger-mode
        (file-name (git-file-name name version))
        (sha256
         (base32 "1r5rcyxd6d1rqwamzpvqdbkbdf1zbj75aaciqijrklnm59ps244y"))))
-    (build-system cmake-build-system)
+    (build-system emacs-build-system)
     (arguments
-     `(#:modules ((guix build cmake-build-system)
-                  (guix build utils)
-                  (guix build emacs-utils))
-       #:imported-modules (,@%cmake-build-system-modules
-                           (guix build emacs-utils))
+     `(;; ledger-test.el is needed at runtime (but probably not for a good reason).
+       #:exclude '()
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'patch-site-dir
-           (lambda _
-             (substitute* "CMakeLists.txt"
-               (("DESTINATION share/emacs/site-lisp/ledger-mode")
-                "DESTINATION share/emacs/site-lisp"))
-             #t))
-         (add-before 'build 'patch-path
+         (add-after 'unpack 'patch-path
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((ledger (assoc-ref inputs "ledger")))
                (make-file-writable "ledger-exec.el")
@@ -430,12 +421,6 @@  (define-public emacs-ledger-mode
                (invoke "makeinfo" "-o" target
                        "../source/doc/ledger-mode.texi"))
              #t))
-         (add-after 'install 'generate-autoload
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((site-dir (string-append (assoc-ref outputs "out")
-                                             "/share/emacs/site-lisp")))
-               (emacs-generate-autoloads ,name site-dir))
-             #t))
          (replace 'check
            (lambda _
              (with-directory-excursion "../source/test"
@@ -443,8 +428,7 @@  (define-public emacs-ledger-mode
     (inputs
      `(("ledger" ,ledger)))
     (native-inputs
-     `(("emacs-minimal" ,emacs-minimal)
-       ("texinfo" ,texinfo)))
+     `(("texinfo" ,texinfo)))
     (home-page "https://ledger-cli.org/")
     (synopsis "Command-line double-entry accounting program")
     (description