Subject: [bug#73034] [PATCH v3 1/3] gnu: git: Fix perl search-paths of wrapped programs.

From: Simon Tournier <[email-masked]>
Date: Thu, 5 Sep 2024 17:34:48 +0200

Fixes a regression introduced in f288604428e9c8f096ec9e0eccf207e079806271,
where the git-send-email and gitweb.cgi wrap-programs had translated into the
"new style" using G-exps.  See <https://issues.guix.gnu.org/73030>.

* gnu/packages/version-control.scm (git)[arguments]<phases>: Restore the
complete list of propagated inputs by modifying the functional composition
order.

Change-Id: Ia4e5feeae6418a9f098464556b74bc871e761be1
---
 gnu/packages/version-control.scm | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1db783b731..b8192035c2 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -55,6 +55,7 @@
 ;;; Copyright © 2024 Hilton Chain <[email-masked]>
 ;;; Copyright © 2023 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2024 Suhail Singh <[email-masked]>
+;;; Copyright © 2024 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -657,21 +658,31 @@ (define-public git
                       ,(search-path-as-list
                         '("lib/perl5/site_perl")
                         '#$(delete-duplicates
-                            (append-map
-                             (compose last package-transitive-propagated-inputs)
-                             (list (this-package-input "perl-authen-sasl")
-                                   (this-package-input "perl-net-smtp-ssl")
-                                   (this-package-input
-                                    "perl-io-socket-ssl")))))))
+                            (let ((these-inputs
+                                   (list (this-package-input "perl-authen-sasl")
+                                         (this-package-input "perl-net-smtp-ssl")
+                                         (this-package-input "perl-io-socket-ssl"))))
+                              (append
+                               these-inputs
+                               (map last
+                                    (append-map
+                                     package-transitive-propagated-inputs
+                                     these-inputs))))))))
+
                   ;; Tell 'gitweb.cgi' where perl modules are.
                   (wrap-program (string-append out "/share/gitweb/gitweb.cgi")
                     `("PERL5LIB" ":" prefix
                       ,(search-path-as-list
                         '("lib/perl5/site_perl")
                         '#$(delete-duplicates
-                            (append-map
-                             (compose last package-transitive-propagated-inputs)
-                             (list (this-package-input "perl-cgi")))))))
+                            (let ((these-inputs
+                                   (list (this-package-input "perl-cgi"))))
+                              (append
+                               these-inputs
+                               (map last
+                                    (append-map
+                                     package-transitive-propagated-inputs
+                                     these-inputs))))))))
 
                   ;; Tell 'git-submodule' where Perl is.
                   (wrap-program git-sm
-- 
2.45.2