gnu: emacs-magit: Use G-expressions.

* gnu/packages/emacs-xyz.scm (emacs-magit)[arguments]: Use G-expressions.
<#:phases>: Use search-input-file to find perl for ‘patch-exec-paths’.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Zhu Zihao 2022-05-22 17:43:42 +08:00 committed by Liliana Marie Prikler
parent 83f444de56
commit 0bb6504ba6
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -891,51 +891,52 @@ libgit2 bindings for Emacs, intended to boost the performance of Magit.")
(base32 "0cxyvp2aav27znc7mf6c83q5pddpdniaqkrxn1r8dbgr540qmnpn")))) (base32 "0cxyvp2aav27znc7mf6c83q5pddpdniaqkrxn1r8dbgr540qmnpn"))))
(build-system emacs-build-system) (build-system emacs-build-system)
(arguments (arguments
`(#:emacs ,emacs-no-x ;module support is required (list
#:tests? #t #:emacs emacs-no-x ;module support is required
#:test-command '("make" "test") #:tests? #t
#:phases #:test-command #~(list "make" "test")
(modify-phases %standard-phases #:phases
(add-after 'unpack 'build-info-manual #~(modify-phases %standard-phases
(lambda _ (add-after 'unpack 'build-info-manual
(invoke "make" "info") (lambda _
;; Copy info files to the lisp directory, which acts as (invoke "make" "info")
;; the root of the project for the emacs-build-system. ;; Copy info files to the lisp directory, which acts as
(for-each (lambda (f) ;; the root of the project for the emacs-build-system.
(install-file f "lisp")) (for-each (lambda (f)
(find-files "Documentation" "\\.info$")) (install-file f "lisp"))
(chdir "lisp"))) (find-files "Documentation" "\\.info$"))
(add-after 'build-info-manual 'set-magit-version (chdir "lisp")))
(lambda _ (add-after 'build-info-manual 'set-magit-version
(make-file-writable "magit.el") (lambda _
(emacs-substitute-variables "magit.el" (make-file-writable "magit.el")
("magit-version" ,version)))) (emacs-substitute-variables "magit.el"
(add-after 'set-magit-version 'patch-exec-paths ("magit-version" #$version))))
(lambda* (#:key inputs #:allow-other-keys) (add-after 'set-magit-version 'patch-exec-paths
(let ((perl (assoc-ref inputs "perl"))) (lambda* (#:key inputs #:allow-other-keys)
(make-file-writable "magit-sequence.el") (make-file-writable "magit-sequence.el")
(emacs-substitute-variables "magit-sequence.el" (emacs-substitute-variables "magit-sequence.el"
("magit-perl-executable" (string-append perl "/bin/perl")))))) ("magit-perl-executable"
(add-before 'check 'configure-git (search-input-file inputs "/bin/perl")))))
(lambda _ (add-before 'check 'configure-git
;; Otherwise some tests fail with error "unable to auto-detect (lambda _
;; email address". ;; Otherwise some tests fail with error "unable to auto-detect
(setenv "HOME" (getcwd)) ;; email address".
(invoke "git" "config" "--global" "user.name" "toto") (setenv "HOME" (getcwd))
(invoke "git" "config" "--global" "user.email" (invoke "git" "config" "--global" "user.name" "toto")
"toto@toto.com"))) (invoke "git" "config" "--global" "user.email"
(add-after 'configure-git 'disable-tramp-test "toto@toto.com")))
(lambda _ (add-after 'configure-git 'disable-tramp-test
;; There is an issue causing TRAMP to fail in the build (lambda _
;; environment. Setting the tramp-remote-shell parameter of ;; There is an issue causing TRAMP to fail in the build
;; the sudo-method to the file name of the shell didn't help. ;; environment. Setting the tramp-remote-shell parameter of
(chdir "..") ;; the sudo-method to the file name of the shell didn't help.
(substitute* "t/magit-tests.el" (chdir "..")
(("^\\(ert-deftest magit-toplevel:tramp.*" all) (substitute* "t/magit-tests.el"
(string-append all " (skip-unless nil)"))))) (("^\\(ert-deftest magit-toplevel:tramp.*" all)
(add-before 'install 'enter-lisp-directory (string-append all " (skip-unless nil)")))))
(lambda _ (add-before 'install 'enter-lisp-directory
(chdir "lisp")))))) (lambda _
(chdir "lisp"))))))
(native-inputs (native-inputs
(list texinfo)) (list texinfo))
(inputs (inputs