gnu: avahi: Use the cross-compiled bash.

* gnu/packages/avahi.scm (avahi)[arguments]<#:phases>{patch-more-shebangs}:
  Replace the bash in the shebangs in "/etc/avahi" with a cross-compiled bash.
This commit is contained in:
Maxime Devos 2021-08-25 13:53:22 +02:00 committed by Mathieu Othacehe
parent 0515ebb0d1
commit 0636f02b0e
No known key found for this signature in database
GPG Key ID: 8354763531769CA6

@ -23,9 +23,11 @@
(define-module (gnu packages avahi) (define-module (gnu packages avahi)
#:use-module ((guix licenses) #:select (lgpl2.1+)) #:use-module ((guix licenses) #:select (lgpl2.1+))
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages bash)
#:use-module (gnu packages dbm) #:use-module (gnu packages dbm)
#:use-module (gnu packages gettext) #:use-module (gnu packages gettext)
#:use-module (gnu packages glib) #:use-module (gnu packages glib)
@ -72,9 +74,28 @@
"--enable-compat-libdns_sd" "--enable-compat-libdns_sd"
,@(if (%current-target-system) ,@(if (%current-target-system)
'("ac_cv_prog_have_pkg_config=yes") '("ac_cv_prog_have_pkg_config=yes")
'())))) '()))
;; TODO(core-updates): Make this unconditional.
,@(if (%current-target-system)
`(#:modules ((srfi srfi-26)
(guix build utils)
(guix build gnu-build-system))
#:phases
,#~(modify-phases %standard-phases
(add-after 'patch-shebangs 'patch-more-shebangs
(lambda* (#:key inputs #:allow-other-keys)
(define path
`(,(dirname (search-input-file inputs "bin/sh"))))
(for-each
(cut patch-shebang <> path)
(find-files (string-append #$output "/etc/avahi")))))))
'())))
(inputs (inputs
`(("dbus" ,dbus) ;; TODO(core-updates): Make this input unconditional.
`(,@(if (%current-target-system)
`(("bash-minimal" ,bash-minimal))
'())
("dbus" ,dbus)
("expat" ,expat) ("expat" ,expat)
("gdbm" ,gdbm) ("gdbm" ,gdbm)
("glib" ,glib) ("glib" ,glib)