+ ,@(if (%current-target-system)
+ `((add-after 'install 'patch-non-shebang-references
+ (lambda* (#:key build inputs outputs #:allow-other-keys)
+ ;; `patch-shebangs' patches shebangs only, and the Perl
+ ;; scripts use a re-exec feature that references the
+ ;; build hosts' perl. Also, AUTOCONF and BASH store
+ ;; references hide in the scripts.
+ (let ((autoconf (assoc-ref inputs "autoconf"))
+ (bash (assoc-ref inputs "bash"))
+ (perl (assoc-ref inputs "perl"))
+ (out (assoc-ref outputs "out"))
+ (store-directory (%store-directory)))
+ (substitute* (find-files (string-append out "/bin"))
+ (((string-append store-directory "/[^/]*-autoconf-[^/]*"))
+ autoconf)
+ (((string-append store-directory "/[^/]*-bash-[^/]*"))
+ bash)
+ (((string-append store-directory "/[^/]*-perl-[^/]*"))
+ perl))
+ #t))))
+ '())
+