GNU bug report logs - #77631
[PATCH] gnu: emacs-magit: Simplify package.

Previous Next

Package: guix-patches;

Reported by: Cayetano Santos <csantosb <at> inventati.org>

Date: Tue, 8 Apr 2025 07:52:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

To reply to this bug, email your comments to 77631 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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

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


Report forwarded to andrew <at> trop.in, csantosb <at> inventati.org, divya <at> subvertising.org, hako <at> ultrarare.space, ian <at> retrospec.tv, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, guix-patches <at> gnu.org:
bug#77631; Package guix-patches. (Tue, 08 Apr 2025 07:52:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Cayetano Santos <csantosb <at> inventati.org>:
New bug report received and forwarded. Copy sent to andrew <at> trop.in, csantosb <at> inventati.org, divya <at> subvertising.org, hako <at> ultrarare.space, ian <at> retrospec.tv, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, guix-patches <at> gnu.org. (Tue, 08 Apr 2025 07:52:01 GMT) Full text and rfc822 format available.

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

From: Cayetano Santos <csantosb <at> inventati.org>
To: guix-patches <at> gnu.org
Cc: Cayetano Santos <csantosb <at> inventati.org>
Subject: [PATCH] gnu: emacs-magit: Simplify package.
Date: Tue,  8 Apr 2025 09:50:21 +0200
* gnu/packages/emacs-xyz.scm (emacs-magit): Simplify package.

These changes are based on emacs-forge package. As all magit related
packages share the same structure, let’s build them similarly.

[exclude]: Remove unexisting excludes.
[arguments]<#:phases>: Remove unnecessary configure-git phase.
[arguments]<#:phases>: Remove all unnecessary replace phases.
[arguments]<#:phases>: Add new chdir-lisp phase to operate from lisp
dir.
[arguments]<#:phases>: No need to make files writable.
[arguments]<#:phases>: Group all emacs-substitute-variables, and remove
relative path.
[test-command]: consider updated makefile path.

Change-Id: I3c2ae992faf56b9f9e7a68d1b9df430ab3b221a0
---
 gnu/packages/emacs-xyz.scm | 51 ++++++++------------------------------
 1 file changed, 10 insertions(+), 41 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 81483bc0dc..1a8ff20860 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -1919,10 +1919,7 @@ (define-public emacs-magit
     (arguments
      (list
       #:tests? #t
-      #:test-command #~(list "make" "test")
-      #:exclude #~(cons* "magit-libgit.el"
-                         "magit-libgit-pkg.el"
-                         %default-exclude)
+      #:test-command #~(list "make" "-C" ".." "test")
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'build-info-manual
@@ -1930,48 +1927,20 @@ (define-public emacs-magit
               (invoke "make" "info")
               ;; Copy info files to the lisp directory, which acts as
               ;; the root of the project for the emacs-build-system.
-              (for-each (lambda (f)
-                          (install-file f "lisp"))
-                        (find-files "docs" "\\.info$"))))
-          (add-after 'build-info-manual 'set-magit-version
+              (rename-file "docs/magit.info" "lisp/magit.info")))
+          (add-after 'build-info-manual 'chdir-lisp
             (lambda _
-              (make-file-writable "lisp/magit.el")
-              (emacs-substitute-variables "lisp/magit.el"
-                ("magit-version" #$version))))
-          (add-after 'set-magit-version 'patch-exec-paths
+              (chdir "lisp")))
+          (add-after 'chdir-lisp 'patch-version-executables
             (lambda* (#:key inputs #:allow-other-keys)
-              (for-each make-file-writable
-                        (list "lisp/magit-git.el" "lisp/magit-sequence.el"))
-              (emacs-substitute-variables "lisp/magit-git.el"
+              (emacs-substitute-variables "magit.el"
+                ("magit-version" #$version))
+              (emacs-substitute-variables "magit-git.el"
                 ("magit-git-executable"
                  (search-input-file inputs "/bin/git")))
-              (emacs-substitute-variables "lisp/magit-sequence.el"
+              (emacs-substitute-variables "magit-sequence.el"
                 ("magit-perl-executable"
-                 (search-input-file inputs "/bin/perl")))))
-          (add-before 'check 'configure-git
-            (lambda _
-              ;; Otherwise some tests fail with error "unable to auto-detect
-              ;; email address".
-              (setenv "HOME" (getcwd))
-              (invoke "git" "config" "--global" "user.name" "toto")
-              (invoke "git" "config" "--global" "user.email"
-                      "toto <at> toto.com")))
-          (replace 'expand-load-path
-            (lambda args
-              (with-directory-excursion "lisp"
-                (apply (assoc-ref %standard-phases 'expand-load-path) args))))
-          (replace 'make-autoloads
-            (lambda args
-              (with-directory-excursion "lisp"
-                (apply (assoc-ref %standard-phases 'make-autoloads) args))))
-          (replace 'install
-            (lambda args
-              (with-directory-excursion "lisp"
-                (apply (assoc-ref %standard-phases 'install) args))))
-          (replace 'build
-            (lambda args
-              (with-directory-excursion "lisp"
-                (apply (assoc-ref %standard-phases 'build) args)))))))
+                 (search-input-file inputs "/bin/perl"))))))))
     (native-inputs
      (list texinfo))
     (inputs

base-commit: e839cd1108626a6db6c47915f0efa4ab41c6a01c
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#77631; Package guix-patches. (Fri, 11 Apr 2025 11:40:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Cayetano Santos via Guix-patches via <guix-patches <at> gnu.org>
Cc: Ian Eure <ian <at> retrospec.tv>, 77631-done <at> debbugs.gnu.org,
 Katherine Cox-Buday <cox.katherine.e+guix <at> gmail.com>,
 Cayetano Santos <csantosb <at> inventati.org>, Andrew Tropin <andrew <at> trop.in>,
 Hilton Chain <hako <at> ultrarare.space>,
 Divya Ranjan Pattanaik <divya <at> subvertising.org>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#77631] [PATCH] gnu: emacs-magit: Simplify package.
Date: Fri, 11 Apr 2025 12:39:12 +0100
[Message part 1 (text/plain, inline)]
Cayetano Santos via Guix-patches via <guix-patches <at> gnu.org> writes:

> * gnu/packages/emacs-xyz.scm (emacs-magit): Simplify package.
>
> These changes are based on emacs-forge package. As all magit related
> packages share the same structure, let’s build them similarly.
>
> [exclude]: Remove unexisting excludes.
> [arguments]<#:phases>: Remove unnecessary configure-git phase.
> [arguments]<#:phases>: Remove all unnecessary replace phases.
> [arguments]<#:phases>: Add new chdir-lisp phase to operate from lisp
> dir.
> [arguments]<#:phases>: No need to make files writable.
> [arguments]<#:phases>: Group all emacs-substitute-variables, and remove
> relative path.
> [test-command]: consider updated makefile path.
>
> Change-Id: I3c2ae992faf56b9f9e7a68d1b9df430ab3b221a0
> ---
>  gnu/packages/emacs-xyz.scm | 51 ++++++++------------------------------
>  1 file changed, 10 insertions(+), 41 deletions(-)

Thanks for the patch, I've pushed this to master as
172e9a1aa1ee2ef3e557cf46a11e451aa7982983.

Chris
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Fri, 11 Apr 2025 11:40:03 GMT) Full text and rfc822 format available.

Notification sent to Cayetano Santos <csantosb <at> inventati.org>:
bug acknowledged by developer. (Fri, 11 Apr 2025 11:40:03 GMT) Full text and rfc822 format available.

This bug report was last modified 1 day ago.

Previous Next


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