summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/admin.scm6
-rw-r--r--gnu/packages/audio.scm9
-rw-r--r--gnu/packages/benchmark.scm3
-rw-r--r--gnu/packages/bioinformatics.scm14
-rw-r--r--gnu/packages/boost.scm4
-rw-r--r--gnu/packages/bootloaders.scm13
-rw-r--r--gnu/packages/chemistry.scm3
-rw-r--r--gnu/packages/dictionaries.scm5
-rw-r--r--gnu/packages/dlang.scm2
-rw-r--r--gnu/packages/education.scm3
-rw-r--r--gnu/packages/emacs-xyz.scm59
-rw-r--r--gnu/packages/emulators.scm3
-rw-r--r--gnu/packages/engineering.scm20
-rw-r--r--gnu/packages/entr.scm6
-rw-r--r--gnu/packages/file-systems.scm22
-rw-r--r--gnu/packages/finance.scm3
-rw-r--r--gnu/packages/flashing-tools.scm6
-rw-r--r--gnu/packages/fontutils.scm3
-rw-r--r--gnu/packages/game-development.scm7
-rw-r--r--gnu/packages/games.scm17
-rw-r--r--gnu/packages/geo.scm3
-rw-r--r--gnu/packages/glib.scm10
-rw-r--r--gnu/packages/gnome.scm38
-rw-r--r--gnu/packages/gnupg.scm12
-rw-r--r--gnu/packages/gnuzilla.scm3
-rw-r--r--gnu/packages/golang.scm4
-rw-r--r--gnu/packages/graphviz.scm5
-rw-r--r--gnu/packages/guile-xyz.scm4
-rw-r--r--gnu/packages/haskell-xyz.scm5
-rw-r--r--gnu/packages/ibus.scm9
-rw-r--r--gnu/packages/image.scm6
-rw-r--r--gnu/packages/irc.scm2
-rw-r--r--gnu/packages/java.scm11
-rw-r--r--gnu/packages/julia.scm2
-rw-r--r--gnu/packages/less.scm9
-rw-r--r--gnu/packages/libreoffice.scm7
-rw-r--r--gnu/packages/linux.scm60
-rw-r--r--gnu/packages/lisp-xyz.scm2
-rw-r--r--gnu/packages/lisp.scm11
-rw-r--r--gnu/packages/lua.scm4
-rw-r--r--gnu/packages/lxde.scm4
-rw-r--r--gnu/packages/mail.scm2
-rw-r--r--gnu/packages/maths.scm21
-rw-r--r--gnu/packages/messaging.scm4
-rw-r--r--gnu/packages/music.scm10
-rw-r--r--gnu/packages/netpbm.scm3
-rw-r--r--gnu/packages/networking.scm28
-rw-r--r--gnu/packages/node.scm22
-rw-r--r--gnu/packages/ocaml.scm10
-rw-r--r--gnu/packages/orpheus.scm9
-rw-r--r--gnu/packages/password-utils.scm6
-rw-r--r--gnu/packages/python.scm2
-rw-r--r--gnu/packages/qt.scm4
-rw-r--r--gnu/packages/radio.scm4
-rw-r--r--gnu/packages/ruby.scm8
-rw-r--r--gnu/packages/rust.scm2
-rw-r--r--gnu/packages/screen.scm3
-rw-r--r--gnu/packages/statistics.scm3
-rw-r--r--gnu/packages/suckless.scm4
-rw-r--r--gnu/packages/syndication.scm2
-rw-r--r--gnu/packages/telephony.scm4
-rw-r--r--gnu/packages/terminals.scm2
-rw-r--r--gnu/packages/tex.scm4
-rw-r--r--gnu/packages/uml.scm3
-rw-r--r--gnu/packages/version-control.scm30
-rw-r--r--gnu/packages/video.scm3
-rw-r--r--gnu/packages/vim.scm3
-rw-r--r--gnu/packages/virtualization.scm12
-rw-r--r--gnu/packages/vpn.scm7
-rw-r--r--gnu/packages/wm.scm14
-rw-r--r--gnu/packages/wxwidgets.scm7
-rw-r--r--gnu/packages/xdisorg.scm5
-rw-r--r--gnu/packages/xorg.scm16
73 files changed, 279 insertions, 397 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9d1654ef91..cf37a96b15 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1259,8 +1259,7 @@ connection alive.")
                       (sed       (assoc-ref inputs "sed*")))
                  (substitute* "client/scripts/linux"
                    (("/sbin/ip")
-                    (string-append (assoc-ref inputs "iproute")
-                                   "/sbin/ip")))
+                    (search-input-file inputs "/sbin/ip")))
 
                  (mkdir-p libexec)
                  (copy-file "client/scripts/linux"
@@ -1561,8 +1560,7 @@ at once based on a Perl regular expression.")
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "rc/rc"
                         (("/usr/sbin/sendmail")
-                         (string-append (assoc-ref inputs "mailutils")
-                                        "/bin/mail")))
+                         (search-input-file inputs "/bin/mail")))
                       #t))
                   (add-after 'unpack 'fix-configure
                     (lambda* (#:key inputs native-inputs #:allow-other-keys)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index b740f0ffed..6535c87ea1 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -5223,11 +5223,10 @@ Rate} 3600x2250 bit/s vocoder used in various radio systems.")
        (modify-phases %standard-phases
          (replace 'check
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((python (string-append (assoc-ref inputs "python")
-                                          "/bin/python3"))
-                   (run-tests (string-append "../ableton-link-"
-                                             ,version
-                                             "-checkout/ci/run-tests.py")))
+             (let* ((python (search-input-file inputs "/bin/python3"))
+                    (run-tests (string-append "../ableton-link-"
+                                              ,version
+                                              "-checkout/ci/run-tests.py")))
                (invoke python run-tests "--target" "LinkCoreTest")
                (invoke python run-tests "--target" "LinkDiscoveryTest"))))
          (add-before 'install 'patch-cmake
diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index 78b491d50d..577196e3df 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -69,8 +69,7 @@
           'unpack 'patch-paths
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
-                  (gnuplot (string-append (assoc-ref inputs "gnuplot")
-                                          "/bin/gnuplot")))
+                  (gnuplot (search-input-file inputs "/bin/gnuplot")))
               (substitute* "tools/plot/fio2gnuplot"
                 (("/usr/share/fio") (string-append out "/share/fio"))
                 ;; FIXME (upstream): The 'gnuplot' executable is used inline
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 965dd91853..75668418f0 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -5704,7 +5704,7 @@ partial genes, and identifies translation initiation sites.")
                       (string-append out "/bin/roary-create_pan_genome_plots.R"))
                      (r-site-lib (getenv "R_LIBS_SITE"))
                      (coreutils-path
-                      (string-append (assoc-ref inputs "coreutils") "/bin")))
+                      (dirname (search-input-file inputs "bin/chmod"))))
                  (wrap-program file
                    `("R_LIBS_SITE" ":" prefix
                      (,(string-append r-site-lib ":" out "/site-library/"))))
@@ -12285,17 +12285,13 @@ datasets.")
          (add-after 'install 'link-tools
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
-               (symlink (string-append (assoc-ref inputs "prodigal")
-                                       "/bin/prodigal")
+               (symlink (search-input-file inputs "/bin/prodigal")
                         (string-append bin "ngless-" ,version "-prodigal"))
-               (symlink (string-append (assoc-ref inputs "minimap2")
-                                       "/bin/minimap2")
+               (symlink (search-input-file inputs "/bin/minimap2")
                         (string-append bin "ngless-" ,version "-minimap2"))
-               (symlink (string-append (assoc-ref inputs "samtools")
-                                       "/bin/samtools")
+               (symlink (search-input-file inputs "/bin/samtools")
                         (string-append bin "ngless-" ,version "-samtools"))
-               (symlink (string-append (assoc-ref inputs "bwa")
-                                       "/bin/bwa")
+               (symlink (search-input-file inputs "/bin/bwa")
                         (string-append bin "ngless-" ,version "-bwa"))
                #t))))))
     (inputs
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 8b6bea30c4..538d921c0b 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
@@ -252,7 +252,7 @@ across a broad spectrum of applications.")
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((icu (assoc-ref inputs "icu4c"))
                    (out (assoc-ref outputs "out"))
-                   (sh  (string-append (assoc-ref inputs "bash") "/bin/sh")))
+                   (sh  (search-input-file inputs "/bin/sh")))
                (substitute* '("libs/config/configure"
                               "libs/spirit/classic/phoenix/test/runtest.sh"
                               "tools/build/src/engine/execunix.c"
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 742992a119..61f0c14d9c 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
@@ -139,9 +139,9 @@
                      ;; Give the absolute file name of 'ckbcomp'.
                      (substitute* "util/grub-kbdcomp.in"
                        (("^ckbcomp ")
-                        (string-append (assoc-ref inputs "console-setup")
-                                       "/bin/ckbcomp ")))
-                     #t))
+                        (string-append
+                         (search-input-file inputs "/bin/ckbcomp")
+                         " ")))))
                   (add-after 'unpack 'set-freetype-variables
                     ;; These variables need to be set to the native versions
                     ;; of the dependencies because they are used to build
@@ -315,9 +315,8 @@ menu to select one of the installed operating systems.")
                  (lambda* (#:key inputs #:allow-other-keys)
                    (substitute* "grub-core/osdep/unix/platform.c"
                      (("efibootmgr")
-                      (string-append (assoc-ref inputs "efibootmgr")
-                                     "/sbin/efibootmgr")))
-                   #t))
+                      (search-input-file inputs
+                                         "/sbin/efibootmgr")))))
                (add-after 'patch-stuff 'use-absolute-mtools-path
                  (lambda* (#:key inputs #:allow-other-keys)
                    (let ((mtools (assoc-ref inputs "mtools")))
diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index a52ecf69f7..4b46052f99 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -192,8 +192,7 @@ only with Python 2 and NumPy < 1.9.")
                     (include-dir (string-append out "/include/inchi"))
                     (lib (string-append out "/lib/inchi"))
                     (inchi-doc (assoc-ref inputs "inchi-doc"))
-                    (unzip (string-append (assoc-ref inputs "unzip")
-                                          "/bin/unzip")))
+                    (unzip (search-input-file inputs "/bin/unzip")))
                (chdir "../../..")
                ;; Install binary.
                (with-directory-excursion "INCHI_EXE/bin/Linux"
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 5ca9e128ff..b8bde241f7 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2017, 2018, 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
@@ -178,8 +178,7 @@ work, such as sentence length and other readability measures.")
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((bindir (string-append
                             (assoc-ref %outputs "out") "/bin"))
-                   (wish (string-append (assoc-ref inputs "tk")
-                          "/bin/wish8.6"))
+                   (wish (search-input-file inputs "/bin/wish8.6"))
                    (sharedir (string-append
                               (assoc-ref %outputs "out")
                               "/share/applications"))
diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index c782ef928a..dc22ea2e62 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -261,7 +261,7 @@ bootstrapping more recent compilers written in D.")
              (lambda* (#:key inputs outputs #:allow-other-keys)
                ;; some tests call into gdb binary which needs SHELL and CC set
                (setenv "SHELL" (which "sh"))
-               (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
+               (setenv "CC" (search-input-file inputs "/bin/gcc"))
                (invoke "make" "test" "-j" (number->string (parallel-job-count))))))))
       (native-inputs
        `(("llvm" ,llvm-6)
diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index 02aacf353c..d21c8ea7da 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -513,8 +513,7 @@ specialized device.")
                #t)))
          (add-after 'install 'create-executable
            (lambda* (#:key outputs inputs #:allow-other-keys)
-             (let* ((python (string-append (assoc-ref inputs "python")
-                                           "/bin/python"))
+             (let* ((python (search-input-file inputs "/bin/python"))
                     (out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin"))
                     (executable (string-append bin "/childsplay")))
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index e85b5f40ae..973d944a9c 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
@@ -484,8 +484,7 @@ system.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "hypb.el"
                (("/bin/domainname")
-                (string-append (assoc-ref inputs "inetutils")
-                               "/bin/dnsdomainname")))
+                (search-input-file inputs "bin/dnsdomainname")))
              (substitute* "hyperbole.el"
                (("\\(hyperb:check-dir-user\\)") ""))))
          (add-after 'install 'install-images
@@ -1413,7 +1412,7 @@ replacement.")
                  ((f1 f2 ...) (dirname f1))
                  (_ "")))
 
-             (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
+             (let ((sh (search-input-file inputs "/bin/sh")))
                (define emacs-prefix? (cut string-prefix? "emacs-" <>))
 
                (setenv "SHELL" "sh")
@@ -2568,7 +2567,7 @@ as a library for other Emacs packages.")
            (lambda* (#:key inputs #:allow-other-keys)
              (emacs-substitute-variables "preview.el"
                ("preview-gs-command"
-                (string-append (assoc-ref inputs "ghostscript") "/bin/gs")))
+                (search-input-file inputs "/bin/gs")))
              (substitute* "preview.el"
                (("\"dvipng ")
                 (string-append "\"" (assoc-ref inputs "texlive")
@@ -2932,8 +2931,7 @@ into mode hooks and is intended to be used that way.")
              (chmod "ggtags.el" #o644)
              (emacs-substitute-variables "ggtags.el"
                ("ggtags-executable-directory"
-                (string-append (assoc-ref inputs "global") "/bin")))
-             #t)))))
+                (dirname (search-input-file inputs "bin/global")))))))))
     (home-page "https://github.com/leoliu/ggtags")
     (synopsis "Frontend to the GNU Global source code tagging system")
     (description "@code{ggtags} provides a frontend to the GNU Global source
@@ -3039,7 +3037,7 @@ directly inside Emacs.  It requires a Google Map Static API key to function.")
              (with-directory-excursion "texinfo"
                (substitute* "Makefile"
                  (("\\/usr\\/bin\\/gzip")
-                  (string-append (assoc-ref inputs "gzip") "/bin/gzip")))
+                  (search-input-file inputs "/bin/gzip")))
                (invoke "make"
                        "clean"
                        "info"
@@ -5503,8 +5501,7 @@ for Flow files.")
          (add-after 'unpack 'specify-python-location
            ;; Hard-code python3 executable location in the library.
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((python3 (string-append (assoc-ref inputs "python")
-                                           "/bin/python3")))
+             (let ((python3 (search-input-file inputs "/bin/python3")))
                (substitute* "flycheck-grammalecte.el"
                  (("\"python3") (string-append "\"" python3)))
                (substitute* '("conjugueur.py" "flycheck-grammalecte.py")
@@ -9276,9 +9273,7 @@ queries using counsel.")
                (make-file-writable "counsel-notmuch.el")
                (emacs-substitute-variables "counsel-notmuch.el"
                  ("counsel-notmuch-path"
-                  (string-append (assoc-ref inputs "notmuch")
-                                 "/bin/notmuch")))
-               #t)))))
+                  (search-input-file inputs "/bin/notmuch"))))))))
       (inputs
        `(("emacs-counsel" ,emacs-counsel)
          ("notmuch" ,notmuch)
@@ -12973,8 +12968,7 @@ highlights quasi-quoted expressions.")
                     (bin (string-append out "/bin"))
                     (lisp (string-append out "/share/emacs/site-lisp/emacspeak"))
                     (info (string-append out "/share/info"))
-                    (emacs (string-append (assoc-ref inputs "emacs")
-                                          "/bin/emacs")))
+                    (emacs (search-input-file inputs "/bin/emacs")))
                ;; According to etc/install.org, the Emacspeak directory should
                ;; be copied to its installation destination.
                (for-each
@@ -13700,10 +13694,10 @@ It should enable you to implement low-level X11 applications.")
                    (format #t "#!~a ~@
                      ~a +SI:localuser:$USER ~@
                      exec ~a --exit-with-session ~a \"$@\" --eval '~s' ~%"
-                           (string-append (assoc-ref inputs "bash") "/bin/sh")
-                           (string-append (assoc-ref inputs "xhost") "/bin/xhost")
-                           (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch")
-                           (string-append (assoc-ref inputs "emacs") "/bin/emacs")
+                           (search-input-file inputs "/bin/sh")
+                           (search-input-file inputs "/bin/xhost")
+                           (search-input-file inputs "/bin/dbus-launch")
+                           (search-input-file inputs "/bin/emacs")
                            '(cond
                              ((file-exists-p "~/.exwm")
                               (load-file "~/.exwm"))
@@ -13816,10 +13810,10 @@ other operations.")
                    (format #t "#!~a ~@
                      ~a +SI:localuser:$USER ~@
                      exec ~a --exit-with-session ~a \"$@\" --eval '~s' ~%"
-                           (string-append (assoc-ref inputs "bash") "/bin/sh")
-                           (string-append (assoc-ref inputs "xhost") "/bin/xhost")
-                           (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch")
-                           (string-append (assoc-ref inputs "emacs") "/bin/emacs")
+                           (search-input-file inputs "/bin/sh")
+                           (search-input-file inputs "/bin/xhost")
+                           (search-input-file inputs "/bin/dbus-launch")
+                           (search-input-file inputs "/bin/emacs")
                            '(require 'exwmx-loader))))
                (chmod exwm-executable #o555)
                #t))))))
@@ -23332,7 +23326,7 @@ processes for Emacs")
                (chmod "src/elisp/treemacs-customization.el" #o644)
                (emacs-substitute-variables "src/elisp/treemacs-customization.el"
                  ("treemacs-python-executable"
-                  (string-append (assoc-ref inputs "python") "/bin/python3")))
+                  (search-input-file inputs "/bin/python3")))
                (chmod "src/elisp/treemacs-async.el" #o644)
                (substitute* "src/elisp/treemacs-async.el"
                  (("src/scripts") (string-append "share/" ,name "/scripts"))))
@@ -26285,14 +26279,14 @@ service, and connect it with Emacs via inter-process communication.")
          (add-after 'unpack 'patch-sources
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Hard-code paths to `ffplay` and `ffmpeg`.
-             (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
-                    (ffmpeg-bin (string-append ffmpeg "/bin/ffmpeg"))
-                    (ffplay-bin (string-append ffmpeg "/bin/ffplay")))
+             (let* ((ffplay-bin (search-input-file inputs "/bin/ffplay"))
+                    (ffmpeg-bin (search-input-file inputs "/bin/ffmpeg")))
                (substitute* '("telega-ffplay.el" "telega-vvnote.el")
                  (("(shell-command-to-string\|concat) \"(ffmpeg\|ffprobe)"
                    all func cmd)
-                  (string-append func " \"" (assoc-ref inputs "ffmpeg")
-                                 "/bin/" cmd))
+                  (string-append func " \""
+                                 (search-input-file
+                                  inputs (string-append "/bin/" cmd))))
                  (("\\(executable-find \"ffplay\"\\)")
                   (string-append "(and (file-executable-p \"" ffplay-bin "\")"
                                  "\"" ffplay-bin "\")"))
@@ -26303,8 +26297,7 @@ service, and connect it with Emacs via inter-process communication.")
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (substitute* "telega-server.el"
                (("@TELEGA_SERVER_BIN@")
-                (string-append (assoc-ref inputs "emacs-telega-server")
-                               "/bin/telega-server")))
+                (search-input-file inputs "/bin/telega-server")))
              (substitute* "telega-util.el"
                (("@TELEGA_SHARE@")
                 (string-append (assoc-ref outputs "out")
@@ -27596,9 +27589,7 @@ emoji.")
              (make-file-writable "exiftool.el")
              (emacs-substitute-variables "exiftool.el"
                ("exiftool-executable"
-                (string-append (assoc-ref inputs "perl-image-exiftool")
-                               "/bin/exiftool")))
-             #t)))))
+                (search-input-file inputs "/bin/exiftool"))))))))
     (inputs
      `(("perl-image-exiftool" ,perl-image-exiftool)))
     (home-page "https://git.systemreboot.net/exiftool.el/about/")
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index a5edc918e2..2394342d26 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -615,8 +615,7 @@ and a game metadata scraper.")
                       (bin (string-append out "/bin"))
                       (higan (string-append bin "/higan"))
                       (higan-original (string-append higan "-original"))
-                      (bash (string-append (assoc-ref inputs "bash")
-                                           "/bin/bash"))
+                      (bash (search-input-file inputs "/bin/bash"))
                       (coreutils (assoc-ref inputs "coreutils"))
                       (mkdir (string-append coreutils "/bin/mkdir"))
                       (cp (string-append coreutils "/bin/cp"))
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 4e01bf8b3e..74e95cfc9e 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -1964,19 +1964,14 @@ parallel computing platforms.  It also supports serial execution.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "freehdl/freehdl-config"
                (("pkg-config")
-                (string-append (assoc-ref inputs "pkg-config")
-                               "/bin/pkg-config"))
+                (search-input-file inputs "/bin/pkg-config"))
                (("cat")
-                (string-append (assoc-ref inputs "coreutils")
-                               "/bin/cat")))
-             #t))
+                (search-input-file inputs "/bin/cat")))))
          (add-after 'patch-pkg-config 'setenv
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "CXX" (string-append (assoc-ref inputs "gcc")
-                                          "/bin/g++"))
-             (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
-                                                     "/bin/libtool"))
-             #t))
+             (setenv "CXX" (search-input-file inputs "/bin/g++"))
+             (setenv "SYSTEM_LIBTOOL"
+                     (search-input-file inputs "/bin/libtool"))))
          (add-after 'setenv 'patch-gvhdl
            (lambda _
              (substitute* "v2cc/gvhdl.in"
@@ -1987,7 +1982,7 @@ parallel computing platforms.  It also supports serial execution.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "freehdl/freehdl-gennodes.in"
                (("guile")
-                (string-append (assoc-ref inputs "guile") "/bin/guile"))
+                (search-input-file inputs "/bin/guile"))
                (("\\(debug") ";(debug")
                (("\\(@ ") "(apply-emit")
                (("\\(@@ ") "(apply-mini-format"))
@@ -2066,8 +2061,7 @@ parallel computing platforms.  It also supports serial execution.")
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (mkdir-p "build")
              (chdir "build")
-             (let ((lrelease (string-append (assoc-ref inputs "qttools")
-                                            "/bin/lrelease"))
+             (let ((lrelease (search-input-file inputs "/bin/lrelease"))
                    (out (assoc-ref outputs "out")))
                (invoke "qmake"
                        (string-append "QMAKE_LRELEASE=" lrelease)
diff --git a/gnu/packages/entr.scm b/gnu/packages/entr.scm
index 5ca40690dd..9a7a3daef6 100644
--- a/gnu/packages/entr.scm
+++ b/gnu/packages/entr.scm
@@ -59,11 +59,11 @@
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "entr.c"
                (("/bin/sh" command)
-                (string-append (assoc-ref inputs "bash") command))
+                (search-input-file inputs command))
                (("/bin/cat" command)
-                (string-append (assoc-ref inputs "coreutils") command))
+                (search-input-file inputs command))
                (("/usr(/bin/clear)" _ command)
-                (string-append (assoc-ref inputs "ncurses") command)))
+                (search-input-file inputs command)))
              #t)))))
     (inputs
      `(("bash" ,bash)
diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index b6d0bcbc55..94f3c7e6d7 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -868,7 +868,8 @@ All of this is accomplished without a centralized metadata server.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* (list "eatmydata.in" "eatmydata.sh.in")
                (("basename|readlink|uname" command)
-                (string-append (assoc-ref inputs "coreutils") "/bin/" command)))))
+                (search-input-file inputs
+                                   (string-append "bin/" command))))))
          (add-before 'patch-file-names 'tighten-symlink-mode
            ;; When the ‘eatmydata’ helper detects that it's a symlink, it will
            ;; transparently invoke the command of the same name.  However, it's
@@ -1046,11 +1047,9 @@ APFS.")
                                              (assoc-ref inputs "bash")
                                              match))
                              (("/bin/(rm|true)" match)
-                              (string-append (assoc-ref inputs "coreutils")
-                                             match))
+                              (search-input-file inputs match))
                              (("/usr(/bin/time)" _ match)
-                              (string-append (assoc-ref inputs "time")
-                                             match))))
+                              (search-input-file inputs match))))
                          (append (find-files "common" ".*")
                                  (find-files "tests" ".*")
                                  (find-files "tools" ".*")
@@ -1097,8 +1096,7 @@ APFS.")
                  (with-output-to-file helper
                    (lambda _
                      (format #t "#!~a --no-auto-compile\n!#\n"
-                             (string-append (assoc-ref inputs "guile")
-                                            "/bin/guile"))
+                             (search-input-file inputs "/bin/guile"))
                      (write
                       `(begin
                          (define (try proc dir)
@@ -1407,8 +1405,9 @@ On Guix System, you will need to invoke the included shell scripts as
              (substitute* '("libfuse/lib/mount_util.c"
                             "libfuse/util/mount_util.c")
                (("/bin/(u?)mount" _ maybe-u)
-                (string-append (assoc-ref inputs "util-linux")
-                               "/bin/" maybe-u "mount")))
+                (search-input-file inputs
+                                   (string-append "bin/" maybe-u
+                                                  "mount"))))
              (substitute* '("libfuse/util/mount.mergerfs.c")
                (("/bin/sh" command)
                 (string-append (assoc-ref inputs "bash-minimal") command))))))))
@@ -1461,10 +1460,9 @@ is similar to mhddfs, unionfs, and aufs.")
                   (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
                (substitute* "src/mergerfs.mktrash"
                  (("xattr")
-                  (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
+                  (search-input-file inputs "/bin/xattr"))
                  (("mkdir")
-                  (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
-               #t)))))
+                  (search-input-file inputs "/bin/mkdir"))))))))
       (synopsis "Tools to help manage data in a mergerfs pool")
       (description "mergerfs-tools is a suite of programs that can audit
 permissions and ownership of files and directories on a mergerfs volume,
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index f88b578085..e6c2a42e71 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -823,8 +823,7 @@ the Monero command line client and daemon.")
            ;; The monerod program must be available so that monero-wallet-gui
            ;; can start a Monero daemon if necessary.
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (symlink (string-append (assoc-ref inputs "monero")
-                                     "/bin/monerod")
+             (symlink (search-input-file inputs "/bin/monerod")
                       (string-append (assoc-ref outputs "out")
                                      "/bin/monerod")))))))
     (home-page "https://web.getmonero.org/")
diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index e0a099e966..3961bdf409 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
-;;; Copyright © 2016, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
@@ -83,9 +83,7 @@
              (substitute* "dmi.c"
                (("\"dmidecode\"")
                 (format #f "~S"
-                        (string-append (assoc-ref inputs "dmidecode")
-                                       "/sbin/dmidecode"))))
-             #t)))))
+                        (search-input-file inputs "/sbin/dmidecode")))))))))
     (home-page "https://flashrom.org/")
     (synopsis "Identify, read, write, erase, and verify ROM/flash chips")
     (description
diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index b4ef9f5c24..6ef09455b5 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -696,7 +696,8 @@ definitions.")
         (add-after 'install 'set-library-path
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
-                  (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
+                  (potrace (dirname
+                            (search-input-file inputs "bin/potrace"))))
               (wrap-program (string-append out "/bin/fontforge")
                 ;; Fontforge dynamically opens libraries.
                 `("LD_LIBRARY_PATH" ":" prefix
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 17b52e2694..e7be20d580 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -1203,9 +1203,8 @@ developed mainly for Ren'py.")
          (add-after 'set-paths 'set-build-vars
            (lambda* (#:key inputs native-inputs #:allow-other-keys)
              (setenv "RENPY_CYTHON"
-                     (string-append (assoc-ref (or native-inputs inputs)
-                                               "python2-cython")
-                                    "/bin/cython"))
+                     (search-input-file (or native-inputs inputs)
+                                        "/bin/cython"))
              (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
              #t))
          (replace 'build
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 8362300bef..38b5782547 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -1555,8 +1555,7 @@ shadow mimic them to reach blocks you couldn't reach alone.")
              ;; Look for xdg-open in the store.
              (substitute* "src/core/web.c"
                (("/usr(/bin/xdg-open)" _ bin)
-                (string-append (assoc-ref inputs "xdg-utils") bin)))
-             #t))
+                (search-input-file inputs bin)))))
          (add-after 'unpack 'unbundle-fonts
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Replace bundled Roboto fonts with links to the store.
@@ -3353,7 +3352,8 @@ exec ~a/bin/freedink -refdir ~a/share/dink\n"
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "xboard.conf"
                (("aplay -q")
-                (string-append (assoc-ref inputs "alsa-utils") "/bin/aplay -q")))))
+                (string-append (search-input-file inputs "/bin/aplay")
+                               " -q")))))
          ;; Fixes https://issues.guix.gnu.org/45236.
          (add-after 'unpack 'patch-default-engine
            (lambda* (#:key inputs #:allow-other-keys)
@@ -5848,7 +5848,7 @@ throwing people around in pseudo-randomly generated buildings.")
              (let* ((data (assoc-ref inputs "hyperrogue-data"))
                     (out (assoc-ref outputs "out"))
                     (sounds (string-append out "/share/hyperrogue/sounds"))
-                    (unzip (string-append (assoc-ref inputs "unzip") "/bin/unzip")))
+                    (unzip (search-input-file inputs "/bin/unzip")))
                ;; Extract media license information into sounds directory.
                (invoke unzip "-j" data
                        (string-append
@@ -9045,10 +9045,8 @@ action RPGs.")
            ;; parameters.
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (bash (string-append (assoc-ref inputs "bash")
-                                         "/bin/bash"))
-                    (flare (string-append (assoc-ref inputs "flare-engine")
-                                          "/bin/flare"))
+                    (bash (search-input-file inputs "/bin/bash"))
+                    (flare (search-input-file inputs "/bin/flare"))
                     (script (string-append out "/bin/flare-game")))
                (mkdir-p (dirname script))
                (call-with-output-file script
@@ -11919,8 +11917,7 @@ and chess engines.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "chessx.pro"
                (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
-                (string-append (assoc-ref inputs "qttools") "/bin/lrelease")))
-             #t))
+                (search-input-file inputs "/bin/lrelease")))))
          (add-after 'fix-paths 'make-qt-deterministic
            (lambda _
              (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 61c104fdfb..cb53afdc54 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1964,8 +1964,7 @@ track your position right from your laptop.")
          (modify-phases %standard-phases
            (replace 'configure
              (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let ((shell (string-append (assoc-ref inputs "bash")
-                                           "/bin/bash")))
+               (let ((shell (search-input-file inputs "/bin/bash")))
                  (setenv "SHELL" shell)
                  (setenv "CONFIG_SHELL" shell)
                  (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 6a7e9696b2..ae88dbe9e7 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -246,11 +246,11 @@ shared NFS home directories.")
                             "gobject/glib-genmarshal.in"
                             "gobject/glib-mkenums.in")
                (("@PYTHON@")
-                (string-append (assoc-ref (or native-inputs inputs) "python")
-                               "/bin/python"
-                               ,(version-major+minor
-                                 (package-version python)))))
-             #t))
+                (search-input-file (or native-inputs inputs)
+                                   (string-append
+                                    "/bin/python"
+                                    ,(version-major+minor
+                                      (package-version python))))))))
          (add-before 'check 'pre-check
            (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
              ;; For tests/gdatetime.c.
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 1b35645694..24c5adc44a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1129,15 +1129,10 @@ freedesktop.org desktop notification specification.")
          (add-after 'unpack 'patch
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "util/mm-common-prepare.in"
-              (("ln") (string-append (assoc-ref inputs "coreutils")
-                                     "/bin/ln"))
-              (("cp") (string-append (assoc-ref inputs "coreutils")
-                                     "/bin/cp"))
-              (("sed") (string-append (assoc-ref inputs "sed")
-                                      "/bin/sed"))
-              (("cat") (string-append (assoc-ref inputs "coreutils")
-                                      "/bin/cat")))
-             #t)))))
+               (("ln") (search-input-file inputs "/bin/ln"))
+               (("cp") (search-input-file inputs "/bin/cp"))
+               (("sed") (search-input-file inputs "/bin/sed"))
+               (("cat") (search-input-file inputs "/bin/cat"))))))))
     (native-inputs
      `(("coreutils" ,coreutils)
        ("gettext" ,gettext-minimal)
@@ -7833,10 +7828,8 @@ services.")
        (modify-phases %standard-phases
          (add-after 'configure 'patch-path
            (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
-             (let* ((ovpn (string-append (assoc-ref inputs "openvpn")
-                                         "/sbin/openvpn"))
-                    (modprobe (string-append (assoc-ref inputs "kmod")
-                                             "/bin/modprobe"))
+             (let* ((ovpn (search-input-file inputs "/sbin/openvpn"))
+                    (modprobe (search-input-file inputs "/bin/modprobe"))
                     (pretty-ovpn (string-append "\"" ovpn "\"")))
                (for-each
                 (lambda (file)
@@ -7889,10 +7882,8 @@ to virtual private networks (VPNs) via OpenVPN.")
        (modify-phases %standard-phases
          (add-after 'configure 'patch-path
            (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
-             (let* ((vpnc (string-append (assoc-ref inputs "vpnc")
-                                         "/sbin/vpnc"))
-                    (modprobe (string-append (assoc-ref inputs "kmod")
-                                             "/bin/modprobe"))
+             (let* ((vpnc (search-input-file inputs "/sbin/vpnc"))
+                    (modprobe (search-input-file inputs "/bin/modprobe"))
                     (pretty-ovpn (string-append "\"" vpnc "\"")))
                (substitute* "src/nm-vpnc-service.c"
                     (("\"/usr/local/sbin/vpnc\"") pretty-ovpn)
@@ -7938,10 +7929,9 @@ Compatible with Cisco VPN concentrators configured to use IPsec.")
        (modify-phases %standard-phases
          (add-after 'configure 'patch-path
            (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
-             (let* ((openconnect (string-append (assoc-ref inputs "openconnect")
-                                         "/sbin/openconnect"))
-                    (modprobe (string-append (assoc-ref inputs "kmod")
-                                             "/bin/modprobe"))
+             (let* ((openconnect (search-input-file inputs
+                                                    "/sbin/openconnect"))
+                    (modprobe (search-input-file inputs "/bin/modprobe"))
                     (pretty-ovpn (string-append "\"" openconnect "\"")))
                (substitute* "src/nm-openconnect-service.c"
                  (("\"/usr(/local)?/s?bin/openconnect\"") pretty-ovpn)
@@ -11611,9 +11601,9 @@ GTK+.  It integrates well with the GNOME desktop environment.")
                (wrap-program prog
                  `("PYTHONPATH" = (,(getenv "PYTHONPATH") ,pylib))
                  `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))
-                 `("PATH" prefix (,(string-append (assoc-ref inputs "pandoc")
-                                                  "/bin"))))
-               #t))))))
+                 `("PATH" prefix (,(dirname
+                                    (search-input-file inputs
+                                                       "/bin/pandoc")))))))))))
     (inputs
      `(("glib" ,glib)
        ("gobject-introspection" ,gobject-introspection)
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 10f21f6a6d..4584310e55 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -469,8 +469,10 @@ gpgpme starting with version 1.7.")
                ;; When cross-compiling, the bash script 'libgcrypt-config'
                ;; must be accessible during the configure phase.
                (setenv "PATH"
-                       (string-append (assoc-ref inputs "libgcrypt")
-                                      "/bin:" (getenv "PATH")))))))))
+                       (string-append
+                        (dirname
+                         (search-input-file inputs "bin/libgcrypt-config"))
+                        ":" (getenv "PATH")))))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("autoconf" ,autoconf)
@@ -684,8 +686,7 @@ signing, decryption, verification, and key-listing parsing.")
         (add-before
          'build 'set-gpg-file-name
          (lambda* (#:key inputs outputs #:allow-other-keys)
-           (let* ((gpg (string-append (assoc-ref inputs "gpg")
-                                      "/bin/gpg")))
+           (let* ((gpg (search-input-file inputs "/bin/gpg")))
              (substitute* "libpius/constants.py"
                (("/usr/bin/gpg2") gpg))
              #t))))))
@@ -1213,8 +1214,7 @@ over.")
          (delete 'configure) ; no configure script
          (add-before 'install 'hardlink-gnupg
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gpg (string-append (assoc-ref inputs "gnupg")
-                                       "/bin/gpg")))
+             (let ((gpg (search-input-file inputs "/bin/gpg")))
                (substitute* (find-files "." "jetring-[[:alpha:]]+$")
                  (("gpg -") (string-append gpg " -"))
                  (("\\\"gpg\\\"") (string-append "\"" gpg "\"")))
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 74403751a9..1dc340c082 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -1460,8 +1460,7 @@ standards of the IceCat project.")
                (setenv "CC" "gcc")
                (setenv "MOZ_NOSPAM" "1")
                (setenv "PYTHON"
-                       (string-append (assoc-ref inputs "python2")
-                                      "/bin/python"))
+                       (search-input-file inputs "/bin/python"))
                (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
                (setenv "LDFLAGS" (string-append "-Wl,-rpath="
                                                 (assoc-ref outputs "out")
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 703b5fc57c..d3ef39a2e6 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
 ;;; Copyright © 2016 Andy Wingo <wingo@igalia.com>
-;;; Copyright © 2016, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2017 Petter <petter@mykolab.ch>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Sergei Trofimovich <slyfox@inbox.ru>
@@ -1140,7 +1140,7 @@ your Go binary to be later served from an http.FileSystem.")
            (lambda* (#:key outputs inputs #:allow-other-keys)
              (let* ((output (assoc-ref outputs "out"))
                     (doc_out (assoc-ref outputs "doc"))
-                    (bash (string-append (assoc-ref inputs "bash") "bin/bash"))
+                    (bash (search-input-file inputs "bin/bash"))
                     (docs (string-append doc_out "/share/doc/" ,name "-" ,version))
                     (tests (string-append
                             (assoc-ref outputs "tests") "/share/" ,name "-" ,version)))
diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index 43eaecace4..3bfbcb2250 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -359,8 +359,7 @@ Graphviz and LaTeX.")
                     ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0"
                     ":" (assoc-ref inputs "atk") "/lib/girepository-1.0")))
                `("PATH" ":" prefix
-                 (,(string-append (assoc-ref inputs "graphviz") "/bin"))))
-             #t)))))
+                 (,(dirname (search-input-file inputs "bin/dot"))))))))))
     (inputs
      `(("atk" ,atk)
        ("gdk-pixbuf" ,gdk-pixbuf+svg)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 6c834698b8..78f77d2547 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1126,9 +1126,7 @@ messaging library.")
                         ;; command.
                         (substitute* "src/hmac.scm"
                           (("openssl")
-                           (string-append (assoc-ref inputs "openssl")
-                                          "/bin/openssl")))
-                        #t))
+                           (search-input-file inputs "/bin/openssl")))))
 
                     ;; XXX: The code uses 'include' to include its own source
                     ;; files, and "-L src" isn't enough in this case.
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 7ed0db6c66..2c48ce9586 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2015 Siniša Biđin <sinisa@bidin.eu>
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2015, 2019 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2016, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
 ;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -5895,8 +5895,7 @@ descriptions.")
              (let* ((out   (assoc-ref outputs "out"))
                     (elisp-file "elisp/hindent.el")
                     (dest  (string-append out "/share/emacs/site-lisp"))
-                    (emacs (string-append (assoc-ref inputs "emacs")
-                                          "/bin/emacs")))
+                    (emacs (search-input-file inputs "/bin/emacs")))
                (make-file-writable elisp-file)
                (emacs-substitute-variables elisp-file
                  ("hindent-process-path"
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index cdd4708d22..12e9f3a79f 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -135,11 +135,14 @@
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "src/ibusenginesimple.c"
                (("/usr/share/X11/locale")
-                (string-append (assoc-ref inputs "libx11")
-                               "/share/X11/locale")))
+                (search-input-directory inputs
+                                        "share/X11/locale")))
              (substitute* "ui/gtk3/xkblayout.vala"
                (("\"(setxkbmap|xmodmap)\"" _ prog)
-                (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\"")))))
+                (string-append "\""
+                               (search-input-file inputs
+                                                  (string-append "bin/" prog))
+                               "\"")))))
          (add-before 'check 'pre-check
            (lambda _
              ;; Tests write to $HOME.
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index c55a87ba9f..19bbb2d63d 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2017, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
@@ -2343,9 +2343,7 @@ Wacom-style graphics tablets.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* (list "src/dependency.py" "src/exif.py")
                (("exiftool")
-                (string-append (assoc-ref inputs "perl-image-exiftool")
-                               "/bin/exiftool")))
-             #t))
+                (search-input-file inputs "/bin/exiftool")))))
          (add-before 'install 'check
            (lambda _
              (invoke "pytest")))
diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index e386e54e77..470c7ec8f3 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -119,7 +119,7 @@
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-inxi-reference
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((inxi (string-append (assoc-ref inputs "inxi") "/bin/inxi")))
+             (let ((inxi (search-input-file inputs "/bin/inxi")))
                (symlink inxi "data/scripts/inxi")
                #t))))
        #:tests? #f)) ; no test target
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index f7840f6ca4..fdfd044926 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -198,7 +198,7 @@ and binary format defined in The Java Virtual Machine Specification.")
            (delete 'configure)
            (add-before 'install 'fix-wrapper
              (lambda* (#:key inputs #:allow-other-keys)
-               (let ((jps (string-append (assoc-ref inputs "jdk") "/bin/jps")))
+               (let ((jps (search-input-file inputs "/bin/jps")))
                  (substitute* "bin/drip"
                    (("jps") jps)
                    (("brew update && brew upgrade drip") "guix pull && guix install drip")
@@ -378,11 +378,9 @@ JNI.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
              (setenv "JAVACMD"
-                     (string-append (assoc-ref inputs "jamvm")
-                                    "/bin/jamvm"))
+                     (search-input-file inputs "/bin/jamvm"))
              (setenv "JAVAC"
-                     (string-append (assoc-ref inputs "jikes")
-                                    "/bin/jikes"))
+                     (search-input-file inputs "/bin/jikes"))
              (setenv "CLASSPATH"
                      (string-append (assoc-ref inputs "jamvm")
                                     "/lib/rt.jar"))
@@ -14163,8 +14161,7 @@ can be interpreted by IDEs and static analysis tools to improve code analysis.")
                                             "/dist/" jar-name))
                         (java-cp (string-append share "/" jar-name))
                         (bin (string-append %output "/bin"))
-                        (java (string-append (assoc-ref inputs "jdk")
-                                             "/bin/java")))
+                        (java (search-input-file inputs "/bin/java")))
                    (install-file jar share)
                    (mkdir-p bin)
                    ;; Generate wrapper scripts for bin/, which invoke common
diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index c637c36f61..97218656cc 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -286,7 +286,7 @@ libraries.  It is also a bit like @code{ldd} and @code{otool -L}.")
              ;; call our version
              (substitute* "base/Makefile"
                (("\\$\\$\\(build_depsbindir\\)/libwhich")
-                (string-append (assoc-ref inputs "libwhich") "/bin/libwhich")))
+                (search-input-file inputs "/bin/libwhich")))
              #t))
          (add-before 'check 'set-home
            ;; Some tests require a home directory to be set.
diff --git a/gnu/packages/less.scm b/gnu/packages/less.scm
index 32133943ae..c9b18ea36b 100644
--- a/gnu/packages/less.scm
+++ b/gnu/packages/less.scm
@@ -85,12 +85,11 @@ text editors.")
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "lesspipe.sh"
                         (("tput colors")
-                         (string-append (assoc-ref inputs "ncurses")
-                                        "/bin/tput colors"))
+                         (string-append (search-input-file inputs "/bin/tput")
+                                        " colors"))
                         (("file -")
-                         (string-append (assoc-ref inputs "file")
-                                        "/bin/file -")))
-                      #t)))))
+                         (string-append (search-input-file inputs "/bin/file")
+                                        " -"))))))))
     (inputs
      `(("file" ,file)
        ("ncurses" ,ncurses)))  ; for tput
diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index 0dcdf46ff1..c1e7a58c59 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
-;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017, 2018, 2019 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -1228,10 +1228,7 @@ converting QuarkXPress file format.  It supports versions 3.1 to 4.1.")
              (substitute* '("shell/source/unix/exec/shellexec.cxx"
                             "shell/source/unix/misc/senddoc.sh")
                (("/usr/bin/xdg-open")
-                (string-append (assoc-ref inputs "xdg-utils")
-                               "/bin/xdg-open")))
-
-             #t))
+                (search-input-file inputs "/bin/xdg-open")))))
          (add-after 'install 'reset-zip-timestamps
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ac584787b9..9e3ad367e2 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3143,11 +3143,12 @@ processes currently causing I/O.")
              ;; it refers to the right ones.
              (substitute* '("lib/mount_util.c" "util/mount_util.c")
                (("/bin/(u?)mount" _ maybe-u)
-                (string-append (assoc-ref inputs "util-linux")
-                               "/bin/" maybe-u "mount")))
-             (substitute* "util/mount.fuse.c"
-               (("/bin/sh" command)
-                (string-append (assoc-ref inputs "bash-minimal") command)))
+                (search-input-file inputs
+                                   (string-append "bin/"
+                                                  maybe-u "mount"))))
+             (substitute* '("util/mount.fuse.c")
+               (("/bin/sh")
+                (search-input-file inputs "/bin/sh")))
 
              ;; This hack leads libfuse to search for 'fusermount' in
              ;; $PATH, where it may find a setuid-root binary, instead of
@@ -4234,27 +4235,28 @@ country-specific regulations for the wireless spectrum.")
              (substitute* '("prog/pwm/pwmconfig"
                             "prog/pwm/fancontrol")
                (("gnuplot")
-                (string-append (assoc-ref inputs "gnuplot")
-                               "/bin/gnuplot"))
+                (search-input-file inputs "/bin/gnuplot"))
                (("cat ")
-                (string-append (assoc-ref inputs "coreutils")
-                               "/bin/cat "))
+                (string-append (search-input-file inputs "/bin/cat")
+                               " "))
                (("e?grep " match)
-                (string-append (assoc-ref inputs "grep")
-                               "/bin/" match))
+                (string-append (search-input-file inputs
+                                                  (string-append
+                                                   "/bin/"
+                                                   (string-trim-right match)))
+                               " "))
                (("sed -e")
-                (string-append (assoc-ref inputs "sed")
-                               "/bin/sed -e"))
+                (string-append (search-input-file inputs "/bin/sed")
+                               " -e"))
                (("cut -d")
-                (string-append (assoc-ref inputs "coreutils")
-                               "/bin/cut -d"))
+                (string-append (search-input-file inputs "/bin/cut")
+                               " -d"))
                (("sleep ")
-                (string-append (assoc-ref inputs "coreutils")
-                               "/bin/sleep "))
+                (string-append (search-input-file inputs "/bin/sleep")
+                               " "))
                (("readlink -f")
-                (string-append (assoc-ref inputs "coreutils")
-                               "/bin/readlink -f")))
-             #t)))))
+                (string-append (search-input-file inputs "/bin/readlink")
+                               " -f"))))))))
     (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
     (synopsis "Utilities to read temperature/voltage/fan sensors")
     (description
@@ -5152,7 +5154,7 @@ Bluetooth audio output devices like headphones or loudspeakers.")
                  (("hid2hci --method")
                   (string-append out "/lib/udev/hid2hci --method"))
                  (("/sbin/udevadm")
-                  (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
+                  (search-input-file inputs "/bin/udevadm")))
                #t))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
@@ -7686,15 +7688,11 @@ the superuser to make device nodes.")
           (lambda*  (#:key inputs #:allow-other-keys)
             (substitute* "scripts/fakeroot.in"
              (("getopt")
-              (string-append (assoc-ref inputs "util-linux")
-                             "/bin/getopt"))
+              (search-input-file inputs "/bin/getopt"))
              (("sed")
-              (string-append (assoc-ref inputs "sed")
-                             "/bin/sed"))
+              (search-input-file inputs "/bin/sed"))
              (("cut")
-              (string-append (assoc-ref inputs "coreutils")
-                             "/bin/cut")) )
-            #t))
+              (search-input-file inputs "/bin/cut")) )))
         (add-before 'configure 'setenv
           (lambda _
             (setenv "LIBS" "-lacl")
@@ -7795,10 +7793,8 @@ set as @code{LD_PRELOAD} to override the C library file system functions.")
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inputattach"
-               (invoke (string-append (assoc-ref inputs "gcc")
-                                      "/bin/gcc")
-                       "-O2" "-o" "inputattach" "inputattach.c"))
-             #t))
+               (invoke "gcc" "-O2" "-o" "inputattach"
+                       "inputattach.c"))))
          (delete 'check)
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index dcb520d58a..72afc5cd68 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -15634,7 +15634,7 @@ related C functions to get information about the mounted file system.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/unix/cl-diskspace-list-all-disks-with-df.lisp"
                  (("grep")
-                  (string-append (assoc-ref inputs "grep") "/bin/grep")))
+                  (search-input-file inputs "/bin/grep")))
                (substitute* "src/unix/cl-diskspace-list-all-disks-with-df.lisp"
                  (("/bin/df")
                   (which "df")))
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index be34b6c416..63f5ba744e 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -1106,12 +1106,11 @@ assembler, PEG) is less than 1MB.")
        (modify-phases %standard-phases
          (add-before 'install 'fix-utils-path
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/"))
-                    (cat (string-append coreutils "cat"))
-                    (paste (string-append coreutils "paste"))
-                    (sort (string-append coreutils "sort"))
-                    (basename (string-append coreutils "basename"))
-                    (sed (string-append (assoc-ref inputs "sed") "/bin/sed")))
+             (let* ((cat (search-input-file inputs "/bin/cat"))
+                    (paste (search-input-file inputs "/bin/paste"))
+                    (sort (search-input-file inputs "/bin/sort"))
+                    (basename (search-input-file inputs "/bin/basename"))
+                    (sed (search-input-file inputs "/bin/sed")))
                (substitute* "lisp-repl-core-dumper"
                  (("\\$\\(basename") (string-append "$(" basename))
                  (("\\<cat\\>") cat)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 73dfa0b675..7cadba6392 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -1193,7 +1193,7 @@ enabled.")
          (delete 'configure)
          (add-before 'build 'patch-lua-calls
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((lua (string-append (assoc-ref inputs "lua") "/bin/lua")))
+             (let ((lua (search-input-file inputs "/bin/lua")))
                (setenv "LUA" lua)
                (substitute* "old/launcher.lua"
                  (("/usr/bin/env lua") lua))
@@ -1202,7 +1202,7 @@ enabled.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "fennel"
                (("/usr/bin/env .*lua")
-                (string-append (assoc-ref inputs "lua") "/bin/lua")))
+                (search-input-file inputs "/bin/lua")))
              #t))
          (delete 'check)
          (add-after 'install 'check
diff --git a/gnu/packages/lxde.scm b/gnu/packages/lxde.scm
index f81d7af3c4..bf32bc0994 100644
--- a/gnu/packages/lxde.scm
+++ b/gnu/packages/lxde.scm
@@ -398,9 +398,7 @@ with freedesktop.org standard.")
                 "terminal_su=/run/setuid-programs/su")
                (("#graphical_su=/usr/bin/gksu")
                 (string-append "graphical_su="
-                               (string-append (assoc-ref inputs "ktsuss")
-                                              "/bin/ktsuss"))))
-             #t)))
+                               (search-input-file inputs "/bin/ktsuss")))))))
        #:configure-flags (list
                           (string-append "--with-preferable-sudo="
                                          (assoc-ref %build-inputs "ktsuss")
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a414eb2dda..496c0d6200 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -4120,7 +4120,7 @@ Git and exports them in maildir format or to an MDA through a pipe.")
                     ;; 'git' is invoked in various files of the PublicInbox
                     ;; perl module.
                     `("PATH" ":" prefix
-                      (,(string-append (assoc-ref inputs "git") "/bin")))))
+                      (,(dirname (search-input-file inputs "/bin/git"))))))
                 (find-files (string-append out "/bin"))))
              #t)))))
     (native-inputs
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0bfc6ef8c2..379ec222d2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1390,11 +1390,9 @@ extremely large and complex data collections.")
                               "test/hdf5lib/junit.sh.in"
                               "examples/runExample.sh.in")
                  (("/usr/bin/test")
-                  (string-append (assoc-ref inputs "coreutils")
-                                 "/bin/test"))
+                  (search-input-file inputs "/bin/test"))
                  (("/usr/bin/uname")
-                  (string-append (assoc-ref inputs "coreutils")
-                                 "/bin/uname"))
+                  (search-input-file inputs "/bin/uname"))
                  (("CLASSPATH=[^\n]*")
                   (string-append "CLASSPATH=" class-path)))
                (setenv "CLASSPATH" class-path))
@@ -3630,13 +3628,12 @@ to BMP, JPEG or PNG image formats.")
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
+             (let* ((sed (search-input-file inputs "/bin/sed"))
                     (coreutils (assoc-ref inputs "coreutils"))
                     (dirname (string-append coreutils "/bin/dirname"))
                     (head (string-append coreutils "/bin/head"))
-                    (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
-                    (python (string-append (assoc-ref inputs "python")
-                                           "/bin/python3")))
+                    (perl (search-input-file inputs "/bin/perl"))
+                    (python (search-input-file inputs "/bin/python3")))
                (substitute* "src/maxima.in"
                  (("sed ") (string-append sed " "))
                  (("dirname") dirname)
@@ -3670,8 +3667,7 @@ to BMP, JPEG or PNG image formats.")
              (let* ((gnuplot (assoc-ref inputs "gnuplot"))
                     (out (assoc-ref outputs "out"))
                     (datadir (string-append out "/share/maxima/" ,version))
-                    (binutils (string-append (assoc-ref inputs "binutils")
-                                             "/bin")))
+                    (binutils (dirname (search-input-file inputs "/bin/as"))))
                (with-directory-excursion out
                  (mkdir-p "share/emacs")
                  (mkdir-p "share/doc")
@@ -6438,9 +6434,8 @@ of C, Java, or Ada programs.")
        (modify-phases %standard-phases
          (add-before 'configure 'export-shell
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
-                                                   "/bin/sh"))
-             #t)))))
+             (setenv "CONFIG_SHELL"
+                     (search-input-file inputs "/bin/sh")))))))
     (inputs
      `(("gmp" ,gmp)))
     (propagated-inputs
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 29f9a0d08c..d289dbf170 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -282,9 +282,7 @@ user interfaces in a fast and easy way.  It is based on GLib and ncurses.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "protobufgen.sh"
                (("/bin/sh")
-                (string-append (assoc-ref inputs "bash")
-                               "/bin/sh")))
-             #t)))))
+                (search-input-file inputs "/bin/sh"))))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 7c57b45029..492103b715 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2018 nee <nee.git@hidamari.blue>
 ;;; Copyright © 2018, 2021 Stefan Reichör <stefan@xsteve.at>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2019 Gabriel Hondet <gabrielhondet@gmail.com>
 ;;; Copyright © 2019 Timotej Lazar <timotej.lazar@araneo.si>
@@ -625,7 +625,7 @@ many input formats and provides a customisable Vi-style user interface.")
              ;; Replace hard-coded diff file name.
              (substitute* "tests/integration.c"
                (("/usr/bin/diff")
-                (string-append (assoc-ref inputs "diffutils") "/bin/diff")))
+                (search-input-file inputs "/bin/diff")))
              ;; Denemo's documentation says to use this command to run its
              ;; test suite.
              (invoke "make" "-C" "tests" "check")))
@@ -633,8 +633,7 @@ many input formats and provides a customisable Vi-style user interface.")
            ;; This phase sets the default path for lilypond to its current
            ;; location in the store.
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((lilypond (string-append (assoc-ref inputs "lilypond")
-                                             "/bin/lilypond")))
+             (let* ((lilypond (search-input-file inputs "/bin/lilypond")))
                (substitute* "src/core/prefops.c"
                  (("g_string_new \\(\"lilypond\"\\);")
                   (string-append "g_string_new (\""
@@ -3316,8 +3315,7 @@ socket or command line.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "curseradio/curseradio.py"
                (("/usr/bin/mpv")
-                (string-append (assoc-ref inputs "mpv") "/bin/mpv")))
-             #t)))))
+                (search-input-file inputs "/bin/mpv"))))))))
     (propagated-inputs
      `(("python-lxml" ,python-lxml)
        ("python-requests" ,python-requests)
diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 96025661ca..11fe135a17 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -143,8 +143,7 @@
                (("\"%s/gs\"")
                 "\"%s/gsc\"")
                (("/usr/bin/gs")
-                (string-append (assoc-ref inputs "ghostscript") "/bin/gsc"))))
-           #t))
+                (search-input-file inputs "/bin/gsc"))))))
        (add-before 'check 'setup-check
          (lambda _
            ;; install temporarily into /tmp/netpbm
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index dfa91cd553..64cbec4c08 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016, 2017, 2021 Stefan Reichör <stefan@xsteve.at>
@@ -643,11 +643,12 @@ systems with no further dependencies.")
                               "blueman-manager.in" "blueman-mechanism.in"
                               "blueman-rfcomm-watcher.in" "blueman-sendto.in"
                               "blueman-services.in" "blueman-tray.in")
-                 (("@PYTHON@") (string-append (assoc-ref inputs "python")
-                                              "/bin/python"
-                                              ,(version-major+minor
-                                                (package-version python))))))
-             #t))
+                 (("@PYTHON@")
+                  (search-input-file inputs
+                                     (string-append
+                                      "/bin/python"
+                                      ,(version-major+minor
+                                        (package-version python)))))))))
          ;; Fix loading of external programs.
          (add-after 'unpack 'patch-external-programs
            (lambda* (#:key inputs #:allow-other-keys)
@@ -657,12 +658,9 @@ systems with no further dependencies.")
                 (string-append (assoc-ref inputs "bluez")
                                "/libexec/bluetooth/bluetoothd"))
                (("/sbin/iptables")
-                (string-append (assoc-ref inputs "iptables")
-                               "/sbin/iptables"))
+                (search-input-file inputs "/sbin/iptables"))
                (("/usr/sbin/pppd")
-                (string-append (assoc-ref inputs "ppp")
-                               "/sbin/pppd")))
-             #t))
+                (search-input-file inputs "/sbin/pppd")))))
          ;; Fix loading of pulseaudio libraries.
          (add-after 'unpack 'patch-pulseaudio-libraries
            (lambda* (#:key inputs #:allow-other-keys)
@@ -1740,9 +1738,7 @@ TCP connection, TLS handshake and so on) in the terminal.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "test-suite/testheaders.sh"
                (("/bin/true")
-                (string-append (assoc-ref inputs "coreutils")
-                               "/bin/true")))
-             #t)))))
+                (search-input-file inputs "/bin/true"))))))))
     (inputs
      `(("perl" ,perl)
        ("openldap" ,openldap)
@@ -1837,8 +1833,8 @@ live network and disk I/O bandwidth monitor.")
                       #t))
                   (add-after 'build 'absolutize-tools
                     (lambda* (#:key inputs #:allow-other-keys)
-                      (let ((ethtool (string-append (assoc-ref inputs "ethtool")
-                                                    "/sbin/ethtool")))
+                      (let ((ethtool (search-input-file inputs
+                                                        "/sbin/ethtool")))
                         (substitute* "scripts/airmon-ng"
                           (("ethtool ")
                            (string-append ethtool " ")))
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 36c45e9c7a..6285138e06 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
-;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Mike Gerwitz <mtg@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
@@ -169,10 +169,9 @@
                (format #t "configure flags: ~s~%" flags)
                ;; Node's configure script expects the CC environment variable to
                ;; be set.
-               (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
+               (setenv "CC" (search-input-file inputs "/bin/gcc"))
                (apply invoke
-                      (string-append (assoc-ref inputs "python")
-                                     "/bin/python")
+                      (search-input-file inputs "/bin/python")
                       "configure" flags))))
          (add-after 'patch-shebangs 'patch-npm-shebang
            (lambda* (#:key outputs #:allow-other-keys)
@@ -387,8 +386,7 @@ Node.js and web browsers.")
          (delete 'configure)
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((esbuild (string-append (assoc-ref inputs "esbuild")
-                                           "/bin/esbuild")))
+             (let ((esbuild (search-input-file inputs "/bin/esbuild")))
                (invoke esbuild
                        "--platform=node"
                        "--outfile=lib/builder.js"
@@ -443,8 +441,7 @@ Node.js and web browsers.")
          (delete 'configure)
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((esbuild (string-append (assoc-ref inputs "esbuild")
-                                           "/bin/esbuild")))
+             (let ((esbuild (search-input-file inputs "/bin/esbuild")))
                (invoke esbuild
                        "--platform=node"
                        "--outfile=lib/frontend.js"
@@ -498,8 +495,7 @@ Node.js and web browsers.")
          (delete 'configure)
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((esbuild (string-append (assoc-ref inputs "esbuild")
-                                           "/bin/esbuild")))
+             (let ((esbuild (search-input-file inputs "/bin/esbuild")))
                (invoke esbuild
                        "--platform=node"
                        "--outfile=lib/api.js"
@@ -552,8 +548,7 @@ parser definition into a C output.")
        (modify-phases %standard-phases
          (replace 'configure
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((esbuild (string-append (assoc-ref inputs "esbuild")
-                                           "/bin/esbuild")))
+             (let ((esbuild (search-input-file inputs "/bin/esbuild")))
                (invoke esbuild
                        "--platform=node"
                        "--outfile=bin/generate.js"
@@ -639,8 +634,7 @@ source files.")
                  ;; be set.
                  (setenv "CC" ,(cc-for-target))
                  (apply invoke
-                        (string-append (assoc-ref inputs "python")
-                                       "/bin/python3")
+                        (search-input-file inputs "/bin/python3")
                         "configure" flags))))
            (replace 'patch-files
              (lambda* (#:key inputs #:allow-other-keys)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index fd09459f24..d987201508 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -210,8 +210,7 @@ This package produces a native @command{ocamlc} and a bytecode @command{ocamllex
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-/bin/sh-references
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((sh (string-append (assoc-ref inputs "bash")
-                                       "/bin/sh"))
+             (let* ((sh (search-input-file inputs "/bin/sh"))
                     (quoted-sh (string-append "\"" sh "\"")))
                (with-fluids ((%default-port-encoding #f))
                  (for-each
@@ -805,8 +804,7 @@ the opam file format.")
                  (add-before 'build 'pre-build
                    (lambda* (#:key inputs make-flags #:allow-other-keys)
                      (let ((bash (assoc-ref inputs "bash"))
-                           (bwrap (string-append (assoc-ref inputs "bubblewrap")
-                                                 "/bin/bwrap")))
+                           (bwrap (search-input-file inputs "/bin/bwrap")))
                        (substitute* "src/core/opamSystem.ml"
                          (("\"/bin/sh\"")
                           (string-append "\"" bash "/bin/sh\""))
@@ -3674,8 +3672,8 @@ and 4 (random based) according to RFC 4122.")
        (modify-phases %standard-phases
          (add-before 'configure 'set-shell
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
-                                                   "/bin/sh")))))))
+             (setenv "CONFIG_SHELL"
+                     (search-input-file inputs "/bin/sh")))))))
     (inputs `(("lablgtk" ,lablgtk)))
     (properties `((upstream-name . "ocamlgraph")))
     (home-page "http://ocamlgraph.lri.fr/")
diff --git a/gnu/packages/orpheus.scm b/gnu/packages/orpheus.scm
index d981be279c..8214311a18 100644
--- a/gnu/packages/orpheus.scm
+++ b/gnu/packages/orpheus.scm
@@ -76,12 +76,9 @@
              ;; To avoid propagating the mpg321 and vorbis-tools inputs, we can
              ;; make the orpheus application execute the needed players from the
              ;; store.
-             (let ((ogg123 (string-append (assoc-ref inputs "vorbis-tools")
-                                          "/bin/ogg123"))
-                   (mpg321 (string-append (assoc-ref inputs "mpg321")
-                                          "/bin/mpg321"))
-                   (which  (string-append (assoc-ref inputs "which")
-                                          "/bin/which")))
+             (let ((ogg123 (search-input-file inputs "/bin/ogg123"))
+                   (mpg321 (search-input-file inputs "/bin/mpg321"))
+                   (which  (search-input-file inputs "/bin/which")))
                (substitute* "src/orpheusconf.cc"
                  (("ogg123") ogg123)
                  (("which")  which)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 7da8b23fe1..504a908100 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -523,11 +523,11 @@ any X11 window.")
              (substitute* "contrib/dmenu/passmenu"
                (("dmenu=dmenu\n")
                 (string-append "dmenu="
-                               (assoc-ref inputs "dmenu") "/bin/dmenu\n"))
+                               (search-input-file inputs "/bin/dmenu")
+                               "\n"))
                (("xdotool=\"xdotool")
                 (string-append "xdotool=\""
-                               (assoc-ref inputs "xdotool") "/bin/xdotool")))
-             #t))
+                               (search-input-file inputs "/bin/xdotool"))))))
          (add-after 'install 'install-passmenu
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index f4d574e2b2..aa6b29df26 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -822,7 +822,7 @@ ease from the desktop to a microcontroller or embedded system.")
                       (substitute* '("lib-python/3/subprocess.py")
                         ;; Fix shell path
                         (("/bin/sh")
-                         (string-append (assoc-ref inputs "bash-minimal") "/bin/sh")))
+                         (search-input-file inputs "/bin/sh")))
                       (substitute* '("lib-python/3/distutils/unixccompiler.py")
                         ;; gcc-toolchain does not provide symlink cc -> gcc
                         (("\"cc\"") "\"gcc\""))
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 95618a9787..f80ea336d8 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -168,9 +168,7 @@
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "qt5ct.pro"
                (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
-                (string-append (assoc-ref inputs "qttools")
-                               "/bin/lrelease")))
-             #t))
+                (search-input-file inputs "/bin/lrelease")))))
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out")))
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 443b115d46..d8f4161eb7 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -723,9 +723,7 @@ to access different radio hardware.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "git-version-gen"
                (("/bin/sh")
-                (string-append (assoc-ref inputs "bash")
-                               "/bin/bash")))
-             #t)))))
+                (search-input-file inputs "/bin/bash"))))))))
     (synopsis "DSP primitives for SDR")
     (description
      "This a C-language library for common DSP (Digital Signal Processing)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index cfc91f73af..2fe60c4fa2 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015 Pjotr Prins <pjotr.guix@thebird.nl>
-;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -1175,8 +1175,7 @@ structure.  Supports custom object formatting via plugins.")
              #t))
          (add-after 'unpack 'patch-pandoc-path
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((pandoc (string-append (assoc-ref inputs "pandoc")
-                                          "/bin/pandoc")))
+             (let ((pandoc (search-input-file inputs "/bin/pandoc")))
                (substitute* "lib/pandoc-ruby.rb"
                  (("@@pandoc_path = 'pandoc'")
                   (format #f "@@pandoc_path = '~a'" pandoc)))
@@ -4850,8 +4849,7 @@ you to merge elements inside a hash together recursively.")
                     (lambda* (#:key inputs outputs #:allow-other-keys)
                       ;; Make the default git binary an absolute path to the
                       ;; store.
-                      (let ((git    (string-append (assoc-ref inputs "git")
-                                                   "/bin/git"))
+                      (let ((git    (search-input-file inputs "/bin/git"))
                             (config (string-append
                                      (assoc-ref outputs "out")
                                      "/lib/ruby/vendor_ruby/gems/git-"
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 0e0c33068f..fd6233fc94 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -325,7 +325,7 @@ safety and thread safety guarantees.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "SHELL" (which "sh"))
              (setenv "CONFIG_SHELL" (which "sh"))
-             (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
+             (setenv "CC" (search-input-file inputs "/bin/gcc"))
              ;; The Guix LLVM package installs only shared libraries.
              (setenv "LLVM_LINK_SHARED" "1")))
          (add-after 'unpack 'neuter-tidy
diff --git a/gnu/packages/screen.scm b/gnu/packages/screen.scm
index af40bd73f9..502e8f11af 100644
--- a/gnu/packages/screen.scm
+++ b/gnu/packages/screen.scm
@@ -132,8 +132,7 @@ controlling terminal and attach to it later.")
          (add-after
           'install 'wrap-python-scripts
           (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let* ((python (string-append (assoc-ref inputs "python")
-                                          "/bin/python"))
+            (let* ((python (search-input-file inputs "/bin/python"))
                    (out    (assoc-ref outputs "out"))
                    (config (string-append out "/bin/byobu-config"))
                    (select (string-append out "/bin/byobu-select-session")))
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index e03761f87f..bdc72d218b 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -216,8 +216,7 @@ This package also provides @command{xls2csv} to export Excel files to CSV.")
              #t))
          (add-before 'configure 'patch-uname
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((uname-bin (string-append (assoc-ref inputs "coreutils")
-                                             "/bin/uname")))
+             (let ((uname-bin (search-input-file inputs "/bin/uname")))
                (substitute* "src/scripts/R.sh.in"
                  (("uname") uname-bin)))
              #t))
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 65f4fa85a9..0f0491b39b 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -353,8 +353,8 @@ drawing.")
          (add-before 'build 'set-dmenu-and-xprop-file-name
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "config.def.h"
-               (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu"))
-               (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop")))
+               (("dmenu") (search-input-file inputs "/bin/dmenu"))
+               (("xprop") (search-input-file inputs "/bin/xprop")))
              #t)))))
     (inputs
      `(("dmenu" ,dmenu)
diff --git a/gnu/packages/syndication.scm b/gnu/packages/syndication.scm
index cda7569dfa..58db738130 100644
--- a/gnu/packages/syndication.scm
+++ b/gnu/packages/syndication.scm
@@ -599,7 +599,7 @@ that aims to be quite fast and comfortable to its user.")
          (add-after 'unpack 'patch-mpv-path
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "gfeeds/confManager.py"
-               (("mpv") (string-append (assoc-ref inputs "mpv") "/bin/mpv")))
+               (("mpv") (search-input-file inputs "/bin/mpv")))
              #t))
          (add-after 'install 'wrap-gfeeds
            (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 37ff103c42..9924031993 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -556,8 +556,8 @@ address of one of the participants.")
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease"
                      (string-append "MUMBLE_PYTHON="
-                                    (string-append (assoc-ref inputs "python")
-                                                   "/bin/python3"))
+                                    (search-input-file inputs
+                                                       "/bin/python3"))
                      (string-append "CONFIG+="
                                     (string-join
                                      ;; Options used are listed in the same order
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 735373dfa7..496b725543 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -1350,7 +1350,7 @@ basic input/output.")
                     (bin   (string-append out "/bin"))
                     (share (string-append out "/share"))
                     (icons (string-append share "/icons/hicolor/scalable/apps"))
-                    (tic   (string-append (assoc-ref inputs "ncurses") "/bin/tic"))
+                    (tic   (search-input-file inputs "/bin/tic"))
                     (man   (string-append share "/man/man1"))
                     (alacritty-bin "target/release/alacritty"))
                ;; Install the executable.
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 681a1aa972..33d9064c80 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -466,8 +466,8 @@ files from LOCATIONS with expected checksum HASH.  CODE is not currently in use.
                                              (cut member <> '("." ".."))))))
                     (tlpkg-src (string-append tl-extra-root "/" tl-extra-dir
                                               "/tlpkg"))
-                    (config.guess (string-append (assoc-ref inputs "config")
-                                                 "/bin/config.guess")))
+                    (config.guess (search-input-file inputs
+                                                     "/bin/config.guess")))
 
                ;; Create symbolic links for the latex variants and their
                ;; man pages.
diff --git a/gnu/packages/uml.scm b/gnu/packages/uml.scm
index ad766beece..83f10a08a1 100644
--- a/gnu/packages/uml.scm
+++ b/gnu/packages/uml.scm
@@ -54,8 +54,7 @@
              #t))
          (add-after 'delete-extra-from-classpath 'patch-usr-bin-dot
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((dot (string-append (assoc-ref inputs "graphviz")
-                                       "/bin/dot")))
+             (let ((dot (search-input-file inputs "/bin/dot")))
                (substitute*
                    "src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java"
                  (("/usr/bin/dot") dot)))
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 3691336d3f..8bdac8df53 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
@@ -1035,9 +1035,8 @@ a built-in cache to decrease server I/O pressure.")
                                (assoc-ref inputs "git") "/bin/git"
                                "'"))
                (("/usr/sbin/sendmail")
-                (string-append (assoc-ref inputs "sendmail")
-                               "/usr/sbin/sendmail")))
-             #t)))))
+                (search-input-file inputs
+                                   "/usr/sbin/sendmail"))))))))
     (inputs
      `(("git" ,git)
        ("sendmail" ,sendmail)))
@@ -1424,8 +1423,7 @@ also walk each side of a merge and test those changes individually.")
                   (delete 'build)
                   (add-before 'install 'patch-scripts
                     (lambda* (#:key inputs #:allow-other-keys)
-                      (let ((perl (string-append (assoc-ref inputs "perl")
-                                                 "/bin/perl")))
+                      (let ((perl (search-input-file inputs "/bin/perl")))
                         ;; This seems to take care of every shell script that
                         ;; invokes Perl.
                         (substitute* (find-files "." ".*")
@@ -1462,8 +1460,7 @@ also walk each side of a merge and test those changes individually.")
                       (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm"
                                      "src/lib/Gitolite/Hooks/Update.pm")
                         (("/usr/bin/perl")
-                         (string-append (assoc-ref inputs "perl")
-                                        "/bin/perl")))
+                         (search-input-file inputs "/bin/perl")))
 
                       (substitute* "src/lib/Gitolite/Common.pm"
                         (("\"ssh-keygen")
@@ -1759,10 +1756,8 @@ history.  It implements the changeset evolution concept for Mercurial.")
          (modify-phases %standard-phases
            (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gpg (string-append (assoc-ref inputs "gnupg")
-                                       "/bin/gpg"))
-                   (openssl (string-append (assoc-ref inputs "openssl")
-                                           "/bin/openssl")))
+             (let ((gpg (search-input-file inputs "/bin/gpg"))
+                   (openssl (search-input-file inputs "/bin/openssl")))
                (substitute* "commitsigs.py"
                  (("b'gpg',") (string-append "b'" gpg "',"))
                  (("b'openssl',") (string-append "b'" openssl "',")))))))
@@ -2707,8 +2702,7 @@ directory full of HOWTOs.")
                #t))
            (add-before 'install 'patch-git
              (lambda* (#:key inputs #:allow-other-keys)
-               (let ((git (string-append (assoc-ref inputs "git")
-                                         "/bin/git")))
+               (let ((git (search-input-file inputs "/bin/git")))
                  (substitute* "bin/git-when-merged"
                    (("'git'") (string-append "'" git "'")))
                  #t)))
@@ -2752,8 +2746,7 @@ how information about the merge is displayed.")
          (delete 'configure)
          (add-before 'install 'patch-git
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((git (string-append (assoc-ref inputs "git")
-                                       "/bin/git")))
+             (let ((git (search-input-file inputs "/bin/git")))
                (substitute* "git-imerge"
                  (("'git'") (string-append "'" git "'")))
                #t)))
@@ -3045,11 +3038,10 @@ defects faster.")
                (substitute* "tests/test_main.py"
                  (("'gita\\\\n'") "'source\\n'")
                  (("'gita'") "'source'"))
-               (invoke (string-append (assoc-ref inputs "git") "/bin/git")
+               (invoke (search-input-file inputs "/bin/git")
                        "init")
                (add-installed-pythonpath inputs outputs)
-               (invoke (string-append (assoc-ref inputs "python-pytest")
-                                      "/bin/pytest")
+               (invoke (search-input-file inputs "/bin/pytest")
                        "-vv" "tests")))
            (add-after 'install 'install-shell-completions
              (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index b2bb7b8d3b..12b98fe9a1 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2435,8 +2435,7 @@ other site that youtube-dl supports.")
            ;; Explicitly invoke the input ffmpeg, instead of whichever one
            ;; happens to be in the user's $PATH at run time.
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((ffmpeg (string-append (assoc-ref inputs "ffmpeg")
-                                          "/bin/ffmpeg")))
+             (let ((ffmpeg (search-input-file inputs "/bin/ffmpeg")))
                (substitute* "src/you_get/processor/ffmpeg.py"
                  ;; Don't blindly replace all occurrences of ‘'ffmpeg'’: the
                  ;; same string is also used when sniffing ffmpeg's output.
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 609349cd8f..e14c5aadca 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -771,8 +771,7 @@ refactor Vim in order to:
        (modify-phases %standard-phases
          (add-after 'configure 'reference-nvim
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((nvim (string-append (assoc-ref inputs "neovim")
-                                        "/bin/nvim")))
+             (let ((nvim (search-input-file inputs "/bin/nvim")))
                ;; This substitution should change one line, and replaces the default
                ;; value in the struct of options with an absolute store reference.
                (substitute* "../source/src/main.c"
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index c3459ebb15..b223016d17 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
@@ -247,7 +247,7 @@
          ;; Configure, build and install QEMU user-emulation static binaries.
          (add-after 'configure 'configure-user-static
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((gcc (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
+             (let* ((gcc (search-input-file inputs "/bin/gcc"))
                     (static (assoc-ref outputs "static"))
                     ;; This is the common set of configure flags; it is
                     ;; duplicated here to isolate this phase from manipulations
@@ -1239,8 +1239,8 @@ virtualization library.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Xen is not available for now - so only patch qemu.
              (substitute* "virtManager/createconn.py"
-               (("/usr(/bin/qemu-system)" _ suffix)
-                (string-append (assoc-ref inputs "qemu") suffix)))
+               (("/usr(/bin/qemu-system-[a-zA-Z0-9_-]+)" _ suffix)
+                (search-input-file inputs suffix)))
              #t))
          (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -1371,9 +1371,7 @@ domains, their live performance and resource utilization statistics.")
                (("\\$\\(PYTHON\\)") "python2"))
              (substitute* "lib/Makefile"
                (("\\$\\(PYTHON\\)")
-                (string-append (assoc-ref inputs "python")
-                               "/bin/python")))
-             #t))
+                (search-input-file inputs "/bin/python")))))
          (add-before 'build 'fix-symlink
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The file 'images/google/protobuf/descriptor.proto' points to
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index f3db1c198f..852d0038c7 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2013, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
 ;;; Copyright © 2016, 2017, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -323,7 +323,7 @@ endpoints.")
                                "/bin/" command)))
              (substitute* "src/libstrongswan/utils/process.c"
                (("/bin/sh")
-                (string-append (assoc-ref inputs "bash") "/bin/sh")))
+                (search-input-file inputs "/bin/sh")))
 
              (substitute* "src/libstrongswan/tests/suites/test_process.c"
                (("/bin/sh") (which "sh"))
@@ -1115,8 +1115,7 @@ public keys and can roam across IP addresses.")
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "l2tp.h"
                         (("/usr/sbin/pppd")
-                         (string-append (assoc-ref inputs "ppp")
-                                        "/sbin/pppd")))
+                         (search-input-file inputs "/sbin/pppd")))
                       (setenv "KERNELSRC"
                               (assoc-ref inputs "linux-libre-headers"))
                       #t)))
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 51034cac4b..66440e5008 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -8,7 +8,7 @@
 ;;; Copyright © 2016, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
 ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
-;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2020 Nikita <nikita@n0.is>
 ;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
 ;;; Copyright © 2016 Ivan Vilata i Balaguer <ivan@selidor.net>
@@ -613,14 +613,10 @@ Features include:
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (icons (string-append out "/share/i3lock-fancy/icons/"))
-                    (wmctrl (string-append (assoc-ref inputs "wmctrl")
-                                           "/bin/wmctrl"))
-                    (mconvert (string-append (assoc-ref inputs "imagemagick")
-                                             "/bin/convert"))
-                    (mimport (string-append (assoc-ref inputs "imagemagick")
-                                            "/bin/import"))
-                    (awk (string-append (assoc-ref inputs "gawk")
-                                        "/bin/gawk")))
+                    (wmctrl (search-input-file inputs "/bin/wmctrl"))
+                    (mconvert (search-input-file inputs "/bin/convert"))
+                    (mimport (search-input-file inputs "/bin/import"))
+                    (awk (search-input-file inputs "/bin/gawk")))
 
                (substitute* "lock"
                  (("\\$\\(command -V wmctrl\\)") wmctrl)
diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 54d385fd53..15a995462a 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -216,7 +216,7 @@ and many other languages.")
              (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
              ;; Copy the waf executable to the source directory since it needs
              ;; to be in a writable directory.
-             (copy-file (string-append (assoc-ref inputs "python-waf") "/bin/waf")
+             (copy-file (search-input-file inputs "/bin/waf")
                         "bin/waf")
              (setenv "WAF" "bin/waf")
              ;; The build script tries to copy license files from the
@@ -306,8 +306,9 @@ provide a 100% native look and feel for the application.")
              (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
              (use-modules (ice-9 popen) (ice-9 rdelim))
              (let ((port (open-pipe* OPEN_READ
-                                     (string-append (assoc-ref inputs "wxwidgets")
-                                                    "/bin/wx-config") "--cppflags")))
+                                     (search-input-file inputs
+                                                        "/bin/wx-config")
+                                     "--cppflags")))
                (setenv "CPPFLAGS" (read-string port))
                (close-pipe port))
              #t)))))
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 11e815bd72..d13392ae77 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2014, 2015, 2016 Alex Kost <alezost@gmail.com>
-;;; Copyright © 2013, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2015 Alexander I.Grafov <grafov@gmail.com>
 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
@@ -231,8 +231,7 @@ program.")
        (modify-phases %standard-phases
          (add-before 'build 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((xrandr (string-append (assoc-ref inputs "xrandr")
-                                          "/bin/xrandr")))
+             (let ((xrandr (search-input-file inputs "/bin/xrandr")))
                (substitute* "contrib/etc/xdg/autostart/autorandr.desktop"
                  (("/usr") (assoc-ref outputs "out")))
                (substitute* "autorandr.py"
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 9978480e4b..8d6dc21c4f 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2015, 2017, 2018, 2020 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2015 Cyrill Schenkel <cyrill.schenkel@gmail.com>
@@ -2289,8 +2289,7 @@ X server: @code{handhelds}, @code{redglass} and @code{whiteglass}.")
            (delete 'configure)
            (add-before 'build 'set-inkscape-environment-variable
              (lambda* (#:key inputs #:allow-other-keys)
-               (let ((inkscape (string-append (assoc-ref inputs "inkscape")
-                                              "/bin/inkscape")))
+               (let ((inkscape (search-input-file inputs "/bin/inkscape")))
                  (setenv "INKSCAPE" inkscape)
                  #t)))
            (add-before 'build 'placate-inkscape-warnings
@@ -3593,8 +3592,7 @@ X server.")
                (format #t "decompressing x86emu source code~%")
                (with-directory-excursion "libs"
                  (let ((srcs (assoc-ref inputs "xorg-server-sources"))
-                       (tar-binary (string-append (assoc-ref inputs "tar")
-                                                  "/bin/tar")))
+                       (tar-binary (search-input-file inputs "/bin/tar")))
                    (invoke tar-binary "xvf" srcs "--strip-components=3"
                            "--wildcards" "*/hw/xfree86/x86emu/")
                    ;; extract license:
@@ -4991,9 +4989,8 @@ protocol and arbitrary X extension protocol.")
              (wrap-program (string-append (assoc-ref outputs "out")
                                           "/bin/mkfontdir")
                `("PATH" ":" prefix
-                 (,(string-append (assoc-ref inputs "mkfontscale")
-                                  "/bin"))))
-             #t)))))
+                 (,(dirname
+                    (search-input-file inputs "/bin/mkfontscale"))))))))))
     (inputs
       `(("mkfontscale" ,mkfontscale)))
     (native-inputs
@@ -6430,7 +6427,8 @@ basic eye-candy effects.")
                ;; The trailing -- is intentional, so we only replace it inside
                ;; a command line.
                (("dbus-launch --")
-                (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch --")))
+                (string-append (search-input-file inputs "/bin/dbus-launch")
+                               " --")))
              ;; /run/user does not exist on guix system
              (substitute* "./xpra/scripts/config.py"
                (("socket-dir.*: \"\",")