diff options
| author | Cayetano Santos <csantosb@inventati.org> | 2025-04-08 09:50:21 +0200 |
|---|---|---|
| committer | Christopher Baines <mail@cbaines.net> | 2025-04-11 12:30:38 +0100 |
| commit | 172e9a1aa1ee2ef3e557cf46a11e451aa7982983 (patch) | |
| tree | 6e4fd6b14d6a9abf4b23f3b1e0912c3694ed1ea0 | |
| parent | 33c3ee5985b05ca67b26b559ee5b8833f6e2d656 (diff) | |
gnu: 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.
* gnu/packages/emacs-xyz.scm (emacs-magit): Simplify package.
[arguments]<#:exclude>: Remove unexisting excludes.
<#:phases>: Remove unnecessary configure-git phase. Remove all unnecessary
replace phases. Add new chdir-lisp phase to operate from lisp dir. No need
to make files writable. Group all emacs-substitute-variables, and remove
relative path.
<#:test-command>: Consider updated makefile path.
Change-Id: I3c2ae992faf56b9f9e7a68d1b9df430ab3b221a0
Signed-off-by: Christopher Baines <mail@cbaines.net>
| -rw-r--r-- | gnu/packages/emacs-xyz.scm | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 4ca7e16949..b290ab8d29 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -1919,10 +1919,7 @@ before interacting with non-free LLMs.") (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 @@ before interacting with non-free LLMs.") (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@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 |
