gnu: perl: Find 'bash' when cross-compiling.

* gnu/packages/perl.scm
  (perl)[arguments]<#:phases>{unpack-cross}: Search for "bash" with
  'search-input-file' instead of 'assoc-ref'.
  (perl)[arguments]<#:phases>{configure}: Search for "bash-minimal"
  instead of "bash".
This commit is contained in:
Maxime Devos 2021-08-24 09:44:27 +02:00 committed by Mathieu Othacehe
parent 5203a3f123
commit 5fc78abc7f
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -31,6 +31,7 @@
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name> ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -142,15 +143,15 @@ (define-public perl
(rename-file "Artistic" "Artistic.perl") (rename-file "Artistic" "Artistic.perl")
(rename-file "Copying" "Copying.perl") (rename-file "Copying" "Copying.perl")
(copy-recursively cross-checkout ".")) (copy-recursively cross-checkout "."))
(let ((bash (assoc-ref inputs "bash"))) (let ((bash (search-input-file inputs "bin/bash")))
(substitute* '("Makefile.config.SH" (substitute* '("Makefile.config.SH"
"cnf/config.guess" "cnf/config.guess"
"cnf/config.sub" "cnf/config.sub"
"cnf/configure" "cnf/configure"
"cnf/configure_misc.sh" "cnf/configure_misc.sh"
"miniperl_top") "miniperl_top")
(("! */bin/sh") (string-append "! " bash "/bin/bash")) (("! */bin/sh") (string-append "! " bash))
((" /bin/sh") (string-append bash "/bin/bash"))) ((" /bin/sh") bash))
(substitute* '("ext/Errno/Errno_pm.PL") (substitute* '("ext/Errno/Errno_pm.PL")
(("\\$cpp < errno.c") "$Config{cc} -E errno.c"))))) (("\\$cpp < errno.c") "$Config{cc} -E errno.c")))))
(replace 'configure (replace 'configure
@ -168,7 +169,7 @@ (define-public perl
(lambda (x) (or (string-prefix? "-d" x) (lambda (x) (or (string-prefix? "-d" x)
(string-prefix? "-Dcc=" x)))) (string-prefix? "-Dcc=" x))))
configure-flags))) configure-flags)))
(bash (assoc-ref inputs "bash"))) (bash (assoc-ref inputs "bash-minimal")))
(format (current-error-port) (format (current-error-port)
"running ./configure ~a\n" "running ./configure ~a\n"
(string-join configure-flags)) (string-join configure-flags))