Subject: [PATCH core-updates 15/15] gnu: Use 'search-input-directory' and 'search-input-file' where appropriate.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 16 Jul 2021 17:54:20 +0200

This changes some of the remaining uses of this idiom:

  (string-append (assoc-ref inputs "LABEL") "FILE")

to one of:

  (search-input-file inputs "FILE")
  (search-input-directory inputs "FILE")

* gnu/packages/axoloti.scm (axoloti-patcher): Use
'search-input-directory'.
(axoloti-patcher-next): Likewise.
* gnu/packages/bioinformatics.scm (java-picard): Likewise.
* gnu/packages/bootloaders.scm (grub-hybrid): Likewise.
(u-boot-puma-rk3399): Likewise.
(u-boot-rock64-rk3328): Likewise.
(u-boot-firefly-rk3399): Likewise.
(u-boot-rockpro64-rk3399): Likewise.
(u-boot-pinebook-pro-rk3399): Likewise.
* gnu/packages/cran.scm (r-shiny): Likewise.
(r-shinytree): Likewise.
* gnu/packages/education.scm (anki): Likewise.
* gnu/packages/emacs-xyz.scm (emacs-flycheck-grammalecte): Likewise.
(emacs-rime): Likewise.
* gnu/packages/emulators.scm (dolphin-emu): Likewise.
* gnu/packages/games.scm (bsd-games): Likewise.
(seahorse-adventures): Likewise.
(einstein): Likewise.
* gnu/packages/gimp.scm (gimp-fourier): Likewise.
* gnu/packages/gnome.scm (gspell): Likewise.
* gnu/packages/guile-xyz.scm (guile-libyaml): Likewise.
* gnu/packages/java.scm (icedtea-7): Likewise.
* gnu/packages/language.scm (nimf): Likewise.
* gnu/packages/lxde.scm (spacefm): Likewise.
* gnu/packages/mail.scm (claws-mail): Likewise.
* gnu/packages/netpbm.scm (netpbm): Likewise.
* gnu/packages/networking.scm (blueman): Likewise.
* gnu/packages/scheme.scm (scm): Likewise.
* gnu/packages/security-token.scm (python-fido2): Likewise.
* gnu/packages/syndication.scm (rtv): Likewise.
* gnu/packages/tls.scm (acme-client): Likewise.
* gnu/packages/web.scm (netsurf): Likewise.
* gnu/packages/wine.scm (wine-staging): Likewise.
* gnu/packages/wxwidgets.scm (wxwidgets): Likewise.
---
 gnu/packages/axoloti.scm        |  8 ++++----
 gnu/packages/bioinformatics.scm |  5 ++---
 gnu/packages/bootloaders.scm    | 29 +++++++++++------------------
 gnu/packages/cran.scm           | 20 ++++++++++----------
 gnu/packages/education.scm      |  4 ++--
 gnu/packages/emacs-xyz.scm      | 17 ++++++++---------
 gnu/packages/emulators.scm      |  4 ++--
 gnu/packages/games.scm          | 13 ++++++-------
 gnu/packages/gimp.scm           |  6 +++---
 gnu/packages/gnome.scm          |  4 +---
 gnu/packages/guile-xyz.scm      |  4 ++--
 gnu/packages/java.scm           |  4 ++--
 gnu/packages/language.scm       |  3 +--
 gnu/packages/llvm.scm           |  2 +-
 gnu/packages/lxde.scm           |  5 ++---
 gnu/packages/mail.scm           |  6 +++---
 gnu/packages/netpbm.scm         |  5 ++---
 gnu/packages/networking.scm     |  4 ++--
 gnu/packages/python.scm         |  2 +-
 gnu/packages/scheme.scm         |  8 +++-----
 gnu/packages/security-token.scm | 11 ++++++-----
 gnu/packages/syndication.scm    |  5 ++---
 gnu/packages/tls.scm            |  3 +--
 gnu/packages/web.scm            |  4 ++--
 gnu/packages/wine.scm           |  4 ++--
 gnu/packages/wxwidgets.scm      |  3 +--
 26 files changed, 82 insertions(+), 101 deletions(-)

diff --git a/gnu/packages/axoloti.scm b/gnu/packages/axoloti.scm
index c6dd748773..411ebbc610 100644
--- a/gnu/packages/axoloti.scm
+++ b/gnu/packages/axoloti.scm
@@ -318,8 +318,8 @@ runtime.")
                    (lambda ()
                      (let* ((dir       (string-append (assoc-ref outputs "out")
                                                       "/share/axoloti"))
-                            (runtime   (string-append (assoc-ref inputs "axoloti-runtime")
-                                                      "/share/axoloti"))
+                            (runtime   (search-input-directory inputs
+                                                               "share/axoloti"))
                             (toolchain (assoc-ref inputs "cross-toolchain"))
                             (includes  (string-append
                                         toolchain
@@ -530,8 +530,8 @@ patcher application.")))
                ;; Install old firmware
                (let ((target (string-append share "/old_firmware/firmware-1.0.12"))
                      (old-firmware
-                      (string-append (assoc-ref inputs "axoloti-runtime")
-                                     "/share/axoloti/firmware/")))
+                      (search-input-directory inputs
+                                              "share/axoloti/firmware")))
                  (mkdir-p target)
                  (install-file (string-append old-firmware
                                               "flasher/flasher_build/flasher.bin")
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 7a8e5f16c0..206265d9b2 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -4222,9 +4222,8 @@ manipulating HTS data.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "build.xml"
                (("\\$\\{htsjdk\\}/lib")
-                (string-append (assoc-ref inputs "java-htsjdk")
-                               "/share/java/htsjdk/")))
-             #t))
+                (search-input-directory inputs
+                                        "share/java/htsjdk")))))
          (add-after 'unpack 'make-test-target-independent
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "build.xml"
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 19bb6e2508..b7d16c25ac 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -347,8 +347,8 @@ menu to select one of the installed operating systems.")
         `(modify-phases ,phases
            (add-after 'install 'install-non-efi
              (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let ((input-dir (string-append (assoc-ref inputs "grub")
-                                               "/lib/grub"))
+               (let ((input-dir (search-input-directory inputs
+                                                        "/lib/grub"))
                      (output-dir (string-append (assoc-ref outputs "out")
                                                 "/lib/grub")))
                  (for-each
@@ -848,9 +848,8 @@ to Novena upstream, does not load u-boot.img from the first partition.")
            `(modify-phases ,phases
               (add-after 'unpack 'set-environment
                 (lambda* (#:key inputs #:allow-other-keys)
-                  (setenv "BL31" (string-append (assoc-ref inputs "firmware")
-                                                "/bl31.elf"))
-                  #t))
+                  (setenv "BL31"
+                          (search-input-file inputs "/bl31.elf"))))
               ;; Phases do not succeed on the bl31 ELF.
               (delete 'strip)
               (delete 'validate-runpath)))))
@@ -890,10 +889,8 @@ to Novena upstream, does not load u-boot.img from the first partition.")
           `(modify-phases ,phases
              (add-after 'unpack 'set-environment
                (lambda* (#:key inputs #:allow-other-keys)
-                 (let ((bl31 (string-append (assoc-ref inputs "firmware")
-                                            "/bl31.elf")))
-                   (setenv "BL31" bl31))
-                 #t))))))
+                 (let ((bl31 (search-input-file inputs "/bl31.elf")))
+                   (setenv "BL31" bl31))))))))
       (native-inputs
        `(("firmware" ,arm-trusted-firmware-rk3328)
          ,@(package-native-inputs base))))))
@@ -908,9 +905,7 @@ to Novena upstream, does not load u-boot.img from the first partition.")
            `(modify-phases ,phases
               (add-after 'unpack 'set-environment
                 (lambda* (#:key inputs #:allow-other-keys)
-                  (setenv "BL31" (string-append (assoc-ref inputs "firmware")
-                                                "/bl31.elf"))
-                  #t))
+                  (setenv "BL31" (search-input-file inputs "/bl31.elf"))))
               ;; Phases do not succeed on the bl31 ELF.
               (delete 'strip)
               (delete 'validate-runpath)))))
@@ -928,9 +923,8 @@ to Novena upstream, does not load u-boot.img from the first partition.")
            `(modify-phases ,phases
               (add-after 'patch-rockpro64-config 'set-environment
                 (lambda* (#:key inputs #:allow-other-keys)
-                  (setenv "BL31" (string-append (assoc-ref inputs "firmware")
-                                                "/bl31.elf"))
-                  #t))
+                  (setenv "BL31"
+                          (search-input-file inputs "/bl31.elf"))))
               ;; Phases do not succeed on the bl31 ELF.
               (delete 'strip)
               (delete 'validate-runpath)))))
@@ -950,9 +944,8 @@ to Novena upstream, does not load u-boot.img from the first partition.")
            `(modify-phases ,phases
               (add-after 'unpack 'set-environment
                 (lambda* (#:key inputs #:allow-other-keys)
-                  (setenv "BL31" (string-append (assoc-ref inputs "firmware")
-                                                "/bl31.elf"))
-                  #t))
+                  (setenv "BL31"
+                          (search-input-file inputs "/bl31.elf"))))
               ;; Phases do not succeed on the bl31 ELF.
               (delete 'strip)
               (delete 'validate-runpath)))))
diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index 4ac4f0895f..a846c39133 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -1930,17 +1930,17 @@ previewing themes in real time.")
                ;; replace them.
                (with-directory-excursion "inst/www/shared"
                  (replace-file "strftime/strftime-min.js"
-                               (string-append (assoc-ref inputs "js-strftime")
-                                              "/share/javascript/strftime.min.js"))
+                               (search-input-file inputs
+                                                  "/share/javascript/strftime.min.js"))
                  (replace-file "highlight/highlight.pack.js"
-                               (string-append (assoc-ref inputs "js-highlight")
-                                              "/share/javascript/highlight.min.js"))
+                               (search-input-file inputs
+                                                  "/share/javascript/highlight.min.js"))
                  (replace-file "datatables/js/jquery.dataTables.min.js"
-                               (string-append (assoc-ref inputs "js-datatables")
-                                              "/share/javascript/jquery.dataTables.min.js"))
+                               (search-input-file inputs
+                                                  "/share/javascript/jquery.dataTables.min.js"))
                  (replace-file "selectize/js/selectize.min.js"
-                               (string-append (assoc-ref inputs "js-selectize")
-                                              "/share/javascript/selectize.min.js"))
+                               (search-input-file inputs
+                                                  "/share/javascript/selectize.min.js"))
                  (for-each (match-lambda
                              ((source . target)
                               (minify source #:target target)))
@@ -2044,8 +2044,8 @@ responsive, and powerful applications with minimal effort.")
          (add-after 'unpack 'replace-minified-javascript
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "inst/www/jsTree-3.3.7/"
-               (symlink (string-append (assoc-ref inputs "js-requirejs")
-                                       "/share/javascript/require.min.js")
+               (symlink (search-input-file inputs
+                                           "/share/javascript/require.min.js")
                         "libs/require.js")
                (call-with-values
                    (lambda ()
diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index 6001cde9a9..5e709498e8 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -812,8 +812,8 @@ stored and user can review his performance in any time.")
                                     (string-prefix? "python-" label)))
                                  inputs)))
                    (qtwebengineprocess
-                    (string-append (assoc-ref inputs "qtwebengine")
-                                   "/lib/qt5/libexec/QtWebEngineProcess")))
+                    (search-input-file inputs
+                                       "lib/qt5/libexec/QtWebEngineProcess")))
                ;; The program fails to find the QtWebEngineProcess program, so
                ;; we set QTWEBENGINEPROCESS_PATH to help it.  PYTHONPATH is
                ;; wrapped to avoid declaring Python libraries as propagated
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index cc6bcedfb0..e46a7cee4b 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 <[email-masked]>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Alex Kost <[email-masked]>
 ;;; Copyright © 2015 Federico Beffa <[email-masked]>
@@ -5457,11 +5457,11 @@ for Flow files.")
              (make-file-writable "flycheck-grammalecte.el")
              (emacs-substitute-variables "flycheck-grammalecte.el"
                ("flycheck-grammalecte-grammalecte-directory"
-                (string-append (assoc-ref inputs "grammalecte")
-                               "/lib/python"
-                               ,(version-major+minor (package-version python))
-                               "/site-packages/grammalecte")))
-             #t))
+                (search-input-directory
+                 inputs
+                 (string-append "lib/python"
+                                ,(version-major+minor (package-version python))
+                                "/site-packages/grammalecte"))))))
          (add-after 'unpack 'do-not-phone-home
            ;; The package wants to check upstream Grammalecte version to
            ;; decide if an update is in order.  Always return version
@@ -26395,9 +26395,8 @@ REPL appropriate to the current major mode.")
              (make-file-writable "rime.el")
              (emacs-substitute-variables "rime.el"
                ("rime-share-data-dir"
-                (string-append (assoc-ref inputs "rime-data")
-                               "/share/rime-data")))
-             #t))
+                (search-input-directory inputs
+                                        "share/rime-data")))))
          (add-before 'install 'build-emacs-module
            (lambda _
              (invoke "make" "lib"))))))
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 5470c47d1b..5582d77a90 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -216,8 +216,8 @@ SuperCPU.")
            (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let ((fontfile
-                      (string-append (assoc-ref inputs "font-wqy-microhei")
-                                     "/share/fonts/truetype/wqy-microhei.ttc"))
+                      (search-input-file inputs
+                                         "/share/fonts/truetype/wqy-microhei.ttc"))
                      (libvulkan
                       (search-input-file inputs "/lib/libvulkan.so")))
                  (chdir "docs")
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e351783e58..ef93dc8186 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Eric Bavier <[email-masked]>
 ;;; Copyright © 2014 Cyrill Schenkel <[email-masked]>
 ;;; Copyright © 2014 Sylvain Beucler <[email-masked]>
-;;; Copyright © 2014, 2015, 2018, 2019 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2014, 2015, 2018, 2019, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2014, 2015, 2016 Sou Bunnbu <[email-masked]>
 ;;; Copyright © 2014, 2015, 2019 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2015, 2016 Andreas Enge <[email-masked]>
@@ -677,8 +677,7 @@ possible, while battling many vicious aliens.")
                     (bin (string-append out "/bin"))
                     (doc (string-append out "/share/doc/bsd-games-" ,version))
                     (man (string-append out "/share/man"))
-                    (word-list (string-append (assoc-ref inputs "miscfiles")
-                                              "/share/web2"))
+                    (word-list (search-input-file inputs "/share/web2"))
                     (static-data (string-append out "/share/games/bsd-games"))
                     ;; Not a "./" because of substitute* in 'patch-install
                     ;; below.  The .// allow us not to mess with the games'
@@ -2335,8 +2334,8 @@ can be explored and changed freely.")
            (lambda* (#:key outputs inputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (data (string-append out "/share/seahorse-adventures"))
-                    (vera (string-append (assoc-ref inputs "font-bitstream-vera")
-                                         "/share/fonts/truetype/Vera.ttf")))
+                    (vera (search-input-file
+                           inputs "/share/fonts/truetype/Vera.ttf")))
                (let ((themes-dir (string-append data "/data/themes/")))
                  (for-each
                   (lambda (theme)
@@ -4761,8 +4760,8 @@ players.")
           (replace 'configure
           (lambda* (#:key outputs inputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
-                  (dejavu (string-append (assoc-ref inputs "font-dejavu")
-                                         "/share/fonts/truetype/DejaVuSans.ttf")))
+                  (dejavu (search-input-file
+                           inputs "/share/fonts/truetype/DejaVuSans.ttf")))
               (substitute* "Makefile"
                 (("PREFIX=/usr/local") (string-append "PREFIX=" out)))
               ;; The patch above registers a free font for use by the binary,
diff --git a/gnu/packages/gimp.scm b/gnu/packages/gimp.scm
index a0490e5421..81c56946ad 100644
--- a/gnu/packages/gimp.scm
+++ b/gnu/packages/gimp.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2016, 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email-masked]>
@@ -367,8 +367,8 @@ that is extensible via a plugin system.")
          (replace 'configure
            (lambda* (#:key inputs #:allow-other-keys)
              (mkdir-p "tmppkgconfig")
-             (copy-file (string-append (assoc-ref inputs "gegl")
-                                       "/lib/pkgconfig/gegl-0.4.pc")
+             (copy-file (search-input-file inputs
+                                           "/lib/pkgconfig/gegl-0.4.pc")
                         "tmppkgconfig/gegl-0.3.pc")
              (setenv "PKG_CONFIG_PATH"
                      (string-append "tmppkgconfig:"
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 9aec7e052b..c22d7ed2ba 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -10192,9 +10192,7 @@ that support the Assistive Technology Service Provider Interface (AT-SPI).")
              ;; Allow Enchant and its Aspell backend to find the en_US
              ;; dictionary.
              (setenv "ASPELL_DICT_DIR"
-                     (string-append (assoc-ref inputs "aspell-dict-en")
-                                    "/lib/aspell"))
-             #t)))))
+                     (search-input-directory inputs "/lib/aspell")))))))
     (inputs
      `(("gtk+" ,gtk+)
        ("glib" ,glib)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 51fea6c785..1d7227f10f 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4634,8 +4634,8 @@ schedulers.")
                            "yaml/libyaml.scm"
                            ;; This file is mismatched with the generated FFI code.
                            "yaml/ffi-help-rt.scm"))
-               (copy-file (string-append (assoc-ref inputs "nyacc")
-                                         "/share/guile/site/3.0/system/ffi-help-rt.scm")
+               (copy-file (search-input-file
+                           inputs "/share/guile/site/3.0/system/ffi-help-rt.scm")
                           "yaml/ffi-help-rt.scm")
                (substitute* "yaml/ffi-help-rt.scm"
                  (("system ffi-help-rt") "yaml ffi-help-rt"))
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index f4a426e559..6c7e5f9b15 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1569,8 +1569,8 @@ bootstrapping purposes.")
            (add-after 'install 'install-keystore
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((keystore  "cacerts")
-                      (certs-dir (string-append (assoc-ref inputs "nss-certs")
-                                                "/etc/ssl/certs"))
+                      (certs-dir (search-input-directory inputs
+                                                         "etc/ssl/certs"))
                       (keytool   (string-append (assoc-ref outputs "jdk")
                                                 "/bin/keytool")))
                  (define (extract-cert file target)
diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 108aa242f3..b27518a069 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -129,8 +129,7 @@
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (substitute* "configure.ac"
                (("/usr/share/anthy/anthy.dic")
-                (string-append (assoc-ref inputs "anthy")
-                               "/share/anthy/anthy.dic")))
+                (search-input-file inputs "/share/anthy/anthy.dic")))
              (substitute* "configure.ac"
                (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
                 (string-append (assoc-ref inputs "gtk+:bin")
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index f39a3ad49d..4107117c76 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2016, 2018 Eric Bavier <[email-masked]>
 ;;; Copyright © 2015 Mark H Weaver <[email-masked]>
-;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2015, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2016 Dennis Mungai <[email-masked]>
 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2017 Roel Janssen <[email-masked]>
diff --git a/gnu/packages/lxde.scm b/gnu/packages/lxde.scm
index bf32bc0994..7f483cfe1f 100644
--- a/gnu/packages/lxde.scm
+++ b/gnu/packages/lxde.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2017 Brendan Tildesley <[email-masked]>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018 ison <[email-masked]>
-;;; Copyright © 2018, 2019 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2018, 2019, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2019 Meiyo Peng <[email-masked]>
 ;;;
@@ -370,8 +370,7 @@ with freedesktop.org standard.")
                #t)))
          (add-after 'patch-share-dirs 'patch-mime-dirs
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((mime (string-append (assoc-ref inputs "shared-mime-info")
-                                         "/share/mime")))
+             (let* ((mime (search-input-directory inputs "/share/mime")))
                (with-directory-excursion "src"
                  (substitute* '("mime-type/mime-type.c" "ptk/ptk-file-menu.c")
                    (("/usr(/local)?/share/mime") mime)))
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 337111ed40..2e94a7080c 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2014, 2015, 2017, 2020 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2014 Ian Denhardt <[email-masked]>
 ;;; Copyright © 2014 Sou Bunnbu <[email-masked]>
@@ -1629,8 +1629,8 @@ compresses it.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "src/procmime.c"
                (("/usr/share/mime/globs")
-                (string-append (assoc-ref inputs "mime-info")
-                               "/share/mime/globs"))))))))
+                (search-input-directory inputs
+                                        "/share/mime/globs"))))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 11fe135a17..5f3dcdb8ea 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2015 Andreas Enge <[email-masked]>
-;;; Copyright © 2015, 2016 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2015, 2016, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -132,8 +132,7 @@
              (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
              (close-port f))
 
-           (let ((rgb (string-append (assoc-ref inputs "xorg-rgb")
-                                     "/share/X11/rgb.txt")))
+           (let ((rgb (search-input-file inputs "/share/X11/rgb.txt")))
              (substitute* "config.mk"
                (("/usr/share/netpbm/rgb.txt") rgb))
 
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 23c2575d78..1ae7dd5e18 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -656,8 +656,8 @@ systems with no further dependencies.")
              (substitute* '("apps/blueman-report.in" "blueman/main/NetConf.py"
                             "blueman/main/PPPConnection.py")
                (("/usr/sbin/bluetoothd")
-                (string-append (assoc-ref inputs "bluez")
-                               "/libexec/bluetooth/bluetoothd"))
+                (search-input-directory inputs
+                                        "/libexec/bluetooth/bluetoothd"))
                (("/sbin/iptables")
                 (search-input-file inputs "/sbin/iptables"))
                (("/usr/sbin/pppd")
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index a3695ad674..54994f7982 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Nikita Karetnikov <[email-masked]>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <[email-masked]>
 ;;; Copyright © 2014, 2015 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2014, 2017, 2019 Eric Bavier <[email-masked]>
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index f04aeb86a4..3a87dad69f 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email-masked]>
 ;;; Copyright © 2015, 2016 Federico Beffa <[email-masked]>
 ;;; Copyright © 2016 Ricardo Wurmus <[email-masked]>
@@ -621,8 +621,7 @@ utility functions for all standard Scheme implementations.")
          (replace 'build
                   (lambda* (#:key inputs outputs #:allow-other-keys)
                     (setenv "SCHEME_LIBRARY_PATH"
-                            (string-append (assoc-ref inputs "slib")
-                                           "/lib/slib/"))
+                            (search-input-directory inputs "lib/slib"))
                     (invoke "make" "scmlit" "CC=gcc")
                     (invoke "make" "all")))
          (add-after 'install 'post-install
@@ -632,8 +631,7 @@ utility functions for all standard Scheme implementations.")
                         (delete-file req)
                         (format (open req (logior O_WRONLY O_CREAT))
                                 "(define (library-vicinity) ~s)\n"
-                                (string-append (assoc-ref inputs "slib")
-                                               "/lib/slib/"))
+                                (search-input-directory inputs "lib/slib"))
 
                         ;; We must generate the slibcat file.
                         (invoke (string-append out "/bin/scm")
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index a1fc8b5c6f..ae838d4f62 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2014, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2016 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2016 Mike Gerwitz <[email-masked]>
 ;;; Copyright © 2016 Marius Bakke <[email-masked]>
@@ -611,10 +611,11 @@ your existing infrastructure.")
          (add-after 'unpack 'install-public-suffix-list
            (lambda* (#:key inputs #:allow-other-keys)
              (copy-file
-              (string-append (assoc-ref inputs "public-suffix-list")
-                             "/share/public-suffix-list-"
-                             ,(package-version public-suffix-list)
-                             "/public_suffix_list.dat")
+              (search-input-file inputs
+                                 (string-append
+                                  "/share/public-suffix-list-"
+                                  ,(package-version public-suffix-list)
+                                  "/public_suffix_list.dat"))
               "fido2/public_suffix_list.dat")
              #t)))))
     (propagated-inputs
diff --git a/gnu/packages/syndication.scm b/gnu/packages/syndication.scm
index b9ef430744..5ce8f6686a 100644
--- a/gnu/packages/syndication.scm
+++ b/gnu/packages/syndication.scm
@@ -434,9 +434,8 @@ a simple interface that makes it easy to organize and browse feeds.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "HOME" (getcwd))
              (setenv "TERM" "linux")
-             (setenv "TERMINFO" (string-append (assoc-ref inputs "ncurses")
-                                               "/share/terminfo"))
-             #t)))
+             (setenv "TERMINFO"
+                     (search-input-directory inputs "share/terminfo")))))
        #:tests? #f)) ; tests fail: _curses.error: nocbreak() returned ERR
     (propagated-inputs
      `(("python-beautifulsoup4" ,python-beautifulsoup4)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 297e16dd70..59460ada65 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -856,8 +856,7 @@ number generator")
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((pem (string-append (assoc-ref inputs "libressl")
-                                       "/etc/ssl/cert.pem")))
+             (let ((pem (search-input-file inputs "/etc/ssl/cert.pem")))
                (substitute* "http.c"
                  (("/etc/ssl/cert.pem") pem))
                #t)))
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 47f2063a98..9ec3da9cac 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2015 Andreas Enge <[email-masked]>
 ;;; Copyright © 2013 Aljosha Papsch <[email-masked]>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2018 Raoul Jean Pierre Bonnal <[email-masked]>
@@ -5725,7 +5725,7 @@ w3c webidl files and a binding configuration file.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* '("test/bloom.c" "test/hashtable.c")
                (("/usr/share/dict/words")
-                (string-append (assoc-ref inputs "miscfiles") "/share/web2")))
+                (search-input-file inputs "/share/web2")))
              #t))
          (add-after 'install 'install-more
            (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 5c6d02eec5..d05b5c1b8c 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -417,10 +417,10 @@ integrate Windows applications into your desktop.")
                     (let* ((out (assoc-ref outputs "out"))
                            (icd (string-append out "/share/vulkan/icd.d")))
                       (mkdir-p icd)
-                      (copy-file (string-append (assoc-ref inputs "mesa")
+                      (copy-file (search-input-file inputs
                                  "/share/vulkan/icd.d/radeon_icd.i686.json")
                                  (string-append icd "/radeon_icd.i686.json"))
-                      (copy-file (string-append (assoc-ref inputs "mesa")
+                      (copy-file (search-input-file inputs
                                  "/share/vulkan/icd.d/intel_icd.i686.json")
                                  (string-append icd "/intel_icd.i686.json"))
                       (wrap-program (string-append out "/bin/wine-preloader")
diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 83801176b4..f9afa1416d 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -100,8 +100,7 @@
        (modify-phases %standard-phases
          (add-after 'unpack 'refer-to-inputs
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((mime (string-append (assoc-ref inputs "shared-mime-info")
-                                         "/share/mime")))
+             (let* ((mime (search-input-directory inputs "/share/mime")))
                (substitute* "src/unix/utilsx11.cpp"
                  (("wxExecute\\(xdg_open \\+")
                   (string-append "wxExecute(\"" (which "xdg-open") "\"")))
-- 
2.32.0