unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
@ 2021-07-16 15:50 Ludovic Courtès
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:50 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

Hello Guix!

This series of patches updates the style of package definitions.
The first one uses gexps and ‘local-file’ in (gnu packages base).

The rest is about removing reliance on input labels in build-side
code, primarily by changing:

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

to one of:

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

This change will help if we eventually remove input labels entirely
from the API (remember that input labels are now unnecessary in
package definitions but they’re still returned by ‘package-inputs’
and similar procedures).

The idea is that code should not rely on package names when looking
for files as this would prevent things such as
‘--with-inputs=openmpi=mpich’ since the label in the original package
would be “openmpi” whereas it’d be “mpich” in the transformed package.
In this case (a kind of “virtual dependencies”), a better idiom is:

  (search-input-file inputs "lib/libmpi.so")

as this explicitly accommodates any implementation of that library.

I initially made the ‘search-input-file’ changes by grepping for
“(string-append (search-input inputs”, replacing everything in wgrep
mode.  I then reviewed changes one by one (though without rebuilding
everything) and committed them in chunks of similar changes for
easier review/bisecting.

I’d like to push this to core-updates soonish.

Feedback welcome!

Ludo’.

Ludovic Courtès (15):
  gnu: commencement: Use gexps and 'local-file' to refer to patches.
  gnu: tzdata: Remove input labels.
  gnu: Simplify "Xvbf" invocation in pre-check phases.
  gnu: Use 'search-input-directory' when looking for tzdata.
  gnu: Use 'search-input-directory' for the SDL header directory.
  gnu: Use 'search-input-directory' for the OpenEXR header directory.
  gnu: Use 'search-input-file' when searching for Automake files.
  gnu: Use 'search-input-directory' for the Eigen header directory.
  gnu: Use 'search-input-directory' for glibc locale data.
  gnu: Use 'search-input-directory' when looking for C/C++ library
    headers.
  gnu: Use 'search-input-file' when looking for *.so and *.a.
  gnu: Use 'search-input-file' when looking for executables.
  gnu: mozjs: Use 'which' where appropriate.
  gnu: Use 'search-input-file' when looking for .jar files.
  gnu: Use 'search-input-directory' and 'search-input-file' where
    appropriate.

 gnu/packages/admin.scm              |   6 +-
 gnu/packages/arcan.scm              |   6 +-
 gnu/packages/audio.scm              |  15 +-
 gnu/packages/axoloti.scm            |   8 +-
 gnu/packages/backup.scm             |   3 +-
 gnu/packages/base.scm               | 128 ++--
 gnu/packages/benchmark.scm          |   3 +-
 gnu/packages/bioinformatics.scm     |  79 ++-
 gnu/packages/boost.scm              |   7 +-
 gnu/packages/bootloaders.scm        |  42 +-
 gnu/packages/calcurse.scm           |   4 +-
 gnu/packages/calendar.scm           |   4 +-
 gnu/packages/cedille.scm            |   3 +-
 gnu/packages/chemistry.scm          |   3 +-
 gnu/packages/commencement.scm       | 902 ++++++++++++++--------------
 gnu/packages/compression.scm        |  10 +-
 gnu/packages/cran.scm               |  25 +-
 gnu/packages/cups.scm               |   5 +-
 gnu/packages/dictionaries.scm       |   5 +-
 gnu/packages/django.scm             |   3 +-
 gnu/packages/dlang.scm              |   4 +-
 gnu/packages/education.scm          |  32 +-
 gnu/packages/emacs-xyz.scm          |  67 +--
 gnu/packages/emulators.scm          |  13 +-
 gnu/packages/engineering.scm        |  32 +-
 gnu/packages/entr.scm               |   6 +-
 gnu/packages/file-systems.scm       |  22 +-
 gnu/packages/finance.scm            |   7 +-
 gnu/packages/flashing-tools.scm     |   6 +-
 gnu/packages/fontutils.scm          |   3 +-
 gnu/packages/freedesktop.scm        |   3 +-
 gnu/packages/game-development.scm   |  16 +-
 gnu/packages/games.scm              | 104 ++--
 gnu/packages/geo.scm                |   6 +-
 gnu/packages/gimp.scm               |   6 +-
 gnu/packages/glib.scm               |  16 +-
 gnu/packages/gnome.scm              |  51 +-
 gnu/packages/gnupg.scm              |  12 +-
 gnu/packages/gnuzilla.scm           |  14 +-
 gnu/packages/golang.scm             |  12 +-
 gnu/packages/graphics.scm           |  19 +-
 gnu/packages/graphviz.scm           |   5 +-
 gnu/packages/groovy.scm             |   2 +-
 gnu/packages/guile-xyz.scm          |  10 +-
 gnu/packages/haskell-xyz.scm        |   5 +-
 gnu/packages/haskell.scm            |   7 +-
 gnu/packages/hurd.scm               |   9 +-
 gnu/packages/ibus.scm               |   9 +-
 gnu/packages/image-processing.scm   |   7 +-
 gnu/packages/image-viewers.scm      |   9 +-
 gnu/packages/image.scm              |   6 +-
 gnu/packages/irc.scm                |   2 +-
 gnu/packages/irods.scm              |  19 +-
 gnu/packages/java-graphics.scm      |   3 +-
 gnu/packages/java.scm               |  91 ++-
 gnu/packages/julia.scm              |   6 +-
 gnu/packages/kde-frameworks.scm     |  15 +-
 gnu/packages/kde-multimedia.scm     |   3 +-
 gnu/packages/kde-pim.scm            |  14 +-
 gnu/packages/kde-plasma.scm         |   3 +-
 gnu/packages/kde.scm                |  10 +-
 gnu/packages/kodi.scm               |   3 +-
 gnu/packages/language.scm           |  10 +-
 gnu/packages/less.scm               |   9 +-
 gnu/packages/libreoffice.scm        |   7 +-
 gnu/packages/linux.scm              |  54 +-
 gnu/packages/lisp-xyz.scm           |  52 +-
 gnu/packages/lisp.scm               |  11 +-
 gnu/packages/llvm.scm               |  15 +-
 gnu/packages/lua.scm                |   4 +-
 gnu/packages/lxde.scm               |   9 +-
 gnu/packages/machine-learning.scm   |  17 +-
 gnu/packages/mail.scm               |  12 +-
 gnu/packages/mate.scm               |   4 +-
 gnu/packages/maths.scm              |  34 +-
 gnu/packages/messaging.scm          |   7 +-
 gnu/packages/mpi.scm                |  12 +-
 gnu/packages/music.scm              |  14 +-
 gnu/packages/netpbm.scm             |   8 +-
 gnu/packages/networking.scm         |  32 +-
 gnu/packages/node.scm               |  22 +-
 gnu/packages/ocaml.scm              |  10 +-
 gnu/packages/orpheus.scm            |   9 +-
 gnu/packages/package-management.scm |   4 +-
 gnu/packages/pascal.scm             |   6 +-
 gnu/packages/password-utils.scm     |   6 +-
 gnu/packages/perl.scm               |   5 +-
 gnu/packages/photo.scm              |   8 +-
 gnu/packages/pretty-print.scm       |   5 +-
 gnu/packages/pumpio.scm             |   6 +-
 gnu/packages/python-crypto.scm      |   4 +-
 gnu/packages/python-xyz.scm         |  34 +-
 gnu/packages/python.scm             |   4 +-
 gnu/packages/qt.scm                 |   4 +-
 gnu/packages/radio.scm              |  28 +-
 gnu/packages/rrdtool.scm            |   4 +-
 gnu/packages/ruby.scm               |   8 +-
 gnu/packages/rust.scm               |   6 +-
 gnu/packages/scheme.scm             |   8 +-
 gnu/packages/screen.scm             |   3 +-
 gnu/packages/security-token.scm     |  19 +-
 gnu/packages/selinux.scm            |   7 +-
 gnu/packages/serialization.scm      |   3 +-
 gnu/packages/spice.scm              |   4 +-
 gnu/packages/statistics.scm         |   8 +-
 gnu/packages/suckless.scm           |   4 +-
 gnu/packages/sync.scm               |   5 +-
 gnu/packages/syndication.scm        |   7 +-
 gnu/packages/telephony.scm          |  11 +-
 gnu/packages/terminals.scm          |   2 +-
 gnu/packages/tex.scm                |   4 +-
 gnu/packages/tls.scm                |   3 +-
 gnu/packages/uml.scm                |   3 +-
 gnu/packages/version-control.scm    |  30 +-
 gnu/packages/video.scm              |  14 +-
 gnu/packages/vim.scm                |   6 +-
 gnu/packages/virtualization.scm     |  27 +-
 gnu/packages/vpn.scm                |  12 +-
 gnu/packages/web.scm                |   4 +-
 gnu/packages/wine.scm               |   4 +-
 gnu/packages/wm.scm                 |  14 +-
 gnu/packages/wxwidgets.scm          |  10 +-
 gnu/packages/xdisorg.scm            |   5 +-
 gnu/packages/xfce.scm               |   3 +-
 gnu/packages/xorg.scm               |  16 +-
 125 files changed, 1198 insertions(+), 1472 deletions(-)


base-commit: 12c2648f4e8e050d9374ca70efd1856dc8238979
-- 
2.32.0





^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches.
  2021-07-16 15:50 [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
@ 2021-07-16 15:54 ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 02/15] gnu: tzdata: Remove input labels Ludovic Courtès
                     ` (13 more replies)
  2021-07-17 15:06 ` [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Mathieu Othacehe
                   ` (2 subsequent siblings)
  3 siblings, 14 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/commencement.scm (tcc-boot): Remove stale comments.
(gcc-core-mesboot0)[native-inputs]: Remove "boot-patch".
[arguments]: Turn flags and phases into gexps.  Use 'local-file' in the
'apply-boot-patch' phase to refer to the patch.
(glibc-mesboot0)[native-inputs]: Remove "boot-patch" and "system-patch".
[arguments]: Turn flags and phases into gexps.  Use 'local-file' in the
'apply-boot-patch' phase to refer to the patches.
(gcc-mesboot0)[native-inputs]: Remove "boot-patch".
[arguments]: Turn phases into a gexp.
(gcc-core-mesboot1)[native-inputs]: Remove "boot-patch".
[arguments]: Turn flags and phases into gexps.  Use 'local-file' in the
'apply-boot-patch' phase to refer to the patch.
(gcc-mesboot1)[arguments]: Turn flags and phases into gexps.
(glibc-headers-mesboot)[arguments]: Likewise.
(glibc-mesboot)[arguments]: Likewise.
---
 gnu/packages/commencement.scm | 902 +++++++++++++++++-----------------
 1 file changed, 445 insertions(+), 457 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index fb028390a2..eb06edb242 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -806,16 +806,11 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
     (inherit tcc-boot0)
     (name "tcc-boot")
     (version "0.9.27")
-    (source (origin
-              (inherit (package-source tcc))
-              ;; `patches' needs XZ
-              ;; (patches (search-patches "tcc-boot-0.9.27.patch"))
-              ))
+    (source (package-source tcc))
     (build-system gnu-build-system)
     (inputs '())
     (propagated-inputs '())
-    (native-inputs `(;;("boot-patch" ,(search-patch "tcc-boot-0.9.27.patch"))
-                     ("bzip2" ,bzip2-mesboot)
+    (native-inputs `(("bzip2" ,bzip2-mesboot)
                      ,@(%boot-tcc0-inputs)))
     (arguments
      `(#:implicit-inputs? #f
@@ -832,11 +827,6 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
              (invoke "bzip2" "-d" "tarball.tar.bz2")
              (invoke "tar" "xvf" "tarball.tar")
              (chdir (string-append "tcc-" ,version))))
-         ;; no patch yet
-         ;; (add-after 'unpack 'apply-boot-patch
-         ;;   (lambda* (#:key inputs #:allow-other-keys)
-         ;;     (let ((patch-file (assoc-ref inputs "boot-patch")))
-         ;;       (invoke "patch" "-p1" "-i" patch-file))))
          (add-after 'unpack 'scripted-patch
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "libtcc.c"
@@ -1075,94 +1065,95 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
     (supported-systems '("i686-linux" "x86_64-linux"))
     (inputs '())
     (propagated-inputs '())
-    (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-2.95.3.patch"))
-                     ("binutils" ,binutils-mesboot0)
+    (native-inputs `(("binutils" ,binutils-mesboot0)
                      ,@(%boot-tcc-inputs)))
     (outputs '("out"))
     (arguments
-     `(#:implicit-inputs? #f
-       #:guile ,%bootstrap-guile
-       #:tests? #f
-       #:parallel-build? #f
-       #:strip-binaries? #f
-       #:configure-flags
-       (let ((out (assoc-ref %outputs "out")))
-         `("--enable-static"
-           "--disable-shared"
-           "--disable-werror"
-           "--build=i686-unknown-linux-gnu"
-           "--host=i686-unknown-linux-gnu"
-           ,(string-append "--prefix=" out)))
-       #:make-flags
-       `("CC=tcc -static -D __GLIBC_MINOR__=6"
-         "OLDCC=tcc -static -D __GLIBC_MINOR__=6"
-         "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6"
-         "AR=ar"
-         "RANLIB=ranlib"
-         ,(string-append "LIBGCC2_INCLUDES=-I "
-                         (assoc-ref %build-inputs "tcc")
-                         "/include")
-         "LANGUAGES=c"
-         ,(string-append "BOOT_LDFLAGS="
-                         " -B" (assoc-ref %build-inputs "tcc")
-                         "/lib/"))
-       #:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (srfi srfi-1))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'apply-boot-patch
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((patch-file (assoc-ref inputs "boot-patch")))
-               (system* "patch" "--force" "-p1" "-i" patch-file))))
-         (add-before 'configure 'setenv
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bash (assoc-ref %build-inputs "bash"))
-                    (shell (string-append bash "/bin/bash"))
-                    (tcc (assoc-ref %build-inputs "tcc"))
-                    (cppflags " -D __GLIBC_MINOR__=6"))
-               (setenv "CONFIG_SHELL" shell)
-               (setenv "CPPFLAGS" cppflags)
-               (setenv "CC" (string-append "tcc" cppflags))
-               (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags))
-               (setenv "CPP" (string-append "tcc -E" cppflags))
-               (with-output-to-file "config.cache"
-                 (lambda _
-                   (display "
+     (list #:implicit-inputs? #f
+           #:guile %bootstrap-guile
+           #:tests? #f
+           #:parallel-build? #f
+           #:strip-binaries? #f
+           #:configure-flags
+           #~(let ((out (assoc-ref %outputs "out")))
+               `("--enable-static"
+                 "--disable-shared"
+                 "--disable-werror"
+                 "--build=i686-unknown-linux-gnu"
+                 "--host=i686-unknown-linux-gnu"
+                 ,(string-append "--prefix=" out)))
+           #:make-flags
+           #~`("CC=tcc -static -D __GLIBC_MINOR__=6"
+               "OLDCC=tcc -static -D __GLIBC_MINOR__=6"
+               "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6"
+               "AR=ar"
+               "RANLIB=ranlib"
+               ,(string-append "LIBGCC2_INCLUDES=-I "
+                               (assoc-ref %build-inputs "tcc")
+                               "/include")
+               "LANGUAGES=c"
+               ,(string-append "BOOT_LDFLAGS="
+                               " -B" (assoc-ref %build-inputs "tcc")
+                               "/lib/"))
+           #:modules '((guix build gnu-build-system)
+                       (guix build utils)
+                       (srfi srfi-1))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'apply-boot-patch
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((patch-file
+                          #$(local-file
+                             (search-patch "gcc-boot-2.95.3.patch"))))
+                     (invoke "patch" "--force" "-p1" "-i" patch-file))))
+               (add-before 'configure 'setenv
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bash (assoc-ref %build-inputs "bash"))
+                          (shell (string-append bash "/bin/bash"))
+                          (tcc (assoc-ref %build-inputs "tcc"))
+                          (cppflags " -D __GLIBC_MINOR__=6"))
+                     (setenv "CONFIG_SHELL" shell)
+                     (setenv "CPPFLAGS" cppflags)
+                     (setenv "CC" (string-append "tcc" cppflags))
+                     (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags))
+                     (setenv "CPP" (string-append "tcc -E" cppflags))
+                     (with-output-to-file "config.cache"
+                       (lambda _
+                         (display "
 ac_cv_c_float_format='IEEE (little-endian)'
 "))))))
-         ;; gcc-2.95.3
-         (replace 'configure           ; needs classic invocation of configure
-           (lambda* (#:key configure-flags  #:allow-other-keys)
-             (format (current-error-port)
-                     "running ./configure ~a\n" (string-join configure-flags))
-             (apply invoke "./configure" configure-flags)))
-         (add-after 'configure 'remove-info
-           (lambda _
-             ;; no info at this stage
-             (delete-file-recursively "texinfo")
-             (invoke "touch" "gcc/cpp.info" "gcc/gcc.info")))
-         (add-after 'install 'install2
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((tcc (assoc-ref %build-inputs "tcc"))
-                    (tcc-lib (string-append tcc "/lib/x86-mes-gcc"))
-                    (out (assoc-ref outputs "out"))
-                    (gcc-dir (string-append
-                              out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
-               (mkdir-p "tmp")
-               (with-directory-excursion "tmp"
-                 (invoke "ar" "x" (string-append "../gcc/libgcc2.a"))
-                 (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a"))
-                 (apply invoke "ar" "r" (string-append gcc-dir "/libgcc.a")
-                        (find-files "." "\\.o")))
-               (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a"))
-               (copy-file (string-append tcc "/lib/libtcc1.a")
-                          (string-append out "/lib/libtcc1.a"))
-               (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a"))
-               (invoke "ar" "x" (string-append tcc "/lib/libc.a"))
-               (invoke "ar" "r" (string-append gcc-dir "/libc.a")
-                       "libc.o" "libtcc1.o")))))))
+               ;; gcc-2.95.3
+               (replace 'configure           ; needs classic invocation of configure
+                 (lambda* (#:key configure-flags  #:allow-other-keys)
+                   (format (current-error-port)
+                           "running ./configure ~a\n" (string-join configure-flags))
+                   (apply invoke "./configure" configure-flags)))
+               (add-after 'configure 'remove-info
+                 (lambda _
+                   ;; no info at this stage
+                   (delete-file-recursively "texinfo")
+                   (invoke "touch" "gcc/cpp.info" "gcc/gcc.info")))
+               (add-after 'install 'install2
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((tcc (assoc-ref %build-inputs "tcc"))
+                          (tcc-lib (string-append tcc "/lib/x86-mes-gcc"))
+                          (out (assoc-ref outputs "out"))
+                          (gcc-dir (string-append
+                                    out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
+                     (mkdir-p "tmp")
+                     (with-directory-excursion "tmp"
+                       (invoke "ar" "x" (string-append "../gcc/libgcc2.a"))
+                       (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a"))
+                       (apply invoke "ar" "r" (string-append gcc-dir "/libgcc.a")
+                              (find-files "." "\\.o")))
+                     (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a"))
+                     (copy-file (string-append tcc "/lib/libtcc1.a")
+                                (string-append out "/lib/libtcc1.a"))
+                     (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a"))
+                     (invoke "ar" "x" (string-append tcc "/lib/libc.a"))
+                     (invoke "ar" "r" (string-append gcc-dir "/libc.a")
+                             "libc.o" "libtcc1.o")))))))
     (native-search-paths
      (list (search-path-specification
             (variable "C_INCLUDE_PATH")
@@ -1294,85 +1285,84 @@ ac_cv_c_float_format='IEEE (little-endian)'
     (supported-systems '("i686-linux" "x86_64-linux"))
     (inputs '())
     (propagated-inputs '())
-    (native-inputs `(("boot-patch" ,(search-patch "glibc-boot-2.2.5.patch"))
-                     ("system-patch" ,(search-patch "glibc-bootstrap-system-2.2.5.patch"))
-                     ("headers" ,mesboot-headers)
+    (native-inputs `(("headers" ,mesboot-headers)
                      ,@(%boot-mesboot-core-inputs)))
     (outputs '("out"))
     (arguments
-     `(#:implicit-inputs? #f
-       #:guile ,%bootstrap-guile
-       #:tests? #f
-       #:strip-binaries? #f
-       #:validate-runpath? #f   ; no dynamic executables
-       #:parallel-build? #f     ; gcc-2.95.3 ICEs on massively parallel builds
-       #:make-flags (list (string-append
-                           "SHELL="
-                           (assoc-ref %build-inputs "bash")
-                           "/bin/sh"))
-       #:configure-flags
-       (let ((out (assoc-ref %outputs "out"))
-             (headers (assoc-ref %build-inputs "headers")))
-         `("--disable-shared"
-           "--enable-static"
-           "--disable-sanity-checks"
-           "--build=i686-unknown-linux-gnu"
-           "--host=i686-unknown-linux-gnu"
-           ,(string-append "--with-headers=" headers "/include")
-           "--enable-static-nss"
-           "--without-__thread"
-           "--without-cvs"
-           "--without-gd"
-           "--without-tls"
-           ,(string-append "--prefix=" out)))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'apply-boot-patch
-           (lambda* (#:key inputs #:allow-other-keys)
-             (and (let ((patch (assoc-ref inputs "boot-patch")))
-                    (invoke "patch" "--force" "-p1" "-i" patch))
-                  (let ((patch (assoc-ref inputs "system-patch")))
-                    (invoke "patch" "--force" "-p1" "-i" patch)))))
-         (add-before 'configure 'setenv
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bash (assoc-ref %build-inputs "bash"))
-                    (shell (string-append bash "/bin/bash"))
-                    (gcc (assoc-ref %build-inputs "gcc"))
-                    (headers (assoc-ref %build-inputs "headers"))
-                    (cppflags (string-append
-                               ;;" -D __STDC__=1"
-                               " -D MES_BOOTSTRAP=1"
-                               " -D BOOTSTRAP_GLIBC=1"))
-                    (cflags (string-append " -L " (getcwd))))
-               (setenv "CONFIG_SHELL" shell)
-               (setenv "SHELL" shell)
-               (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
-               (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)))))
-         (replace 'configure           ; needs classic invocation of configure
-           (lambda* (#:key configure-flags #:allow-other-keys)
-             (format (current-error-port)
-                     "running ./configure ~a\n" (string-join configure-flags))
-             (apply invoke "./configure" configure-flags)))
-                  (add-after 'configure 'fixup-configure
-                    (lambda _
-                      (let* ((out (assoc-ref %outputs "out"))
-                             (bash (assoc-ref %build-inputs "bash"))
-                             (shell (string-append bash "/bin/bash")))
-                        (substitute* "config.make"
-                          (("INSTALL = scripts/") "INSTALL = $(..)./scripts/"))
-                        (substitute* "config.make"
-                          (("INSTALL = scripts/") "INSTALL = $(..)./scripts/")
-                          (("BASH = ") (string-append
-                                        "SHELL = " shell "
+     (list #:implicit-inputs? #f
+           #:guile %bootstrap-guile
+           #:tests? #f
+           #:strip-binaries? #f
+           #:validate-runpath? #f   ; no dynamic executables
+           #:parallel-build? #f     ; gcc-2.95.3 ICEs on massively parallel builds
+           #:make-flags #~(list (string-append
+                                 "SHELL="
+                                 (assoc-ref %build-inputs "bash")
+                                 "/bin/sh"))
+           #:configure-flags
+           #~(let ((out (assoc-ref %outputs "out"))
+                   (headers (assoc-ref %build-inputs "headers")))
+               `("--disable-shared"
+                 "--enable-static"
+                 "--disable-sanity-checks"
+                 "--build=i686-unknown-linux-gnu"
+                 "--host=i686-unknown-linux-gnu"
+                 ,(string-append "--with-headers=" headers "/include")
+                 "--enable-static-nss"
+                 "--without-__thread"
+                 "--without-cvs"
+                 "--without-gd"
+                 "--without-tls"
+                 ,(string-append "--prefix=" out)))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'apply-boot-patch
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (invoke "patch" "--force" "-p1" "-i"
+                           #$(local-file
+                              (search-patch "glibc-boot-2.2.5.patch")))
+                   (invoke "patch" "--force" "-p1" "-i"
+                           #$(local-file
+                              (search-patch "glibc-bootstrap-system-2.2.5.patch")))))
+               (add-before 'configure 'setenv
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bash (assoc-ref %build-inputs "bash"))
+                          (shell (string-append bash "/bin/bash"))
+                          (gcc (assoc-ref %build-inputs "gcc"))
+                          (headers (assoc-ref %build-inputs "headers"))
+                          (cppflags (string-append
+                                     ;;" -D __STDC__=1"
+                                     " -D MES_BOOTSTRAP=1"
+                                     " -D BOOTSTRAP_GLIBC=1"))
+                          (cflags (string-append " -L " (getcwd))))
+                     (setenv "CONFIG_SHELL" shell)
+                     (setenv "SHELL" shell)
+                     (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
+                     (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)))))
+               (replace 'configure           ; needs classic invocation of configure
+                 (lambda* (#:key configure-flags #:allow-other-keys)
+                   (format (current-error-port)
+                           "running ./configure ~a\n" (string-join configure-flags))
+                   (apply invoke "./configure" configure-flags)))
+               (add-after 'configure 'fixup-configure
+                 (lambda _
+                   (let* ((out (assoc-ref %outputs "out"))
+                          (bash (assoc-ref %build-inputs "bash"))
+                          (shell (string-append bash "/bin/bash")))
+                     (substitute* "config.make"
+                       (("INSTALL = scripts/") "INSTALL = $(..)./scripts/"))
+                     (substitute* "config.make"
+                       (("INSTALL = scripts/") "INSTALL = $(..)./scripts/")
+                       (("BASH = ") (string-append
+                                     "SHELL = " shell "
          BASH = ")))))))))))
 
 (define gcc-mesboot0
   (package
     (inherit gcc-core-mesboot0)
     (name "gcc-mesboot0")
-    (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-2.95.3.patch"))
-                     ;; Packages are given in an order that's relevant for
+    (native-inputs `(;; Packages are given in an order that's relevant for
                      ;; #include_next purposes.
                      ("libc" ,glibc-mesboot0)
                      ("kernel-headers" ,%bootstrap-linux-libre-headers)
@@ -1380,37 +1370,37 @@ ac_cv_c_float_format='IEEE (little-endian)'
     (arguments
      (substitute-keyword-arguments (package-arguments gcc-core-mesboot0)
        ((#:phases phases)
-        `(modify-phases ,phases
-           (replace 'setenv
-             (lambda _
-               (setenv "CONFIG_SHELL" (which "sh"))
-               (with-output-to-file "config.cache"
-                 (lambda _
-                   (display "
+        #~(modify-phases #$phases
+            (replace 'setenv
+              (lambda _
+                (setenv "CONFIG_SHELL" (which "sh"))
+                (with-output-to-file "config.cache"
+                  (lambda _
+                    (display "
 ac_cv_c_float_format='IEEE (little-endian)'
 ")))))
-           (replace 'install2
-             (lambda* (#:key outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (gcc-dir (string-append
-                                out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
-                 (and
-                  (mkdir-p "tmp")
-                  (zero? (system (string-append "set -x; cd tmp && ar x ../gcc/libgcc2.a")))
-                  (zero? (system (string-append "set -x; cd tmp && ar r " gcc-dir "/libgcc.a *.o")))
-                  (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a"))))))))
+            (replace 'install2
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let* ((out (assoc-ref outputs "out"))
+                       (gcc-dir (string-append
+                                 out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
+                  (and
+                   (mkdir-p "tmp")
+                   (zero? (system (string-append "set -x; cd tmp && ar x ../gcc/libgcc2.a")))
+                   (zero? (system (string-append "set -x; cd tmp && ar r " gcc-dir "/libgcc.a *.o")))
+                   (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a"))))))))
        ((#:configure-flags configure-flags)
-        `(let ((out (assoc-ref %outputs "out")))
-           `("--disable-shared"
-             "--disable-werror"
-             "--build=i686-unknown-linux-gnu"
-             "--host=i686-unknown-linux-gnu"
-             ,(string-append "--prefix=" out))))
+        #~(let ((out (assoc-ref %outputs "out")))
+            `("--disable-shared"
+              "--disable-werror"
+              "--build=i686-unknown-linux-gnu"
+              "--host=i686-unknown-linux-gnu"
+              ,(string-append "--prefix=" out))))
        ((#:make-flags make-flags)
-        `(let ((gcc (assoc-ref %build-inputs "gcc")))
-           `("RANLIB=true"
-             ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include")
-             "LANGUAGES=c")))))))
+        #~(let ((gcc (assoc-ref %build-inputs "gcc")))
+            `("RANLIB=true"
+              ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include")
+              "LANGUAGES=c")))))))
 
 (define (%boot-mesboot0-inputs)
   `(("gcc" ,gcc-mesboot0)
@@ -1791,112 +1781,109 @@ ac_cv_c_float_format='IEEE (little-endian)'
                                   version "/gcc-core-" version ".tar.gz"))
               (sha256
                (base32
-                "173kdb188qg79pcz073cj9967rs2vzanyjdjyxy9v0xb0p5sad75"))
-              ;; Patch needs XZ
-              ;; (patches (search-patches "gcc-boot-4.6.4.patch"))
-              ))
+                "173kdb188qg79pcz073cj9967rs2vzanyjdjyxy9v0xb0p5sad75"))))
     (inputs `(("gmp-source" ,(package-source gmp-boot))
               ("mpfr-source" ,(package-source mpfr-boot))
               ("mpc-source" ,(package-source mpc-boot))))
-    (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-4.6.4.patch"))
-                     ,@(%boot-mesboot1-inputs)))
+    (native-inputs (%boot-mesboot1-inputs))
     (arguments
-     `(#:implicit-inputs? #f
-       #:guile ,%bootstrap-guile
-       #:tests? #f
-       #:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (srfi srfi-1))
-       #:parallel-build? #f             ; for debugging
-       #:make-flags
-       (let* ((libc (assoc-ref %build-inputs "libc"))
-              (ldflags (string-append
-                        "-B" libc "/lib "
-                        "-Wl,-dynamic-linker "
-                        "-Wl," libc
-                        ,(glibc-dynamic-linker "i686-linux"))))
-         (list (string-append "LDFLAGS=" ldflags)
-               (string-append "LDFLAGS_FOR_TARGET=" ldflags)))
-       #:configure-flags
-       (let ((out (assoc-ref %outputs "out"))
-             (glibc (assoc-ref %build-inputs "libc")))
-         (list (string-append "--prefix=" out)
-               "--build=i686-unknown-linux-gnu"
-               "--host=i686-unknown-linux-gnu"
-               (string-append "--with-native-system-header-dir=" glibc "/include")
-               (string-append "--with-build-sysroot=" glibc "/include")
-               "--disable-bootstrap"
-               "--disable-decimal-float"
-               "--disable-libatomic"
-               "--disable-libcilkrts"
-               "--disable-libgomp"
-               "--disable-libitm"
-               "--disable-libmudflap"
-               "--disable-libquadmath"
-               "--disable-libsanitizer"
-               "--disable-libssp"
-               "--disable-libvtv"
-               "--disable-lto"
-               "--disable-lto-plugin"
-               "--disable-multilib"
-               "--disable-plugin"
-               "--disable-threads"
-               "--enable-languages=c"
-               "--enable-static"
-               "--disable-shared"
-               "--enable-threads=single"
-               "--disable-libstdcxx-pch"
-               "--disable-build-with-cxx"))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'apply-boot-patch
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((patch-file (assoc-ref inputs "boot-patch")))
-               (format (current-error-port) "patch file=~s\n" patch-file)
-               (system* "patch" "--force" "-p1" "-i" patch-file))))
-         ;; c&p from commencement.scm:gcc-boot0
-         (add-after 'unpack 'unpack-gmp&co
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gmp  (assoc-ref %build-inputs "gmp-source"))
-                   (mpfr (assoc-ref %build-inputs "mpfr-source"))
-                   (mpc  (assoc-ref %build-inputs "mpc-source")))
+     (list #:implicit-inputs? #f
+           #:guile %bootstrap-guile
+           #:tests? #f
+           #:modules '((guix build gnu-build-system)
+                       (guix build utils)
+                       (srfi srfi-1))
+           #:parallel-build? #f             ; for debugging
+           #:make-flags
+           #~(let* ((libc (assoc-ref %build-inputs "libc"))
+                    (ldflags (string-append
+                              "-B" libc "/lib "
+                              "-Wl,-dynamic-linker "
+                              "-Wl," libc
+                              #$(glibc-dynamic-linker "i686-linux"))))
+               (list (string-append "LDFLAGS=" ldflags)
+                     (string-append "LDFLAGS_FOR_TARGET=" ldflags)))
+           #:configure-flags
+           #~(let ((out (assoc-ref %outputs "out"))
+                   (glibc (assoc-ref %build-inputs "libc")))
+               (list (string-append "--prefix=" out)
+                     "--build=i686-unknown-linux-gnu"
+                     "--host=i686-unknown-linux-gnu"
+                     (string-append "--with-native-system-header-dir=" glibc "/include")
+                     (string-append "--with-build-sysroot=" glibc "/include")
+                     "--disable-bootstrap"
+                     "--disable-decimal-float"
+                     "--disable-libatomic"
+                     "--disable-libcilkrts"
+                     "--disable-libgomp"
+                     "--disable-libitm"
+                     "--disable-libmudflap"
+                     "--disable-libquadmath"
+                     "--disable-libsanitizer"
+                     "--disable-libssp"
+                     "--disable-libvtv"
+                     "--disable-lto"
+                     "--disable-lto-plugin"
+                     "--disable-multilib"
+                     "--disable-plugin"
+                     "--disable-threads"
+                     "--enable-languages=c"
+                     "--enable-static"
+                     "--disable-shared"
+                     "--enable-threads=single"
+                     "--disable-libstdcxx-pch"
+                     "--disable-build-with-cxx"))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'apply-boot-patch
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((patch-file
+                          #$(local-file
+                             (search-patch "gcc-boot-4.6.4.patch"))))
+                     (invoke "patch" "--force" "-p1" "-i" patch-file))))
+               ;; c&p from commencement.scm:gcc-boot0
+               (add-after 'unpack 'unpack-gmp&co
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((gmp  (assoc-ref %build-inputs "gmp-source"))
+                         (mpfr (assoc-ref %build-inputs "mpfr-source"))
+                         (mpc  (assoc-ref %build-inputs "mpc-source")))
 
-               ;; To reduce the set of pre-built bootstrap inputs, build
-               ;; GMP & co. from GCC.
-               (for-each (lambda (source)
-                           (or (invoke "tar" "xvf" source)
-                               (error "failed to unpack tarball"
-                                      source)))
-                         (list gmp mpfr mpc))
+                     ;; To reduce the set of pre-built bootstrap inputs, build
+                     ;; GMP & co. from GCC.
+                     (for-each (lambda (source)
+                                 (or (invoke "tar" "xvf" source)
+                                     (error "failed to unpack tarball"
+                                            source)))
+                               (list gmp mpfr mpc))
 
-               ;; Create symlinks like `gmp' -> `gmp-x.y.z'.
-               ,@(map (lambda (lib)
-                        ;; Drop trailing letters, as gmp-6.0.0a unpacks
-                        ;; into gmp-6.0.0.
-                        `(symlink ,(string-trim-right
-                                    (package-full-name lib "-")
-                                    char-set:letter)
-                                  ,(package-name lib)))
-                      (list gmp-boot mpfr-boot mpc-boot)))))
-         (add-before 'configure 'setenv
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (binutils (assoc-ref %build-inputs "binutils"))
-                    (bash (assoc-ref %build-inputs "bash"))
-                    (gcc (assoc-ref %build-inputs "gcc"))
-                    (glibc (assoc-ref %build-inputs "libc"))
-                    (kernel-headers (assoc-ref %build-inputs "kernel-headers")))
-               (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
-               (setenv "C_INCLUDE_PATH" (string-append
-                                         gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
-                                         ":" kernel-headers "/include"
-                                         ":" glibc "/include"
-                                         ":" (getcwd) "/mpfr/src"))
-               (setenv "LIBRARY_PATH" (string-append glibc "/lib"
-                                                     ":" gcc "/lib"))
-               (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH"))
-               (format (current-error-port) "LIBRARY_PATH=~a\n"
-                       (getenv "LIBRARY_PATH"))))))))))
+                     ;; Create symlinks like `gmp' -> `gmp-x.y.z'.
+                     #$@(map (lambda (lib)
+                               ;; Drop trailing letters, as gmp-6.0.0a unpacks
+                               ;; into gmp-6.0.0.
+                               #~(symlink #$(string-trim-right
+                                             (package-full-name lib "-")
+                                             char-set:letter)
+                                          #$(package-name lib)))
+                             (list gmp-boot mpfr-boot mpc-boot)))))
+               (add-before 'configure 'setenv
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (binutils (assoc-ref %build-inputs "binutils"))
+                          (bash (assoc-ref %build-inputs "bash"))
+                          (gcc (assoc-ref %build-inputs "gcc"))
+                          (glibc (assoc-ref %build-inputs "libc"))
+                          (kernel-headers (assoc-ref %build-inputs "kernel-headers")))
+                     (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+                     (setenv "C_INCLUDE_PATH" (string-append
+                                               gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
+                                               ":" kernel-headers "/include"
+                                               ":" glibc "/include"
+                                               ":" (getcwd) "/mpfr/src"))
+                     (setenv "LIBRARY_PATH" (string-append glibc "/lib"
+                                                           ":" gcc "/lib"))
+                     (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH"))
+                     (format (current-error-port) "LIBRARY_PATH=~a\n"
+                             (getenv "LIBRARY_PATH"))))))))))
 
 (define gcc-mesboot1
   (package
@@ -1916,29 +1903,29 @@ ac_cv_c_float_format='IEEE (little-endian)'
     (arguments
      (substitute-keyword-arguments (package-arguments gcc-core-mesboot1)
        ((#:configure-flags configure-flags)
-        `(let ((out (assoc-ref %outputs "out")))
-           `("--enable-languages=c,c++"
-             ,@(filter
-                (negate (lambda (x) (string-prefix? "--enable-languages=" x)))
-                ,configure-flags))))
+        #~(let ((out (assoc-ref %outputs "out")))
+            `("--enable-languages=c,c++"
+              ,@(filter
+                 (negate (lambda (x) (string-prefix? "--enable-languages=" x)))
+                 #$configure-flags))))
        ((#:phases phases)
-        `(modify-phases ,phases
-           (add-before 'unpack 'unpack-g++
-             (lambda _
-               (let ((source-g++ (assoc-ref %build-inputs "gcc-g++")))
-                 (invoke "tar" "xvf" source-g++))))
-           (replace 'setenv
-             (lambda _
-               (setenv "CONFIG_SHELL" (which "sh"))
+        #~(modify-phases #$phases
+            (add-before 'unpack 'unpack-g++
+              (lambda _
+                (let ((source-g++ (assoc-ref %build-inputs "gcc-g++")))
+                  (invoke "tar" "xvf" source-g++))))
+            (replace 'setenv
+              (lambda _
+                (setenv "CONFIG_SHELL" (which "sh"))
 
-               ;; Allow MPFR headers to be found.
-               (setenv "C_INCLUDE_PATH"
-                       (string-append (getcwd) "/mpfr/src:"
-                                      (getenv "C_INCLUDE_PATH")))
+                ;; Allow MPFR headers to be found.
+                (setenv "C_INCLUDE_PATH"
+                        (string-append (getcwd) "/mpfr/src:"
+                                       (getenv "C_INCLUDE_PATH")))
 
-               ;; Set the C++ search path so that C headers can be found as
-               ;; libstdc++ is being compiled.
-               (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))))))))
+                ;; Set the C++ search path so that C headers can be found as
+                ;; libstdc++ is being compiled.
+                (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))))))))
 
 (define (%boot-mesboot2-inputs)
   `(("gcc" ,gcc-mesboot1)
@@ -2107,88 +2094,89 @@ ac_cv_c_float_format='IEEE (little-endian)'
     (arguments
      (substitute-keyword-arguments (package-arguments glibc-mesboot0)
        ((#:configure-flags configure-flags)
-        `(let ((out (assoc-ref %outputs "out"))
-               (headers (assoc-ref %build-inputs "headers")))
-           (list
-            (string-append "--prefix=" out)
-            "--disable-obsolete-rpc"
-            "--host=i686-unknown-linux-gnu"
-            (string-append "--with-headers=" headers "/include")
-            "--enable-static-nss"
-            "--with-pthread"
-            "--without-cvs"
-            "--without-gd"
-            "--enable-add-ons=nptl"
-            ;; avoid: configure: error: confusing output from nm -u
-            "libc_cv_predef_stack_protector=no")))
+        #~(let ((out (assoc-ref %outputs "out"))
+                (headers (assoc-ref %build-inputs "headers")))
+            (list
+             (string-append "--prefix=" out)
+             "--disable-obsolete-rpc"
+             "--host=i686-unknown-linux-gnu"
+             (string-append "--with-headers=" headers "/include")
+             "--enable-static-nss"
+             "--with-pthread"
+             "--without-cvs"
+             "--without-gd"
+             "--enable-add-ons=nptl"
+             ;; avoid: configure: error: confusing output from nm -u
+             "libc_cv_predef_stack_protector=no")))
        ((#:make-flags make-flags)
-        '(list "install-bootstrap-headers=yes" "install-headers"))
+        #~(list "install-bootstrap-headers=yes" "install-headers"))
        ((#:phases phases)
-        `(modify-phases ,phases
-           (delete 'apply-boot-patch)
-           (delete 'fixup-configure)
-           (delete 'set-path)
-           (replace 'unpack
-             (lambda* (#:key source #:allow-other-keys)
-               (invoke "tar" "xvf" source)
-               (chdir (string-append "glibc-" ,version))))
-           (replace 'setenv
-             (lambda* (#:key inputs #:allow-other-keys)
-               (let* ((headers  (assoc-ref inputs "headers"))
-                      (libc     (assoc-ref inputs "libc"))
-                      (gcc      (assoc-ref inputs "gcc"))
-                      (cppflags (string-append
-                                 " -I " (getcwd) "/nptl/sysdeps/pthread/bits"
-                                 " -D BOOTSTRAP_GLIBC=1"))
-                      (cflags (string-append " -L " (getcwd)
-                                             " -L " libc "/lib")))
-                 (setenv "libc_cv_friendly_stddef" "yes")
-                 (setenv "CONFIG_SHELL" (which "sh"))
-                 (setenv "SHELL" (which "sh"))
+        #~(modify-phases #$phases
+            (delete 'apply-boot-patch)
+            (delete 'fixup-configure)
+            (delete 'set-path)
+            (replace 'unpack
+              (lambda* (#:key source #:allow-other-keys)
+                (invoke "tar" "xvf" source)
+                (chdir (string-append "glibc-" #$version))))
+            (replace 'setenv
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let* ((headers  (assoc-ref inputs "headers"))
+                       (libc     (assoc-ref inputs "libc"))
+                       (gcc      (assoc-ref inputs "gcc"))
+                       (cppflags (string-append
+                                  " -I " (getcwd) "/nptl/sysdeps/pthread/bits"
+                                  " -D BOOTSTRAP_GLIBC=1"))
+                       (cflags (string-append " -L " (getcwd)
+                                              " -L " libc "/lib")))
+                  (setenv "libc_cv_friendly_stddef" "yes")
+                  (setenv "CONFIG_SHELL" (which "sh"))
+                  (setenv "SHELL" (which "sh"))
 
-                 (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
-                 (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
-                 (setenv "LD" "gcc")
+                  (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
+                  (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
+                  (setenv "LD" "gcc")
 
-                 ;; avoid -fstack-protector
-                 (setenv "libc_cv_ssp" "false")
-                 (substitute* "configure"
-                   (("/bin/pwd") "pwd")))))
-           (replace 'install
-             (lambda* (#:key outputs make-flags #:allow-other-keys)
-               (let ((kernel-headers (assoc-ref %build-inputs "kernel-headers"))
-                     (out (assoc-ref outputs "out")))
-                 (apply invoke "make" make-flags)
-                 (copy-recursively kernel-headers out))))
-           (replace 'configure
-             (lambda* (#:key configure-flags #:allow-other-keys)
-               (format (current-error-port) "running ../configure ~a\n" (string-join configure-flags))
-               (mkdir-p "build")
-               (chdir "build")
-               (apply invoke "../configure" configure-flags)))
-           (add-after 'configure 'remove-sunrpc
-             (lambda _
-               (let* ((out (assoc-ref %outputs "out"))
-                      (bash (assoc-ref %build-inputs "bash"))
-                      (shell (string-append bash "/bin/bash")))
+                  ;; avoid -fstack-protector
+                  (setenv "libc_cv_ssp" "false")
+                  (substitute* "configure"
+                    (("/bin/pwd") "pwd")))))
+            (replace 'install
+              (lambda* (#:key outputs make-flags #:allow-other-keys)
+                (let ((kernel-headers (assoc-ref %build-inputs "kernel-headers"))
+                      (out (assoc-ref outputs "out")))
+                  (apply invoke "make" make-flags)
+                  (copy-recursively kernel-headers out))))
+            (replace 'configure
+              (lambda* (#:key configure-flags #:allow-other-keys)
+                (format (current-error-port) "running ../configure ~a\n"
+                        (string-join configure-flags))
+                (mkdir-p "build")
+                (chdir "build")
+                (apply invoke "../configure" configure-flags)))
+            (add-after 'configure 'remove-sunrpc
+              (lambda _
+                (let* ((out (assoc-ref %outputs "out"))
+                       (bash (assoc-ref %build-inputs "bash"))
+                       (shell (string-append bash "/bin/bash")))
 
-                 (let ((Makefile (open-file "Makefile" "a")))
-                   (display (string-append "
+                  (let ((Makefile (open-file "Makefile" "a")))
+                    (display (string-append "
 
 SHELL := " shell "
 ")
-                            Makefile)
-                   (close Makefile))
-                 (substitute* "../Makefile"
-                   (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
-                 (substitute* "../Makeconfig"
-                   (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
-                 (substitute* "../elf/Makefile"
-                   (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
-                 (invoke "make" (string-append (getcwd) "/sysd-sorted" ))
-                 (substitute* "sysd-sorted"
-                   ((" sunrpc") " ")
-                   ((" nis") " ")))))))))))
+                             Makefile)
+                    (close Makefile))
+                  (substitute* "../Makefile"
+                    (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
+                  (substitute* "../Makeconfig"
+                    (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
+                  (substitute* "../elf/Makefile"
+                    (("^SHELL := /bin/sh") (string-append "SHELL := " shell)))
+                  (invoke "make" (string-append (getcwd) "/sysd-sorted" ))
+                  (substitute* "sysd-sorted"
+                    ((" sunrpc") " ")
+                    ((" nis") " ")))))))))))
 
 (define glibc-mesboot
   (package
@@ -2200,17 +2188,17 @@ SHELL := " shell "
      `(#:validate-runpath? #f ; fails when using --enable-shared
        ,@(substitute-keyword-arguments (package-arguments glibc-headers-mesboot)
            ((#:make-flags make-flags)
-            `(let ((bash (assoc-ref %build-inputs "bash")))
-               (list (string-append "SHELL=" bash "/bin/sh"))))
+            #~(let ((bash (assoc-ref %build-inputs "bash")))
+                (list (string-append "SHELL=" bash "/bin/sh"))))
            ((#:phases phases)
-            `(modify-phases ,phases
-               (replace 'install
-                 (lambda* (#:key outputs make-flags #:allow-other-keys)
-                   (let* ((kernel-headers (assoc-ref %build-inputs "kernel-headers"))
-                          (out (assoc-ref outputs "out"))
-                          (install-flags (cons "install" make-flags)))
-                     (apply invoke "make" install-flags)
-                     (copy-recursively kernel-headers out)))))))))))
+            #~(modify-phases #$phases
+                (replace 'install
+                  (lambda* (#:key outputs make-flags #:allow-other-keys)
+                    (let* ((kernel-headers (assoc-ref %build-inputs "kernel-headers"))
+                           (out (assoc-ref outputs "out"))
+                           (install-flags (cons "install" make-flags)))
+                      (apply invoke "make" install-flags)
+                      (copy-recursively kernel-headers out)))))))))))
 
 (define (%boot-mesboot4-inputs)
   `(("libc" ,glibc-mesboot)
@@ -2286,74 +2274,74 @@ exec " gcc "/bin/" program
      `(#:validate-runpath? #f
        ,@(substitute-keyword-arguments (package-arguments gcc-mesboot1)
            ((#:configure-flags configure-flags)
-            `(let ((out (assoc-ref %outputs "out"))
-                   (glibc (assoc-ref %build-inputs "libc")))
-               (list (string-append "--prefix=" out)
-                     "--build=i686-unknown-linux-gnu"
-                     "--host=i686-unknown-linux-gnu"
+            #~(let ((out (assoc-ref %outputs "out"))
+                    (glibc (assoc-ref %build-inputs "libc")))
+                (list (string-append "--prefix=" out)
+                      "--build=i686-unknown-linux-gnu"
+                      "--host=i686-unknown-linux-gnu"
 
-                     "--with-host-libstdcxx=-lsupc++"
+                      "--with-host-libstdcxx=-lsupc++"
 
-                     (string-append "--with-native-system-header-dir=" glibc "/include")
-                     (string-append "--with-build-sysroot=" glibc "/include")
+                      (string-append "--with-native-system-header-dir=" glibc "/include")
+                      (string-append "--with-build-sysroot=" glibc "/include")
 
-                     "--disable-bootstrap"
-                     "--disable-decimal-float"
-                     "--disable-libatomic"
-                     "--disable-libcilkrts"
-                     "--disable-libgomp"
-                     "--disable-libitm"
-                     "--disable-libmudflap"
-                     "--disable-libquadmath"
-                     "--disable-libsanitizer"
-                     "--disable-libssp"
-                     "--disable-libvtv"
-                     "--disable-lto"
-                     "--disable-lto-plugin"
-                     "--disable-multilib"
-                     "--disable-plugin"
-                     "--disable-threads"
-                     "--enable-languages=c,c++"
+                      "--disable-bootstrap"
+                      "--disable-decimal-float"
+                      "--disable-libatomic"
+                      "--disable-libcilkrts"
+                      "--disable-libgomp"
+                      "--disable-libitm"
+                      "--disable-libmudflap"
+                      "--disable-libquadmath"
+                      "--disable-libsanitizer"
+                      "--disable-libssp"
+                      "--disable-libvtv"
+                      "--disable-lto"
+                      "--disable-lto-plugin"
+                      "--disable-multilib"
+                      "--disable-plugin"
+                      "--disable-threads"
+                      "--enable-languages=c,c++"
 
-                     "--enable-static"
-                     "--enable-shared"
-                     "--enable-threads=single"
+                      "--enable-static"
+                      "--enable-shared"
+                      "--enable-threads=single"
 
-                     ;; No pre-compiled libstdc++ headers, to save space.
-                     "--disable-libstdcxx-pch"
+                      ;; No pre-compiled libstdc++ headers, to save space.
+                      "--disable-libstdcxx-pch"
 
-                     ;; for libcpp ...
-                     "--disable-build-with-cxx")))
+                      ;; for libcpp ...
+                      "--disable-build-with-cxx")))
            ((#:phases phases)
-            `(modify-phases ,phases
-               (delete 'apply-boot-patch)
-               (delete 'unpack-g++)     ; sadly, gcc-4.9.4 does not provide
-                                        ; modular core/language downloads
-               (replace 'setenv
-                 (lambda* (#:key outputs #:allow-other-keys)
-                   (let* ((out (assoc-ref outputs "out"))
-                          (binutils (assoc-ref %build-inputs "binutils"))
-                          (bash (assoc-ref %build-inputs "bash"))
-                          (gcc (assoc-ref %build-inputs "gcc"))
-                          (glibc (assoc-ref %build-inputs "libc"))
-                          (kernel-headers (assoc-ref %build-inputs "kernel-headers")))
-                     (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
-                     (setenv "C_INCLUDE_PATH" (string-append
-                                               gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include"
-                                               ":" kernel-headers "/include"
-                                               ":" glibc "/include"
-                                               ":" (getcwd) "/mpfr/src"))
-                     (setenv "CPLUS_INCLUDE_PATH" (string-append
-                                                   gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include"
-                                                   ":" kernel-headers "/include"
-                                                   ":" glibc "/include"
-                                                   ":" (getcwd) "/mpfr/src"))
-                     (setenv "LIBRARY_PATH" (string-append glibc "/lib"
-                                                           ":" gcc "/lib"))
-                     (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH"))
-                     (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH"))
-                     (format (current-error-port) "LIBRARY_PATH=~a\n"
-                             (getenv "LIBRARY_PATH"))))))))))))
+            #~(modify-phases #$phases
+                (delete 'apply-boot-patch)
+                (delete 'unpack-g++)     ; sadly, gcc-4.9.4 does not provide
+                                                  ; modular core/language downloads
+                (replace 'setenv
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let* ((out (assoc-ref outputs "out"))
+                           (binutils (assoc-ref %build-inputs "binutils"))
+                           (bash (assoc-ref %build-inputs "bash"))
+                           (gcc (assoc-ref %build-inputs "gcc"))
+                           (glibc (assoc-ref %build-inputs "libc"))
+                           (kernel-headers (assoc-ref %build-inputs "kernel-headers")))
+                      (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+                      (setenv "C_INCLUDE_PATH" (string-append
+                                                gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include"
+                                                ":" kernel-headers "/include"
+                                                ":" glibc "/include"
+                                                ":" (getcwd) "/mpfr/src"))
+                      (setenv "CPLUS_INCLUDE_PATH" (string-append
+                                                    gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include"
+                                                    ":" kernel-headers "/include"
+                                                    ":" glibc "/include"
+                                                    ":" (getcwd) "/mpfr/src"))
+                      (setenv "LIBRARY_PATH" (string-append glibc "/lib"
+                                                            ":" gcc "/lib"))
+                      (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH"))
+                      (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH"))
+                      (format (current-error-port) "LIBRARY_PATH=~a\n"
+                              (getenv "LIBRARY_PATH"))))))))))))
 
 (define gcc-mesboot-wrapper
   ;; We need this so gcc-mesboot can be used to create shared binaries that
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 02/15] gnu: tzdata: Remove input labels.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 03/15] gnu: Simplify "Xvbf" invocation in pre-check phases Ludovic Courtès
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/base.scm (tzdata)[arguments]: Turn flags and phases into
a gexp.
[inputs]: Turn into a plain list.
---
 gnu/packages/base.scm | 128 ++++++++++++++++++++++--------------------
 1 file changed, 66 insertions(+), 62 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 9c1c946e4a..d6e0e55678 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -57,6 +57,7 @@
   #:use-module (gnu packages gettext)
   #:use-module (guix i18n)
   #:use-module (guix utils)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -1253,63 +1254,66 @@ command.")
                "022fn6gkmp7pamlgab04x0dm5hnyn2m2fcnyr3pvm36612xd5rrr"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f
-       #:make-flags (let ((out (assoc-ref %outputs "out"))
-                          (tmp (getenv "TMPDIR")))
-                      (list (string-append "TOPDIR=" out)
-                            (string-append "TZDIR=" out "/share/zoneinfo")
-                            (string-append "TZDEFAULT=" out
-                                           "/share/zoneinfo/localtime")
+     (list #:tests? #f
+           #:make-flags
+           #~(let ((out #$output)
+                   (tmp (getenv "TMPDIR")))
+               (list (string-append "TOPDIR=" out)
+                     (string-append "TZDIR=" out "/share/zoneinfo")
+                     (string-append "TZDEFAULT=" out
+                                    "/share/zoneinfo/localtime")
 
-                            ;; Likewise for the C library routines.
-                            (string-append "LIBDIR=" tmp "/lib")
-                            (string-append "MANDIR=" tmp "/man")
+                     ;; Likewise for the C library routines.
+                     (string-append "LIBDIR=" tmp "/lib")
+                     (string-append "MANDIR=" tmp "/man")
 
-                            ;; XXX: tzdata 2020b changed the on-disk format
-                            ;; of the time zone files from 'fat' to 'slim'.
-                            ;; Many packages (particularly evolution-data-server)
-                            ;; can not yet handle the latter, so we stick with
-                            ;; 'fat' for now.
-                            ,@(if (version>=? (package-version this-package)
-                                              "2020b")
-                                  '("CPPFLAGS=-DZIC_BLOAT_DEFAULT='\"fat\"'")
-                                  '())
+                     ;; XXX: tzdata 2020b changed the on-disk format
+                     ;; of the time zone files from 'fat' to 'slim'.
+                     ;; Many packages (particularly evolution-data-server)
+                     ;; can not yet handle the latter, so we stick with
+                     ;; 'fat' for now.
+                     #$@(if (version>=? (package-version this-package)
+                                        "2020b")
+                            '("CPPFLAGS=-DZIC_BLOAT_DEFAULT='\"fat\"'")
+                            '())
 
-                            "AWK=awk"
-                            "CC=gcc"))
-       #:modules ((guix build utils)
-                  (guix build gnu-build-system)
-                  (srfi srfi-1))
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'unpack
-           (lambda* (#:key source inputs #:allow-other-keys)
-             (invoke "tar" "xvf" source)
-             (invoke "tar" "xvf" (assoc-ref inputs "tzcode"))))
-         (add-after 'install 'post-install
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Move data in the right place.
-             (let ((out (assoc-ref outputs "out")))
-               ;; Discard zic, dump, and tzselect, already
-               ;; provided by glibc.
-               (delete-file-recursively (string-append out "/usr"))
-               (symlink (string-append out "/share/zoneinfo")
-                        (string-append out "/share/zoneinfo/posix"))
-               (delete-file-recursively
-                (string-append out "/share/zoneinfo-posix"))
-               (copy-recursively (string-append out "/share/zoneinfo-leaps")
-                                 (string-append out "/share/zoneinfo/right"))
-               (delete-file-recursively
-                (string-append out "/share/zoneinfo-leaps")))))
-         (delete 'configure))))
-    (inputs `(("tzcode" ,(origin
-                          (method url-fetch)
-                          (uri (string-append
-                                "https://data.iana.org/time-zones/releases/tzcode"
-                                version ".tar.gz"))
-                          (sha256
-                           (base32
-                            "1l02b0jiwp3fl0xd6227i69d26rmx3yrnq0ssq9vvdmm4jhvyipb"))))))
+                     "AWK=awk"
+                     "CC=gcc"))
+           #:modules '((guix build utils)
+                       (guix build gnu-build-system)
+                       (srfi srfi-1))
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'unpack
+                 (lambda* (#:key source inputs #:allow-other-keys)
+                   (invoke "tar" "xvf" source)
+                   (invoke "tar" "xvf"
+                           #$(match (package-inputs this-package)
+                               (((_ tzcode)) tzcode)))))
+               (add-after 'install 'post-install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   ;; Move data in the right place.
+                   (let ((out (assoc-ref outputs "out")))
+                     ;; Discard zic, dump, and tzselect, already
+                     ;; provided by glibc.
+                     (delete-file-recursively (string-append out "/usr"))
+                     (symlink (string-append out "/share/zoneinfo")
+                              (string-append out "/share/zoneinfo/posix"))
+                     (delete-file-recursively
+                      (string-append out "/share/zoneinfo-posix"))
+                     (copy-recursively (string-append out "/share/zoneinfo-leaps")
+                                       (string-append out "/share/zoneinfo/right"))
+                     (delete-file-recursively
+                      (string-append out "/share/zoneinfo-leaps")))))
+               (delete 'configure))))
+    (inputs (list (origin
+                    (method url-fetch)
+                    (uri (string-append
+                          "https://data.iana.org/time-zones/releases/tzcode"
+                          version ".tar.gz"))
+                    (sha256
+                     (base32
+                      "1l02b0jiwp3fl0xd6227i69d26rmx3yrnq0ssq9vvdmm4jhvyipb")))))
     (home-page "https://www.iana.org/time-zones")
     (synopsis "Database of current and historical time zones")
     (description "The Time Zone Database (often called tz or zoneinfo)
@@ -1338,14 +1342,14 @@ and daylight-saving rules.")
                 (base32
                  "1wxskk9mh1x2073n99qna2mq58mgi648mbq5dxlqfcrnvrbkk0cd"))))
      (inputs
-      `(("tzcode" ,(origin
-                     (method url-fetch)
-                     (uri (string-append
-                           "https://data.iana.org/time-zones/releases/tzcode"
-                           version ".tar.gz"))
-                     (sha256
-                      (base32
-                       "1mgsckixmmk9qxzsflfxnp3999qi3ls72bgksclk01g852x51w3c")))))))))
+      (list (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://data.iana.org/time-zones/releases/tzcode"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "1mgsckixmmk9qxzsflfxnp3999qi3ls72bgksclk01g852x51w3c"))))))))
 
 (define-public libiconv
   (package
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 03/15] gnu: Simplify "Xvbf" invocation in pre-check phases.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 02/15] gnu: tzdata: Remove input labels Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 04/15] gnu: Use 'search-input-directory' when looking for tzdata Ludovic Courtès
                     ` (11 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/geo.scm (qgis)[arguments]: Simplify invocation of 'Xvfb'
in 'check' phase, assuming 'Xvfb' is in $PATH.
* gnu/packages/graphics.scm (opensubdiv)[arguments]: Likewise.
* gnu/packages/java-graphics.scm (java-piccolo2d-extras)[arguments]:
Likewise.
* gnu/packages/kde-frameworks.scm (kcontacts)[arguments]: Likewise.
(kdeclarative)[arguments]: Likewise.
* gnu/packages/kde-multimedia.scm (elisa)[arguments]: Likewise.
* gnu/packages/kde-plasma.scm (kscreenlocker)[arguments]: Likewise.
* gnu/packages/radio.scm (gnuradio)[arguments]: Likewise.
* gnu/packages/education.scm (gcompris-qt)[arguments]: Likewise.
* gnu/packages/freedesktop.scm (weston)[arguments]: Likewise.
---
 gnu/packages/education.scm      | 3 +--
 gnu/packages/freedesktop.scm    | 3 +--
 gnu/packages/geo.scm            | 3 +--
 gnu/packages/graphics.scm       | 3 +--
 gnu/packages/java-graphics.scm  | 3 +--
 gnu/packages/kde-frameworks.scm | 6 ++----
 gnu/packages/kde-multimedia.scm | 3 +--
 gnu/packages/kde-plasma.scm     | 3 +--
 gnu/packages/radio.scm          | 3 +--
 9 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index d815c6e689..14ebe4fffd 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -157,8 +157,7 @@ of categories with some of the activities available in that category.
          (add-before 'check 'start-xorg-server
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The test suite requires a running X server.
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 &"))
+             (system "Xvfb :1 &")
              (setenv "DISPLAY" ":1")
              ;; The test suite wants to write to /homeless-shelter
              (setenv "HOME" (getcwd))
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 5c76e6b8f0..3e052a5697 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1134,8 +1134,7 @@ protocol either in Wayland core, or some other protocol in wayland-protocols.")
          (add-before 'check 'start-xorg-server
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The test suite requires a running X server.
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 &"))
+             (system "Xvfb :1 &")
              (setenv "DISPLAY" ":1")
              #t)))))
     (home-page "https://wayland.freedesktop.org")
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 546be33e55..851bfcfa2e 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -2210,8 +2210,7 @@ growing set of geoscientific methods.")
          (replace 'check
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "HOME" "/tmp")
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 &"))
+             (system "Xvfb :1 &")
              (setenv "DISPLAY" ":1")
              (setenv "TRAVIS" "true")
              (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index e0cade6359..3735a860b1 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -1705,8 +1705,7 @@ requirements.")
                   (add-before 'check 'start-xorg-server
                     (lambda* (#:key inputs #:allow-other-keys)
                       ;; The test suite requires a running X server.
-                      (system (string-append (assoc-ref inputs "xorg-server")
-                                             "/bin/Xvfb :1 &"))
+                      (system "Xvfb :1 &")
                       (setenv "DISPLAY" ":1")
                       #t)))))
     (native-inputs
diff --git a/gnu/packages/java-graphics.scm b/gnu/packages/java-graphics.scm
index f7a89021cd..960579f770 100644
--- a/gnu/packages/java-graphics.scm
+++ b/gnu/packages/java-graphics.scm
@@ -75,8 +75,7 @@ libraries.")
          (add-before 'check 'start-xorg-server
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The test suite requires a running X server.
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 -screen 0 640x480x24 &"))
+             (system "Xvfb :1 -screen 0 640x480x24 &")
              (setenv "DISPLAY" ":1")
              #t)))))
     (inputs
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 7a3b6b26a8..4fd0817753 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -1641,8 +1641,7 @@ integrated it into your application's other widgets.")
              ;; Xvfb doesn't have proper glx support and needs a pixeldepth
              ;; of 24 bit to avoid "libGL error: failed to load driver: swrast"
              ;;                    "Could not initialize GLX"
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 -screen 0 640x480x24 &"))
+             (system "Xvfb :1 -screen 0 640x480x24 &")
              (setenv "DISPLAY" ":1")
              #t)))))
     (home-page "https://community.kde.org/Frameworks")
@@ -2386,8 +2385,7 @@ their settings.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The test suite requires a running X server, setting
              ;; QT_QPA_PLATFORM=offscreen does not suffice.
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 -screen 0 640x480x24 &"))
+             (system "Xvfb :1 -screen 0 640x480x24 &")
              (setenv "DISPLAY" ":1")
              #t)))))
     (home-page "https://community.kde.org/Frameworks")
diff --git a/gnu/packages/kde-multimedia.scm b/gnu/packages/kde-multimedia.scm
index 21ca996246..4e28fe1367 100644
--- a/gnu/packages/kde-multimedia.scm
+++ b/gnu/packages/kde-multimedia.scm
@@ -186,8 +186,7 @@ This package is part of the KDE multimedia module.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The test suite requires a running X server, setting
              ;; QT_QPA_PLATFORM=offscreen does not suffice.
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 -screen 0 640x480x24 &"))
+             (system "Xvfb :1 -screen 0 640x480x24 &")
              (setenv "DISPLAY" ":1")
              #t))
          (replace 'check
diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index b7a2b14f65..96e7ec6907 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -154,8 +154,7 @@ call it if it is not associated to a terminal.")
        (modify-phases %standard-phases
          (add-before 'check 'check-setup
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                   "/bin/Xvfb :1 -screen 0 640x480x24 &"))
+             (system "Xvfb :1 -screen 0 640x480x24 &")
              (setenv "DISPLAY" ":1")
              #t))
          (delete 'check)
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 9a64686c50..26fd22db88 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -571,8 +571,7 @@ used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
          (add-before 'check 'set-test-environment
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "HOME" "/tmp")
-             (system (string-append (assoc-ref inputs "xorg-server")
-                                    "/bin/Xvfb :1 &"))
+             (system "Xvfb :1 &")
              (setenv "DISPLAY" ":1")
              #t))
          (replace 'check
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 04/15] gnu: Use 'search-input-directory' when looking for tzdata.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 02/15] gnu: tzdata: Remove input labels Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 03/15] gnu: Simplify "Xvbf" invocation in pre-check phases Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 05/15] gnu: Use 'search-input-directory' for the SDL header directory Ludovic Courtès
                     ` (10 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/backup.scm (duplicity)[arguments]: Use
'search-input-directory' for "share/zoneinfo".
* gnu/packages/bioinformatics.scm (pigx-rnaseq): Likewise.
(pigx-bsseq): Likewise.
* gnu/packages/calcurse.scm (calcurse): Likewise.
* gnu/packages/calendar.scm (date): Likewise.
* gnu/packages/compression.scm (lhasa): Likewise.
* gnu/packages/cran.scm (r-rstan): Likewise.
* gnu/packages/django.scm (python-django): Likewise.
* gnu/packages/dlang.scm (ldc-bootstrap): Likewise.
* gnu/packages/finance.scm (ledger): Likewise.
* gnu/packages/glib.scm (glib): Likewise.
* gnu/packages/golang.scm (go-1.4): Likewise.
(go-1.14): Likewise.
* gnu/packages/kde-frameworks.scm (kcalendarcore): Likewise.
(kdelibs4support): Likewise.
* gnu/packages/kodi.scm (kodi): Likewise.
* gnu/packages/mail.scm (mu): Likewise.
* gnu/packages/perl.scm (perl-libtime-parsedate): Likewise.
* gnu/packages/python-xyz.scm (python-robotframework): Likewise.
(python-dparse): Likewise.
* gnu/packages/rrdtool.scm (rrdtool): Likewise.
* gnu/packages/statistics.scm (r-with-tests): Likewise.
* gnu/packages/vim.scm (vim): Likewise.
* gnu/packages/virtualization.scm (ganeti): Likewise.
* gnu/packages/vpn.scm (strongswan): Likewise.
* gnu/packages/xfce.scm (xfce4-panel): Likewise.
* gnu/packages/mate.scm (libmateweather): Use 'search-input-file' for
"share/zoneinfo/zone.tab".
---
 gnu/packages/backup.scm         | 3 +--
 gnu/packages/bioinformatics.scm | 8 ++++----
 gnu/packages/calcurse.scm       | 4 ++--
 gnu/packages/calendar.scm       | 4 ++--
 gnu/packages/compression.scm    | 6 +++---
 gnu/packages/cran.scm           | 5 ++---
 gnu/packages/django.scm         | 3 +--
 gnu/packages/dlang.scm          | 2 +-
 gnu/packages/finance.scm        | 4 ++--
 gnu/packages/glib.scm           | 4 ++--
 gnu/packages/golang.scm         | 4 ++--
 gnu/packages/kde-frameworks.scm | 9 ++++-----
 gnu/packages/kodi.scm           | 3 +--
 gnu/packages/mail.scm           | 4 +---
 gnu/packages/mate.scm           | 4 +---
 gnu/packages/perl.scm           | 5 ++---
 gnu/packages/python-xyz.scm     | 8 +++-----
 gnu/packages/rrdtool.scm        | 4 +---
 gnu/packages/statistics.scm     | 5 ++---
 gnu/packages/vim.scm            | 3 +--
 gnu/packages/virtualization.scm | 3 +--
 gnu/packages/vpn.scm            | 5 ++---
 gnu/packages/xfce.scm           | 3 +--
 23 files changed, 42 insertions(+), 61 deletions(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 7bfbffe48c..8deb6a3575 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -134,8 +134,7 @@
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "HOME" (getcwd))   ; gpg needs to write to $HOME
              (setenv "TZDIR"            ; some timestamp checks need TZDIR
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
+                     (search-input-directory inputs "share/zoneinfo"))
              ;; Some things respect TMPDIR, others hard-code /tmp, and the
              ;; defaults don't match up, breaking test_restart.  Fix it.
              (setenv "TMPDIR" "/tmp")
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index ab698fc0e8..adc87ea4dd 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -10324,8 +10324,8 @@ once.  This package provides tools to perform Drop-seq analyses.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZ" "UTC+1")
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo")))))))
+                     (search-input-directory inputs
+                                             "share/zoneinfo")))))))
     (inputs
      `(("coreutils" ,coreutils)
        ("sed" ,sed)
@@ -10475,8 +10475,8 @@ in an easily configurable manner.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZ" "UTC+1")
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo")))))))
+                     (search-input-directory inputs
+                                             "share/zoneinfo")))))))
     (native-inputs
      `(("tzdata" ,tzdata)))
     (inputs
diff --git a/gnu/packages/calcurse.scm b/gnu/packages/calcurse.scm
index d807c15d68..b44f88fea9 100644
--- a/gnu/packages/calcurse.scm
+++ b/gnu/packages/calcurse.scm
@@ -64,8 +64,8 @@
                   (add-before 'check 'check-setup
                     (lambda* (#:key inputs #:allow-other-keys)
                       (setenv "TZDIR"   ; for test/ical-007.sh
-                              (string-append (assoc-ref inputs "tzdata")
-                                             "/share/zoneinfo")))))))
+                              (search-input-directory inputs
+                                                      "share/zoneinfo")))))))
     (home-page "https://www.calcurse.org")
     (synopsis "Text-based calendar and scheduling")
     (description
diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm
index 3c287fc856..d40dc5d6c2 100644
--- a/gnu/packages/calendar.scm
+++ b/gnu/packages/calendar.scm
@@ -96,8 +96,8 @@
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/tz.cpp"
                  (("/usr/share/zoneinfo")
-                  (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
-               #t))
+                  (search-input-directory inputs
+                                          "share/zoneinfo")))))
            (replace 'check
              (lambda _
                ;; Disable test that requires checking timezone that
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 719cd36235..2487515428 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -543,9 +543,9 @@ than gzip and 15 % smaller output than bzip2.")
        (modify-phases %standard-phases
          (add-before 'check 'set-up-test-environment
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
-                                            "/share/zoneinfo"))
-             #t)))))
+             (setenv "TZDIR"
+                     (search-input-directory inputs
+                                             "share/zoneinfo")))))))
     (native-inputs
      `(("tzdata" ,tzdata-for-tests)))
     (home-page "https://fragglet.github.com/lhasa/")
diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index f8c2258c34..4ac4f0895f 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -23885,9 +23885,8 @@ techniques to average Bayesian predictive distributions.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZ" "UTC+1")
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
-             #t)))))
+                     (search-input-directory inputs
+                                             "share/zoneinfo")))))))
     (native-inputs
      `(("tzdata" ,tzdata-for-tests)
        ("pandoc" ,pandoc)
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index d53c06380a..914217a84e 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -64,8 +64,7 @@
              ;; The test-suite tests timezone-dependent functions, thus tzdata
              ;; needs to be available.
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
+                     (search-input-directory inputs "share/zoneinfo"))
 
              ;; Disable test for incorrect timezone: it only raises the
              ;; expected error when /usr/share/zoneinfo exists, even though
diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 88a0887a0a..c782ef928a 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -125,7 +125,7 @@ and freshness without requiring additional information from the user.")
                  (("echo") (which "echo")))
                (substitute* "runtime/phobos/std/datetime.d"
                  (("/usr/share/zoneinfo/")
-                  (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
+                  (search-input-directory inputs "share/zoneinfo"))
                  (("tzName == \"[+]VERSION\"")
                   "(tzName == \"+VERSION\" || std.algorithm.endsWith(tzName, \"/leapseconds\"))"))
                (substitute* "tests/d2/dmd-testsuite/Makefile"
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index b3a8e2b732..efeee664d7 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -343,8 +343,8 @@ and dynamically with report tools based on filtering and graphical charts.")
            ;; One test fails if it can't set the timezone.
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
+                     (search-input-directory inputs
+                                             "share/zoneinfo"))
              ;; Skip failing test BaselineTest_cmd-org.
              ;; This is a known upstream issue. See
              ;; https://github.com/ledger/ledger/issues/550
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index f0be2ddaa4..0c0cfce40c 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -239,8 +239,8 @@ shared NFS home directories.")
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; For tests/gdatetime.c.
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
+                     (search-input-directory inputs
+                                             "share/zoneinfo"))
              ;; Some tests want write access there.
              (setenv "HOME" (getcwd))
              (setenv "XDG_CACHE_HOME" (getcwd))
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1d17f02cdd..05b135b933 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -117,7 +117,7 @@
                     (loader (car (find-files ld "^ld-linux.+")))
                     (net-base (assoc-ref inputs "net-base"))
                     (tzdata-path
-                     (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
+                     (search-input-directory inputs "share/zoneinfo"))
                     (output (assoc-ref outputs "out")))
 
                ;; Removing net/ tests, which fail when attempting to access
@@ -265,7 +265,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
                       (loader (car (find-files ld "^ld-linux.+")))
                       (net-base (assoc-ref inputs "net-base"))
                       (tzdata-path
-                       (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
+                       (search-input-directory inputs "share/zoneinfo"))
                       (output (assoc-ref outputs "out")))
 
                  ;; Having the patch in the 'patches' field of <origin> breaks
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 4fd0817753..b168c38b15 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -451,9 +451,8 @@ GZip format, via a subclass of QIODevice.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZ" "Europe/Prague")
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
-             #t)))))
+                     (search-input-directory inputs
+                                             "share/zoneinfo")))))))
     (home-page "https://community.kde.org/Frameworks")
     (synopsis "Library for interfacing with calendars")
     (description "This library provides access to and handling of calendar
@@ -3689,8 +3688,8 @@ workspace.")
            (lambda* (#:key inputs tests? #:allow-other-keys)
              (setenv "HOME" (getcwd))
              (setenv "TZDIR"    ; KDateTimeTestsome needs TZDIR
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
+                     (search-input-directory inputs
+                                             "share/zoneinfo"))
              ;; Make Qt render "offscreen", required for tests
              (setenv "QT_QPA_PLATFORM" "offscreen")
              ;; enable debug output
diff --git a/gnu/packages/kodi.scm b/gnu/packages/kodi.scm
index b3dc96f925..0ed5d829fb 100644
--- a/gnu/packages/kodi.scm
+++ b/gnu/packages/kodi.scm
@@ -348,8 +348,7 @@ alternatives. In compilers, this can reduce the cascade of secondary errors.")
 
              (substitute* "xbmc/platform/linux/LinuxTimezone.cpp"
                (("/usr/share/zoneinfo")
-                (string-append (assoc-ref inputs "tzdata")
-                               "/share/zoneinfo")))
+                (search-input-directory inputs "share/zoneinfo")))
 
              ;; Don't phone home to check for updates.
              (substitute* "system/addon-manifest.xml"
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index e983fb8b14..007a15ee06 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1204,9 +1204,7 @@ security functionality including PGP, S/MIME, SSH, and SSL.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; For mu/test/test-mu-query.c
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
-             #t))
+                     (search-input-directory inputs "share/zoneinfo"))))
          (add-after 'install 'install-emacs-autoloads
            (lambda* (#:key outputs #:allow-other-keys)
              (emacs-generate-autoloads
diff --git a/gnu/packages/mate.scm b/gnu/packages/mate.scm
index 8d7c618eef..fae85222b1 100644
--- a/gnu/packages/mate.scm
+++ b/gnu/packages/mate.scm
@@ -277,9 +277,7 @@ desktop and the mate-about program.")
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "data/check-timezones.sh"
               (("/usr/share/zoneinfo/zone.tab")
-               (string-append (assoc-ref inputs "tzdata")
-                              "/share/zoneinfo/zone.tab")))
-            #t)))))
+               (search-input-file inputs "/share/zoneinfo/zone.tab"))))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("intltool" ,intltool)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 0d94566925..301ac92ad2 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -11645,9 +11645,8 @@ prop, vhea, vmtx and the reading and writing of all other table types.")
          ;; This is needed for tests
          (add-after 'unpack 'set-TZDIR
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
-                                            "/share/zoneinfo"))
-             #t)))))
+             (setenv "TZDIR"
+                     (search-input-directory inputs "share/zoneinfo")))))))
     (native-inputs
      `(("perl-module-build" ,perl-module-build)
        ("tzdata" ,tzdata-for-tests)))
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7504e9f205..9681dd81fd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4191,8 +4191,7 @@ ecosystem, but can naturally be used also by other projects.")
                       ;;
                       ;; OverflowError: mktime argument out of range
                       (setenv "TZDIR"
-                              (string-append (assoc-ref inputs "tzdata")
-                                             "/share/zoneinfo"))
+                              (search-input-directory inputs "share/zoneinfo"))
                       (setenv "TZ" "Europe/Paris")
 
                       (invoke "python" "utest/run.py"))))))
@@ -24735,9 +24734,8 @@ It adds a simple and readable way to print stuff during development.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZ" "UTC")
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
-             #t)))))
+                     (search-input-directory inputs
+                                             "share/zoneinfo")))))))
     (home-page "https://github.com/scrapinghub/dateparser")
     (synopsis
      "Date parsing library designed to parse dates from HTML pages")
diff --git a/gnu/packages/rrdtool.scm b/gnu/packages/rrdtool.scm
index 13419e4d37..b8b48e21d6 100644
--- a/gnu/packages/rrdtool.scm
+++ b/gnu/packages/rrdtool.scm
@@ -73,9 +73,7 @@
          (add-before 'check 'prepare-test-environment
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
-             #t))
+                     (search-input-directory inputs "share/zoneinfo"))))
          (add-after 'install 'remove-native-input-references
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 3f0706665b..2b4e1607f7 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -296,9 +296,8 @@ as.POSIXct(if (\"\" != Sys.getenv(\"SOURCE_DATE_EPOCH\")) {\
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZ" "UTC+1")
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
-             #t))
+                     (search-input-directory inputs
+                                             "share/zoneinfo"))))
          (add-after 'build 'make-info
           (lambda _ (invoke "make" "info")))
          (add-after 'build 'install-info
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 7a37162116..6145a77dc4 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -109,8 +109,7 @@
            (lambda* (#:key inputs #:allow-other-keys)
              ;; One of the tests tests timezone-dependent functions.
              (setenv "TZDIR"
-                     (string-append (assoc-ref inputs "tzdata")
-                                    "/share/zoneinfo"))
+                     (search-input-directory inputs "share/zoneinfo"))
 
              ;; Make sure the TERM environment variable is set for the tests
              (setenv "TERM" "xterm")
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index a969f1e769..225a7de868 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -597,8 +597,7 @@ server and embedded PowerPC, and S390 guests.")
          (add-before 'check 'pre-check
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Set TZDIR so that time zones are found.
-             (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
-                                            "/share/zoneinfo"))
+             (setenv "TZDIR" (search-input-directory inputs "share/zoneinfo"))
 
              (substitute* "test/py/ganeti.utils.process_unittest.py"
                ;; This test attempts to run an executable with
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index ddde10977c..8e91f19ce4 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -125,9 +125,8 @@ endpoints.")
              #t))
          (add-before 'check 'set-up-test-environment
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
-                                            "/share/zoneinfo"))
-             #t)))
+             (setenv "TZDIR"
+                     (search-input-directory inputs "share/zoneinfo")))))
        #:configure-flags
        (list
         "--disable-ldap"
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 814b567cce..b41c14f18f 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -434,8 +434,7 @@ management D-Bus specification.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* (string-append "plugins/clock/clock.c")
                (("/usr/share/zoneinfo")
-                (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
-             #t)))))
+                (search-input-directory inputs "share/zoneinfo"))))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("intltool" ,intltool)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 05/15] gnu: Use 'search-input-directory' for the SDL header directory.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (2 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 04/15] gnu: Use 'search-input-directory' when looking for tzdata Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 06/15] gnu: Use 'search-input-directory' for the OpenEXR " Ludovic Courtès
                     ` (9 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/education.scm (gcompris)[arguments]: Use
'search-input-directory' when searching for SDL headers.
* gnu/packages/education.scm (t4k-common): Likewise.
(tuxmath): Likewise.
* gnu/packages/game-development.scm (tesseract-engine): Likewise.
* gnu/packages/games.scm (foobillard++): Likewise.
(ltris): Likewise.
(prboom-plus): Likewise.
(abbaye): Likewise.
(red-eclipse): Likewise.
(kiki): Likewise.
(tome4): Likewise.
(btanks): Likewise.
(4dtris): Likewise.
(edgar): Likewise.
* gnu/packages/python-xyz.scm (python-kivy): Likewise.
---
 gnu/packages/education.scm        | 22 +++++-----
 gnu/packages/game-development.scm |  7 ++-
 gnu/packages/games.scm            | 71 ++++++++++++++-----------------
 gnu/packages/python-xyz.scm       |  4 +-
 4 files changed, 46 insertions(+), 58 deletions(-)

diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index 14ebe4fffd..aed7f1f2ab 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -101,10 +101,9 @@
          (add-after 'set-paths 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "sdl-mixer")
-                                    "/include/SDL:"
-                                    (or (getenv "CPATH") "")))
-             #t)))))
+                     (string-append
+                      (search-input-directory inputs "include/SDL")
+                      ":" (or (getenv "CPATH") ""))))))))
     (inputs
      `(("gtk+" ,gtk+-2)
        ("librsvg" ,librsvg)
@@ -894,9 +893,10 @@ endless.  For example:
        (modify-phases %standard-phases
          (add-after 'set-paths 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
-             (setenv "CPATH" (string-append (assoc-ref inputs "sdl")
-                                            "/include/SDL:"
-                                            (or (getenv "CPATH") "")))))
+             (setenv "CPATH"
+                     (string-append
+                      (search-input-directory inputs "/include/SDL")
+                      ":" (or (getenv "CPATH") "")))))
          (add-after 'unpack 'fix-andika-font-path
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "src/t4k_sdl.c"
@@ -945,10 +945,10 @@ TuxMath and TuxType.")
          (add-after 'set-paths 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "sdl")
-                                    "/include/SDL:"
-                                    (or (getenv "CPATH") "")))
-             #t))
+                     (string-append
+                      (search-input-directory inputs "/include/SDL")
+                      ":"
+                      (or (getenv "CPATH") "")))))
          (add-after 'install 'install-desktop-file
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 600940049b..92ab3e4fb5 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2560,10 +2560,9 @@ support.")
            (add-before 'build 'fix-env
              (lambda* (#:key inputs #:allow-other-keys)
                (setenv "CPATH"
-                       (string-append (assoc-ref inputs "sdl2-union")
-                                      "/include/SDL2:"
-                                      (or (getenv "CPATH") "")))
-               #t))
+                       (string-append
+                        (search-input-directory inputs "include/SDL2")
+                        ":" (or (getenv "CPATH") "")))))
            (add-after 'install 'really-install
              (lambda* (#:key outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 483cb87dcb..84b14696af 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -1149,10 +1149,9 @@ characters and lines resulting in a rainbow effect.")
              ;; Set correct environment for SDL.
              (lambda* (#:key inputs #:allow-other-keys)
                (setenv "CPATH"
-                       (string-append (assoc-ref inputs "sdl")
-                                      "/include/SDL:"
-                                      (or (getenv "CPATH") "")))
-               #t))
+                       (string-append
+                        (search-input-directory inputs "include/SDL")
+                        ":" (or (getenv "CPATH") "")))))
            (add-before 'build 'fix-settings-directory
              ;; Hide foobillardplus settings directory in $HOME.
              (lambda _
@@ -1852,10 +1851,9 @@ Chess).  It is similar to standard chess but this variant is far more complicate
          (add-after 'set-paths 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "sdl-union")
-                                    "/include/SDL:"
-                                    (or (getenv "CPATH") "")))
-             #t)))))
+                     (string-append
+                      (search-input-directory inputs "include/SDL")
+                      ":" (or (getenv "CPATH") ""))))))))
     (inputs
      `(("sdl-union" ,(sdl-union (list sdl sdl-mixer)))))
     (home-page "http://lgames.sourceforge.net/LTris/")
@@ -2066,10 +2064,9 @@ Every puzzle has a complete solution, although there may be more than one.")
         (add-after 'set-paths 'set-sdl'paths
           (lambda* (#:key inputs #:allow-other-keys)
             (setenv "CPATH"
-                    (string-append (assoc-ref inputs "sdl-union")
-                                   "/include/SDL:"
-                                   (or (getenv "CPATH") "")))
-            #t)))))
+                    (string-append
+                     (search-input-file inputs "/include/SDL")
+                     ":" (or (getenv "CPATH") ""))))))))
    (inputs
     `(("fluidsynth" ,fluidsynth)
       ("glu" ,glu)
@@ -2909,9 +2906,9 @@ properly.")
                   (add-after 'set-paths 'set-sdl-paths
                     (lambda* (#:key inputs #:allow-other-keys)
                       (setenv "CPATH"
-                              (string-append (assoc-ref inputs "sdl-union")
-                                             "/include/SDL:"
-                                             (or (getenv "CPATH") "")))))
+                              (string-append
+                               (search-input-file inputs "include/SDL")
+                               ":" (or (getenv "CPATH") "")))))
                   (add-after 'patch-source-shebangs 'patch-makefile
                     (lambda* (#:key outputs #:allow-other-keys)
                       ;; Replace /usr with package output directory.
@@ -4857,10 +4854,9 @@ http://lavachat.symlynx.com/unix/")
            (add-after 'set-paths 'set-sdl-paths
              (lambda* (#:key inputs #:allow-other-keys)
                (setenv "CPATH"
-                       (string-append (assoc-ref inputs "sdl-union")
-                                      "/include/SDL2:"
-                                      (or (getenv "CPATH") "")))
-               #t))
+                       (string-append
+                        (search-input-file inputs "/include/SDL2")
+                        ":" (or (getenv "CPATH") "")))))
            (add-after 'install 'copy-data
              (lambda* (#:key outputs #:allow-other-keys)
                (let ((out (assoc-ref outputs "out")))
@@ -6207,11 +6203,10 @@ over 100 user-created campaigns.")
          (replace 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (setenv "CPLUS_INCLUDE_PATH"
-                     (string-append (assoc-ref inputs "sdl-union")
-                                    "/include/SDL:"
-                                    (assoc-ref inputs "python")
-                                    "/include/python2.7:"
-                                    (or (getenv "CPLUS_INCLUDE_PATH") "")))
+                     (string-append
+                      (search-input-directory inputs "include/SDL") ":"
+                      (search-input-directory inputs "include/python2.7")
+                      ":" (or (getenv "CPLUS_INCLUDE_PATH") "")))
              (substitute* "src/main/main.cpp"
                (("#include <SDL.h>" line)
                 (string-append line "
@@ -6942,10 +6937,9 @@ Crowther & Woods, its original authors, in 1995.  It has been known as
                   (add-after 'set-paths 'set-sdl-paths
                     (lambda* (#:key inputs #:allow-other-keys)
                       (setenv "CPATH"
-                              (string-append (assoc-ref inputs "sdl-union")
-                                             "/include/SDL2:"
-                                             (or (getenv "CPATH") "")))
-                      #t))
+                              (string-append
+                               (search-input-directory inputs "/include/SDL2")
+                               ":" (or (getenv "CPATH") "")))))
                   (delete 'check)
                   ;; premake doesn't provide install target
                   (replace 'install
@@ -8580,10 +8574,9 @@ download and unpack them separately.")
          (add-after 'set-paths 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "sdl")
-                                    "/include/SDL:"
-                                    (or (getenv "CPATH") "")))
-             #t))
+                     (string-append
+                      (search-input-file inputs "/include/SDL")
+                      ":" (or (getenv "CPATH") "")))))
          (add-after 'unpack 'fix-compilation-errors
            (lambda _
              (substitute* "mrt/base_file.h"
@@ -8730,10 +8723,9 @@ affected by the gravity of the planets.")
          (add-after 'set-paths 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "sdl")
-                                    "/include/SDL:"
-                                    (or (getenv "CPATH") "")))
-             #t)))))
+                     (string-append
+                      (search-input-file inputs "/include/SDL")
+                      ":" (or (getenv "CPATH") ""))))))))
     (inputs
      `(("fontconfig" ,fontconfig)
        ("freeglut" ,freeglut)
@@ -8849,10 +8841,9 @@ where the player draws runes in real time to effect the desired spell.")
                    (add-before 'build 'fix-env
                      (lambda* (#:key inputs #:allow-other-keys)
                        (setenv "CPATH"
-                               (string-append (assoc-ref inputs "sdl2-union")
-                                              "/include/SDL2:"
-                                              (or (getenv "CPATH") "")))
-                       #t)))))
+                               (string-append
+                                (search-input-file inputs "/include/SDL2")
+                                ":" (or (getenv "CPATH") ""))))))))
     (inputs
      `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))
        ("zlib" ,zlib)))
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9681dd81fd..512b5be234 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -15498,9 +15498,7 @@ and/or Xon/Xoff.  The port is accessed in RAW mode.")
          (add-after 'patch-generated-file-shebangs 'set-sdl-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "KIVY_SDL2_PATH"
-                     (string-append (assoc-ref inputs "sdl-union")
-                                    "/include/SDL2"))
-             #t)))))
+                     (search-input-directory inputs "/include/SDL2")))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("python-cython" ,python-cython)))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 06/15] gnu: Use 'search-input-directory' for the OpenEXR header directory.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (3 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 05/15] gnu: Use 'search-input-directory' for the SDL header directory Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 07/15] gnu: Use 'search-input-file' when searching for Automake files Ludovic Courtès
                     ` (8 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/graphics.scm (blender): Use 'search-input-directory' when
searching for "include/OpenEXR".
(blender-2.79): Likewise.
* gnu/packages/image-processing.scm (opencv): Likewise.
* gnu/packages/image-viewers.scm (luminance-hdr): Likewise.
* gnu/packages/photo.scm (darktable): Likewise.
---
 gnu/packages/graphics.scm         | 16 +++++++---------
 gnu/packages/image-processing.scm |  7 +++----
 gnu/packages/image-viewers.scm    |  9 ++++-----
 gnu/packages/photo.scm            |  8 ++++----
 4 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 3735a860b1..50677fd957 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
 ;;; Copyright © 2016, 2019 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -558,10 +558,9 @@ typically encountered in feature film production.")
                ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
                ;; the CPATH to satisfy the dependency on "half.h".
                (setenv "CPATH"
-                       (string-append (assoc-ref inputs "ilmbase")
-                                      "/include/OpenEXR"
-                                      ":" (or (getenv "CPATH") "")))
-               #t))))))
+                       (string-append
+                        (search-input-directory inputs "include/OpenEXR")
+                        ":" (or (getenv "CPATH") "")))))))))
     (inputs
      `(("boost" ,boost)
        ("jemalloc" ,jemalloc)
@@ -660,10 +659,9 @@ application can be customized via its API for Python scripting.")
                ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
                ;; the CPATH to satisfy the dependency on "half.h".
                (setenv "CPATH"
-                       (string-append (assoc-ref inputs "ilmbase")
-                                      "/include/OpenEXR"
-                                      ":" (or (getenv "CPATH") "")))
-               #t))))))
+                       (string-append
+                        (search-input-directory inputs "include/OpenEXR")
+                        ":" (or (getenv "CPATH") "")))))))))
     (inputs
      `(("boost" ,boost)
        ("jemalloc" ,jemalloc)
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index 7b29c2a215..08754b1b0c 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -512,10 +512,9 @@ integrates with various databases on GUI toolkits such as Qt and Tk.")
            ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
            ;; the CPATH to satisfy the dependency on "ImathVec.h".
            (setenv "CPATH"
-                   (string-append (assoc-ref inputs "ilmbase")
-                                  "/include/OpenEXR"
-                                  ":" (or (getenv "CPATH") "")))
-           #t))
+                   (string-append
+                    (search-input-directory inputs "include/OpenEXR")
+                    ":" (or (getenv "CPATH") "")))))
        (add-before 'check 'start-xserver
          (lambda* (#:key inputs #:allow-other-keys)
            (let ((xorg-server (assoc-ref inputs "xorg-server"))
diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index f01b6a614a..744337ec94 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -385,10 +385,9 @@ It supports JPEG, PNG and GIF formats.")
              ;; not use 'OpenEXR.pc'.  Thus, we need to add
              ;; "$ilmbase/include/OpenEXR/" to the CPATH.
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "ilmbase")
-                                    "/include/OpenEXR"
-                                    ":" (or (getenv "CPATH") "")))
-             #t)))))
+                     (string-append
+                      (search-input-directory inputs "include/OpenEXR")
+                      ":" (or (getenv "CPATH") ""))))))))
     (home-page "http://qtpfsgui.sourceforge.net")
     (synopsis "High dynamic range (HDR) imaging application")
     (description
diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index ae2806d243..7720492d2c 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2017, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2017 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -506,9 +506,9 @@ photographic equipment.")
 
              ;; Ensure the OpenEXR headers are found.
              (setenv "CPATH"
-                     (string-append (assoc-ref inputs "ilmbase")
-                                    "/include/OpenEXR:" (or (getenv "CPATH") "")))
-             #t))
+                     (string-append
+                      (search-input-directory inputs "include/OpenEXR")
+                      ":" (or (getenv "CPATH") "")))))
          (add-after 'install 'wrap-program
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (wrap-program (string-append (assoc-ref outputs "out")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 07/15] gnu: Use 'search-input-file' when searching for Automake files.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (4 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 06/15] gnu: Use 'search-input-directory' for the OpenEXR " Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 08/15] gnu: Use 'search-input-directory' for the Eigen header directory Ludovic Courtès
                     ` (7 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/audio.scm (libsbsms)[arguments]: Use 'search-input-file'
when searching for Automake file.
* gnu/packages/maths.scm (hdf-java): Likewise.
---
 gnu/packages/audio.scm |  6 ++++--
 gnu/packages/maths.scm | 10 ++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 09330c3bd3..203965f4c6 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -3350,8 +3350,10 @@ analysis plugins or audio feature extraction plugins.")
             ;; Originally a symlink to '/usr/local/share/automake-1.12/ar-lib'.
             (delete-file "ar-lib")
             (symlink
-             (string-append (assoc-ref inputs "automake") "/share/automake-"
-                            ,(package-version automake) "/ar-lib")
+             (search-input-file inputs
+                                (string-append "/share/automake-"
+                                               ,(package-version automake)
+                                               "/ar-lib"))
              "ar-lib")
             #t)))))
     (home-page "http://sbsms.sourceforge.net/")
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 3b41d1bfd7..1ddeb93002 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1354,10 +1354,12 @@ extremely large and complex data collections.")
              (with-directory-excursion "config"
                (for-each (lambda (file)
                            (install-file
-                            (string-append (assoc-ref inputs "automake")
-                                           "/share/automake-"
-                                           ,(version-major+minor (package-version automake))
-                                           "/" file) "."))
+                            (search-input-file inputs
+                                               (string-append
+                                                "/share/automake-"
+                                                ,(version-major+minor (package-version automake))
+                                                "/" file))
+                            "."))
                          '("config.sub" "config.guess")))
 
              ;; Fix embedded version number
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 08/15] gnu: Use 'search-input-directory' for the Eigen header directory.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (5 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 07/15] gnu: Use 'search-input-file' when searching for Automake files Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 09/15] gnu: Use 'search-input-directory' for glibc locale data Ludovic Courtès
                     ` (6 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/bioinformatics.scm (sailfish)[arguments]: Use
'search-input-directory' when searching for Eigen headers.
* gnu/packages/bioinformatics.scm (nanopolish): Likewise.
* gnu/packages/machine-learning.scm (tensorflow): Likewise.
---
 gnu/packages/bioinformatics.scm   | 15 +++++++--------
 gnu/packages/machine-learning.scm |  2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index adc87ea4dd..6bd56ca085 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -9499,10 +9499,10 @@ dependency like SeqAn.")
 
              ;; Ensure that Eigen headers can be found
              (setenv "CPLUS_INCLUDE_PATH"
-                     (string-append (assoc-ref inputs "eigen")
-                                    "/include/eigen3:"
-                                    (or (getenv "CPLUS_INCLUDE_PATH") "")))
-             #t)))))
+                     (string-append (search-input-directory
+                                     inputs "/include/eigen3")
+                                    ":"
+                                    (or (getenv "CPLUS_INCLUDE_PATH") ""))))))))
     (inputs
      `(("boost" ,boost)
        ("eigen" ,eigen)
@@ -12456,10 +12456,9 @@ choosing which reads pass the filter.")
            (add-after 'unpack 'find-eigen
              (lambda* (#:key inputs #:allow-other-keys)
                (setenv "CPATH"
-                       (string-append (assoc-ref inputs "eigen")
-                                      "/include/eigen3:"
-                                      (or (getenv "CPATH") "")))
-               #t))
+                       (string-append
+                        (search-input-directory inputs "/include/eigen3")
+                        ":" (or (getenv "CPATH") "")))))
            (delete 'configure)
            (replace 'install
              (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3918d32d2f..3f257df832 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1707,7 +1707,7 @@ set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive "
                 (string-append (getcwd) "/eigen-src/"))
                ;; Take Eigen headers from our own package.
                (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/external/eigen_archive")
-                (string-append (assoc-ref inputs "eigen") "/include/eigen3")))
+                (search-input-directory inputs "/include/eigen3")))
 
              ;; Correct the RUNPATH of ops libraries generated for Python.
              ;; TODO: this doesn't work :(
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 09/15] gnu: Use 'search-input-directory' for glibc locale data.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (6 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 08/15] gnu: Use 'search-input-directory' for the Eigen header directory Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 10/15] gnu: Use 'search-input-directory' when looking for C/C++ library headers Ludovic Courtès
                     ` (5 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/gnome.scm (gnome-desktop)[arguments]: Use
'search-input-directory' when searching for glibc's "lib/locale".
* gnu/packages/gnome.scm (geocode-glib): Likewise.
* gnu/packages/package-management.scm (flatpak): Likewise.
---
 gnu/packages/gnome.scm              | 9 +++------
 gnu/packages/package-management.scm | 4 ++--
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index f78c8ae6aa..4f63b6bf38 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -2179,9 +2179,8 @@ offline sources, providing a centralized place for managing your contacts.")
              (system "Xvfb :1 &")
              (setenv "DISPLAY" ":1")
              (setenv "GUIX_LOCPATH"
-                     (string-append (assoc-ref inputs "glibc-locales")
-                                    "/lib/locale"))
-             #t)))))
+                     (search-input-directory inputs
+                                             "lib/locale")))))))
     (native-inputs
      `(("glib:bin" ,glib "bin") ; for gdbus-codegen
        ("glibc-locales" ,glibc-locales) ; for tests
@@ -5315,9 +5314,7 @@ permission from user.")
          (add-before 'check 'set-locales
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "GUIX_LOCPATH"
-                     (string-append (assoc-ref inputs "glibc-locales")
-                                    "/lib/locale"))
-             #t)))))
+                     (search-input-directory inputs "lib/locale")))))))
     (native-inputs
      `(("glib:bin" ,glib "bin") ; for glib-mkenums
        ("glibc-locales" ,glibc-locales) ; for tests
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 4e1543a485..e7dd5dc29f 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -1393,8 +1393,8 @@ the boot loader configuration.")
         (add-after 'unpack 'fix-tests
           (lambda* (#:key inputs #:allow-other-keys)
             (copy-recursively
-             (string-append (assoc-ref inputs "glibc-utf8-locales")
-                            "/lib/locale/") "/tmp/locale")
+             (search-input-directory inputs "lib/locale")
+             "/tmp/locale")
             (for-each make-file-writable (find-files "/tmp"))
             (substitute* "tests/make-test-runtime.sh"
               (("cp `which.*") "echo guix\n")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 10/15] gnu: Use 'search-input-directory' when looking for C/C++ library headers.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (7 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 09/15] gnu: Use 'search-input-directory' for glibc locale data Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 11/15] gnu: Use 'search-input-file' when looking for *.so and *.a Ludovic Courtès
                     ` (4 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/arcan.scm (arcan)[arguments]: Use
'search-input-directory' for "include/libdrm" and "include/apr-1".
* gnu/packages/bioinformatics.scm (sailfish): Likewise for jellyfish.
* gnu/packages/boost.scm (boost-for-irods): Likewise for libcxx headers.
* gnu/packages/cedille.scm (cedille): Likewise for IAL headers.
* gnu/packages/compression.scm (snappy-with-clang6): Likewise for libcxx
headers.
* gnu/packages/cups.scm (hplip): Likewise for libusb headers.
* gnu/packages/emulators.scm (pcsxr): Likewise for libcdio headers.
* gnu/packages/game-development.scm (python2-renpy): Likewise for
fribidi headers.
* gnu/packages/games.scm (pokerth): Likewise for libircclient.
* gnu/packages/guile-xyz.scm (guile-persist): Likewise for Guile.
* gnu/packages/hurd.scm (hurd): Likewise for libtirpc.
* gnu/packages/irods.scm (irods, irods-client-icommands): Likewise for
libcxx, catch2, and nlohmann-json-cpp.
* gnu/packages/julia.scm (julia): Use 'search-input-file' for libuv's
errno.h.
* gnu/packages/kde-pim.scm (kdepim-runtime): Use
'search-input-directory' for "include/KF5".
(kmessagelib): Likewise.
* gnu/packages/kde.scm (kdeconnect): Likewise.
* gnu/packages/llvm.scm (clang-runtime-3.5): Likewise for libtirpc.
* gnu/packages/mpi.scm (openmpi): Likewise for "include/infiniband".
* gnu/packages/pumpio.scm (pumpa): Use 'search-input-file' for "tidy.h"
and "aspell.h".
* gnu/packages/radio.scm (dream): Use 'search-input-file' and
'search-input-directory' for pulseaudio, sndfile, etc.
* gnu/packages/selinux.scm (policycoreutils): Likewise for PAM and
libaudit.
* gnu/packages/serialization.scm (avro-cpp-1.9-for-irods): Likewise for
libcxx.
* gnu/packages/sync.scm (nextcloud-client): Likewise for "include/KF5".
* gnu/packages/video.scm (mkvtoolnix): Likewise for "include/gtest".
(libopenshot): Likewise for "include/UnitTest++".
* gnu/packages/virtualization.scm (criu): Likewise for libnl3 and for
protobuf file.
---
 gnu/packages/arcan.scm            |  6 ++----
 gnu/packages/bioinformatics.scm   |  5 +++--
 gnu/packages/boost.scm            |  3 +--
 gnu/packages/cedille.scm          |  3 +--
 gnu/packages/compression.scm      |  4 ++--
 gnu/packages/cups.scm             |  5 ++---
 gnu/packages/emulators.scm        |  3 +--
 gnu/packages/game-development.scm |  4 +---
 gnu/packages/games.scm            |  3 +--
 gnu/packages/guile-xyz.scm        |  2 +-
 gnu/packages/hurd.scm             |  9 +++++----
 gnu/packages/irods.scm            | 17 +++++++----------
 gnu/packages/julia.scm            |  4 +---
 gnu/packages/kde-pim.scm          | 14 ++++++--------
 gnu/packages/kde.scm              | 10 ++++------
 gnu/packages/llvm.scm             | 13 ++++++-------
 gnu/packages/mpi.scm              |  9 ++++-----
 gnu/packages/pretty-print.scm     |  5 ++---
 gnu/packages/pumpio.scm           |  6 ++----
 gnu/packages/radio.scm            | 18 ++++++------------
 gnu/packages/selinux.scm          |  4 ++--
 gnu/packages/serialization.scm    |  3 +--
 gnu/packages/sync.scm             |  5 ++---
 gnu/packages/video.scm            | 11 ++++-------
 gnu/packages/virtualization.scm   | 12 ++++++------
 25 files changed, 73 insertions(+), 105 deletions(-)

diff --git a/gnu/packages/arcan.scm b/gnu/packages/arcan.scm
index a84bf0d8dd..0ab157b525 100644
--- a/gnu/packages/arcan.scm
+++ b/gnu/packages/arcan.scm
@@ -75,12 +75,10 @@
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/platform/cmake/modules/FindGBMKMS.cmake"
                  (("/usr/local/include/libdrm")
-                  (string-append (assoc-ref inputs "libdrm")
-                                 "/include/libdrm")))
+                  (search-input-directory inputs "include/libdrm")))
                (substitute* "src/platform/cmake/modules/FindAPR.cmake"
                  (("/usr/local/apr/include/apr-1")
-                  (string-append (assoc-ref inputs "apr")
-                                 "/include/apr-1")))
+                  (search-input-directory inputs "include/apr-1")))
                #t))
            ;; Normally, it tries to fetch patched openal with git
            ;; but copying files manually in the right place seems to work too.
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 6bd56ca085..6adc6a0276 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -9477,8 +9477,9 @@ dependency like SeqAn.")
                (("#include \"jellyfish/config.h\"") ""))
              (substitute* "src/CMakeLists.txt"
                (("\\$\\{GAT_SOURCE_DIR\\}/external/install/include/jellyfish-2.2..")
-                (string-append (assoc-ref inputs "jellyfish")
-                               "/include/jellyfish-" ,(package-version jellyfish)))
+                (search-input-directory
+                 inputs
+                 (string-append "/include/jellyfish-" ,(package-version jellyfish))))
                (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libjellyfish-2.0.a")
                 (string-append (assoc-ref inputs "jellyfish")
                                "/lib/libjellyfish-2.0.a"))
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 14b6734ed7..8b6bea30c4 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -238,8 +238,7 @@ across a broad spectrum of applications.")
              (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
                (setenv "CPLUS_INCLUDE_PATH"
                        (string-join
-                        (cons (string-append (assoc-ref inputs "libcxx")
-                                             "/include/c++/v1")
+                        (cons (search-input-directory inputs "/include/c++/v1")
                               ;; Hide GCC's C++ headers so that they do not interfere with
                               ;; the Clang headers.
                               (delete (string-append gcc "/include/c++")
diff --git a/gnu/packages/cedille.scm b/gnu/packages/cedille.scm
index d3dd576323..decaf25605 100644
--- a/gnu/packages/cedille.scm
+++ b/gnu/packages/cedille.scm
@@ -89,8 +89,7 @@
          (add-after 'unpack 'copy-ial
            (lambda* (#:key inputs #:allow-other-keys)
              (copy-recursively
-              (string-append (assoc-ref inputs "agda-ial")
-                             "/include/agda/ial")
+              (search-input-directory inputs "/include/agda/ial")
               "ial")
              ;; Ambiguous module if main is included from ial
              (delete-file "ial/main.agda")
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 2487515428..54c85cc64b 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -1211,8 +1211,8 @@ for most inputs, but the resulting compressed files are anywhere from 20% to
              (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
                (setenv "CPLUS_INCLUDE_PATH"
                        (string-join
-                        (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
-                                              "/include/c++/v1")
+                        (cons* (search-input-directory inputs
+                                                       "/include/c++/v1")
                                ;; Hide GCC's C++ headers so that they do not interfere with
                                ;; the Clang headers.
                                (delete (string-append gcc "/include/c++")
diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm
index 98c7d9b12e..eb3fac3742 100644
--- a/gnu/packages/cups.scm
+++ b/gnu/packages/cups.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
@@ -600,8 +600,7 @@ should only be used as part of the Guix cups-pk-helper service.")
                  ;; FIXME Use beginning-of-word in regexp.
                  (("[[:blank:]]plugin\\.py[[:blank:]]") " ")
                  (("/usr/include/libusb-1.0")
-                  (string-append (assoc-ref inputs "libusb")
-                                 "/include/libusb-1.0"))
+                  (search-input-directory inputs "/include/libusb-1.0"))
                  (("hplip_statedir =.*$")
                   ;; Don't bail out while trying to create
                   ;; /var/lib/hplip.  We can safely change its value
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 84c6b0624f..e458d24cab 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -1914,8 +1914,7 @@ emulator.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "cmake/FindCdio.cmake"
                  (("/usr/include/cdio")
-                  (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
-               #t))
+                  (search-input-directory inputs "/include/cdio")))))
            (add-after 'install 'wrap-program
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (wrap-program (string-append (assoc-ref outputs "out")
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 92ab3e4fb5..80f8c77c73 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1195,9 +1195,7 @@ developed mainly for Ren'py.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "module/setup.py"
                (("/usr/include/fribidi")
-                (string-append (assoc-ref inputs "fribidi")
-                               "/include/fribidi")))
-             #t))
+                (search-input-directory inputs "include/fribidi")))))
          (add-after 'set-paths 'set-build-vars
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "RENPY_CYTHON"
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 84b14696af..17c61dd387 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -12242,8 +12242,7 @@ game.")  ;thanks to Debian for description
                (("/opt/gsasl")
                 (assoc-ref inputs "gsasl"))
                (("\\$\\$\\{PREFIX\\}/include/libircclient")
-                (string-append (assoc-ref inputs "libircclient")
-                               "/include/libircclient"))
+                (search-input-directory inputs "/include/libircclient"))
                (("LIB_DIRS =")
                 (string-append "LIB_DIRS = "
                                (assoc-ref inputs "boost") "/lib")))
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 5e63075751..2874928883 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -2875,7 +2875,7 @@ chunks can be expressions as well as simple tokens.")
                (("/usr/local/lib/guile")
                 (string-append (assoc-ref outputs "out") "/lib/guile"))
                (("/usr/local/include/guile")
-                (string-append (assoc-ref inputs "guile") "/include/guile"))
+                (search-input-directory inputs "/include/guile"))
                (("-L/usr/local/lib")
                 (string-append "-L" (assoc-ref inputs "guile") "/lib")))
              #t))
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 59a7b55943..e45f755e3b 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2016, 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2018, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
@@ -378,9 +378,10 @@ Hurd-minimal package which are needed for both glibc and GCC.")
            (lambda* (#:key inputs #:allow-other-keys)
              (for-each (lambda (var)
                          (setenv var
-                                 (string-append (assoc-ref inputs "libtirpc")
-                                                "/include/tirpc:"
-                                                (or (getenv var) ""))))
+                                 (string-append
+                                  (search-input-directory inputs
+                                                          "include/tirpc")
+                                  ":" (or (getenv var) ""))))
                        '("CROSS_C_INCLUDE_PATH" "C_INCLUDE_PATH"
                          "CROSS_CPATH" "CPATH"))
              #t))
diff --git a/gnu/packages/irods.scm b/gnu/packages/irods.scm
index bb0263682c..e82888e7ae 100644
--- a/gnu/packages/irods.scm
+++ b/gnu/packages/irods.scm
@@ -126,12 +126,9 @@
              (let ((gcc (assoc-ref inputs  "gcc")))
                (setenv "CPLUS_INCLUDE_PATH"
                        (string-join
-                        (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
-                                              "/include/c++/v1")
-                               (string-append (assoc-ref inputs "catch2")
-                                              "/include/catch2")
-                               (string-append (assoc-ref inputs "json")
-                                              "/include/nlohmann")
+                        (cons* (search-input-directory inputs "/include/c++/v1")
+                               (search-input-directory inputs "/include/catch2")
+                               (search-input-directory inputs "/include/nlohmann")
                                ;; Hide GCC's C++ headers so that they do not interfere with
                                ;; the Clang headers.
                                (delete (string-append gcc "/include/c++")
@@ -231,10 +228,10 @@ stored.")
              (let ((gcc (assoc-ref inputs  "gcc")))
                (setenv "CPLUS_INCLUDE_PATH"
                        (string-join
-                        (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
-                                              "/include/c++/v1")
-                               (string-append (assoc-ref inputs "json")
-                                              "/include/nlohmann")
+                        (cons* (search-input-directory inputs
+                                                       "include/c++/v1")
+                               (search-input-directory inputs
+                                                       "include/nlohmann")
                                ;; Hide GCC's C++ headers so that they do not interfere with
                                ;; the Clang headers.
                                (delete (string-append gcc "/include/c++")
diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index 13c9f7baf1..52dfc95a4d 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -312,9 +312,7 @@ libraries.  It is also a bit like @code{ldd} and @code{otool -L}.")
 
              (substitute* "base/Makefile"
                (("\\$\\(build_includedir\\)/uv/errno.h")
-                (string-append (assoc-ref inputs "libuv")
-                               "/include/uv/errno.h")))
-             #t))
+                (search-input-file inputs "/include/uv/errno.h")))))
          (add-before 'build 'replace-default-shell
            (lambda _
              (substitute* "base/client.jl"
diff --git a/gnu/packages/kde-pim.scm b/gnu/packages/kde-pim.scm
index db73941b42..0c7fa77b1e 100644
--- a/gnu/packages/kde-pim.scm
+++ b/gnu/packages/kde-pim.scm
@@ -757,10 +757,9 @@ for KDE PIM.")
                       ;; found during one of the compilation steps without
                       ;; this hack.
                       (setenv "CPLUS_INCLUDE_PATH"
-                              (string-append (assoc-ref inputs "akonadi-mime")
-                                             "/include/KF5:"
-                                             (or (getenv "CPLUS_INCLUDE_PATH") "")))
-                      #t)))))
+                              (string-append
+                               (search-input-directory inputs "include/KF5")
+                               ":" (or (getenv "CPLUS_INCLUDE_PATH") ""))))))))
     (home-page "https://invent.kde.org/pim/kdepim-runtime")
     (synopsis "Runtime components for Akonadi KDE")
     (description "This package contains Akonadi agents written using KDE
@@ -1369,10 +1368,9 @@ using a Qt/KMime C++ API.")
                       ;; FIXME: One of the compilation steps fail to find
                       ;; <Libkdepim/MultiplyingLine> without this hack.
                       (setenv "CPLUS_INCLUDE_PATH"
-                              (string-append (assoc-ref inputs "libkdepim")
-                                             "/include/KF5:"
-                                             (or (getenv "CPLUS_INCLUDE_PATH") "")))
-                      #t)))))
+                              (string-append
+                               (search-input-directory inputs "include/KF5")
+                               ":" (or (getenv "CPLUS_INCLUDE_PATH") ""))))))))
     (home-page "https://invent.kde.org/pim/messagelib")
     (synopsis "KDE PIM messaging libraries")
     (description "This package provides several libraries for messages,
diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm
index 1184aa5662..65ba80a7c7 100644
--- a/gnu/packages/kde.scm
+++ b/gnu/packages/kde.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018, 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
-;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Prafulla Giri <pratheblackdiamond@gmail.com>
@@ -721,11 +721,9 @@ different notification systems.")
                       ;; FIXME: <kcmutils_version.h> is not found during one
                       ;; of the compilation steps without this hack.
                       (setenv "CPLUS_INCLUDE_PATH"
-                              (string-append (assoc-ref inputs "kcmutils")
-                                             "/include/KF5:"
-                                             (or (getenv "CPLUS_INCLUDE_PATH")
-                                                 "")))
-                      #t)))
+                              (string-append
+                               (search-input-directory inputs "include/KF5")
+                               ":" (or (getenv "CPLUS_INCLUDE_PATH") ""))))))
        #:tests? #f)) ; tests fail hard in our build environment
     (native-inputs
      `(("extra-cmake-modules" ,extra-cmake-modules)
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 38da28150b..f39a3ad49d 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -855,14 +855,13 @@ of programming tools as well as libraries with equivalent functionality.")
              (add-after 'unpack 'find-rpc-includes
                (lambda* (#:key inputs #:allow-other-keys)
                  (setenv "CPATH"
-                         (string-append (assoc-ref inputs "libtirpc")
-                                        "/include/tirpc/:"
-                                        (or (getenv "CPATH") "")))
+                         (string-append
+                          (search-input-directory inputs "/include/tirpc")
+                          ":" (or (getenv "CPATH") "")))
                  (setenv "CPLUS_INCLUDE_PATH"
-                         (string-append (assoc-ref inputs "libtirpc")
-                                        "/include/tirpc/:"
-                                        (or (getenv "CPLUS_INCLUDE_PATH") "")))
-                 #t))))))
+                         (string-append
+                          (search-input-directory inputs "/include/tirpc")
+                          ":" (or (getenv "CPLUS_INCLUDE_PATH") "")))))))))
       (inputs
        `(("libtirpc" ,libtirpc)
          ("llvm" ,llvm-3.5))))))
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 2011cbcd29..af1de10377 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -263,12 +263,11 @@ bind processes, and much more.")
                   (add-after 'unpack 'find-opensm-headers
                     (lambda* (#:key inputs #:allow-other-keys)
                       (setenv "C_INCLUDE_PATH"
-                              (string-append (assoc-ref inputs "opensm")
-                                             "/include/infiniband"))
+                              (search-input-directory inputs
+                                                      "/include/infiniband"))
                       (setenv "CPLUS_INCLUDE_PATH"
-                              (string-append (assoc-ref inputs "opensm")
-                                             "/include/infiniband"))
-                      #t))
+                              (search-input-directory inputs
+                                                      "/include/infiniband"))))
                   (add-before 'build 'remove-absolute
                     (lambda _
                       ;; Remove compiler absolute file names (OPAL_FC_ABSOLUTE
diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index 1fc1441052..d7a5ddc8e5 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2016, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
 ;;; Copyright © 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
@@ -217,8 +217,7 @@ to @code{IOStreams}.")
              (let ((gcc (assoc-ref inputs "gcc")))
                (setenv "CPLUS_INCLUDE_PATH"
                        (string-join
-                        (cons (string-append (assoc-ref inputs "libcxx")
-                                             "/include/c++/v1")
+                        (cons (search-input-directory inputs "/include/c++/v1")
                               ;; Hide GCC's C++ headers so that they do not interfere with
                               ;; the Clang headers.
                               (delete (string-append gcc "/include/c++")
diff --git a/gnu/packages/pumpio.scm b/gnu/packages/pumpio.scm
index f8a60af760..1cdb2fdd88 100644
--- a/gnu/packages/pumpio.scm
+++ b/gnu/packages/pumpio.scm
@@ -50,11 +50,9 @@
              ;; Fix dependency tests.
              (substitute* "pumpa.pro"
                (("/usr/include/tidy\\.h")
-                (string-append (assoc-ref inputs "tidy")
-                               "/include/tidy.h"))
+                (search-input-file inputs "/include/tidy.h"))
                (("/usr/include/aspell.h")
-                (string-append (assoc-ref inputs "aspell")
-                               "/include/aspell.h")))
+                (search-input-file inputs "/include/aspell.h")))
              ;; Run qmake with proper installation prefix.
              (let ((prefix (string-append "PREFIX="
                                           (assoc-ref outputs "out"))))
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 26fd22db88..c55cd55ac5 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -1723,23 +1723,17 @@ Compatible hardware/software:
                                (assoc-ref outputs "out")
                                "/share/man/man1"))
                (("/usr/include/pulse/")
-                (string-append (assoc-ref inputs "pulseaudio")
-                               "/include/pulse/"))
+                (search-input-directory inputs "include/pulse"))
                (("/usr/include/sndfile\\.h")
-                (string-append (assoc-ref inputs "libsndfile")
-                               "/include/sndfile.h"))
+                (search-input-file inputs "/include/sndfile.h"))
                (("/usr/include/opus/")
-                (string-append (assoc-ref inputs "opus")
-                               "/include/opus/"))
+                (search-input-directory inputs "include/opus"))
                (("/usr/include/speex/")
-                (string-append (assoc-ref inputs "speexdsp")
-                               "/include/speex/"))
+                (search-input-directory inputs "include/speex"))
                (("/usr/include/qwt/")
-                (string-append (assoc-ref inputs "qwt")
-                               "/include/qwt/"))
+                (search-input-directory inputs "include/qwt"))
                (("\\$\\$OUT_PWD/include/neaacdec\\.h")
-                (string-append (assoc-ref inputs "faad2")
-                               "/include/neaacdec.h")))))
+                (search-input-file inputs "/include/neaacdec.h")))))
          (replace 'configure
            (lambda _
              (invoke "qmake"))))))
diff --git a/gnu/packages/selinux.scm b/gnu/packages/selinux.scm
index 41b8fdcbe1..e7e6289d1c 100644
--- a/gnu/packages/selinux.scm
+++ b/gnu/packages/selinux.scm
@@ -397,9 +397,9 @@ tools, and libraries designed to facilitate SELinux policy analysis.")
                             "setfiles/Makefile"
                             "run_init/Makefile")
                (("/usr(/include/security/pam_appl.h)" _ file)
-                (string-append (assoc-ref inputs "pam") file))
+                (search-input-file inputs file))
                (("/usr(/include/libaudit.h)" _ file)
-                (string-append (assoc-ref inputs "audit") file))))))))
+                (search-input-file inputs file))))))))
     (inputs
      `(("audit" ,audit)
        ("pam" ,linux-pam)
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 95c7dcee63..7fd083f93d 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -107,8 +107,7 @@ implement RPC protocols.")
              (let ((gcc (assoc-ref inputs  "gcc")))
                (setenv "CPLUS_INCLUDE_PATH"
                        (string-join
-                        (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
-                                              "/include/c++/v1")
+                        (cons* (search-input-directory inputs "include/c++/v1")
                                ;; Hide GCC's C++ headers so that they do not interfere with
                                ;; the Clang headers.
                                (delete (string-append gcc "/include/c++")
diff --git a/gnu/packages/sync.scm b/gnu/packages/sync.scm
index c85b4f801c..d36e200def 100644
--- a/gnu/packages/sync.scm
+++ b/gnu/packages/sync.scm
@@ -156,9 +156,8 @@
                (("ON CACHE") "OFF CACHE"))
              (substitute* "src/gui/CMakeLists.txt"
                (("@kwidgetsaddons@")
-                (string-append (assoc-ref inputs "kwidgetsaddons")
-                               "/include/KF5/KWidgetsAddons/")))
-             #t))
+                (search-input-directory inputs
+                                        "/include/KF5/KWidgetsAddons/")))))
          (add-before 'check 'pre-check
            (lambda _
              ;; Tests write to $HOME.
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 44d215c69c..3fe6d11653 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -974,10 +974,8 @@ H.264 (MPEG-4 AVC) video streams.")
              #t)))
          (add-before 'configure 'add-googletest
            (lambda* (#:key inputs #:allow-other-keys)
-             (symlink
-               (string-append (assoc-ref inputs "googletest")
-                              "/include/gtest") "lib/gtest")
-             #t))
+             (symlink (search-input-file inputs "/include/gtest")
+                      "lib/gtest")))
          (replace 'build
            (lambda _
              (let ((-j (list "-j" (number->string (parallel-job-count)))))
@@ -4537,9 +4535,8 @@ create smoother and stable videos.")
              (setenv "ZMQDIR"
                      (assoc-ref inputs "zeromq"))
              (setenv "UNITTEST_DIR"
-                     (string-append (assoc-ref inputs "unittest++")
-                                    "/include/UnitTest++"))
-             #t)))))
+                     (search-input-directory inputs
+                                             "include/UnitTest++")))))))
     (home-page "https://openshot.org")
     (synopsis "Video-editing, animation, and playback library")
     (description "OpenShot Library (libopenshot) is a powerful C++ video
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 225a7de868..b0041de976 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1340,10 +1340,9 @@ domains, their live performance and resource utilization statistics.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The includes for libnl are located in a sub-directory.
              (setenv "C_INCLUDE_PATH"
-                     (string-append (assoc-ref inputs "libnl")
-                                    "/include/libnl3:"
-                                    (or (getenv "C_INCLUDE_PATH") "")))
-             #t))
+                     (string-append
+                      (search-input-directory inputs "/include/libnl3")
+                      ":" (or (getenv "C_INCLUDE_PATH") "")))))
          (add-after 'configure 'fix-documentation
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (substitute* "Documentation/Makefile"
@@ -1374,8 +1373,9 @@ domains, their live performance and resource utilization statistics.")
              ;; /usr/include/..., which obviously does not exist.
              (let* ((file "google/protobuf/descriptor.proto")
                     (target (string-append "images/" file))
-                    (source (string-append (assoc-ref inputs "protobuf")
-                                           "/include/" file)))
+                    (source (search-input-file
+                             inputs
+                             (string-append "include/" file))))
                (delete-file target)
                (symlink source target)
                #t)))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 11/15] gnu: Use 'search-input-file' when looking for *.so and *.a.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (8 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 10/15] gnu: Use 'search-input-directory' when looking for C/C++ library headers Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 12/15] gnu: Use 'search-input-file' when looking for executables Ludovic Courtès
                     ` (3 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/bioinformatics.scm (sailfish)[arguments]: Use
'search-input-file' when looking for *.a and *.so.
* gnu/packages/emulators.scm (dolphin-emu): Likewise.
* gnu/packages/engineering.scm (lepton-eda): Likewise.
(pcb): Likewise.
* gnu/packages/golang.scm (go-1.4): Likewise.
(go-1.14): Likewise.
* gnu/packages/haskell.scm (ghc-7): Likewise.
* gnu/packages/irods.scm (irods): Likewise.
* gnu/packages/language.scm (python2-tegaki-pygtk): Likewise.
* gnu/packages/lisp-xyz.scm (sbcl-lzlib): Likewise.
(sbcl-cl-gobject-introspection): Likewise.
(sbcl-cl-ana): Likewise.
(sbcl-cl-libuv): Likewise.
(sbcl-cl-async): Likewise.
(sbcl-mcclim): Likewise.
(sbcl-zstd): Likewise.
(sbcl-cl-opengl): Likewise.
(sbcl-lev): Likewise.
(sbcl-cl-glfw3): Likewise.
* gnu/packages/machine-learning.scm (tensorflow): Likewise.
* gnu/packages/messaging.scm (utox): Likewise.
* gnu/packages/mpi.scm (java-openmpi): Likewise.
* gnu/packages/music.scm (jack-select): Likewise.
* gnu/packages/pascal.scm (fpc): Likewise.
* gnu/packages/python-crypto.scm (python-libnacl): Likewise.
* gnu/packages/python-xyz.scm (python-cairocffi): Likewise.
(python-pyev): Likewise.
(python-pytidylib): Likewise.
* gnu/packages/radio.scm (unixcw): Likewise.
* gnu/packages/rust.scm (rust-1.32): Likewise.
* gnu/packages/security-token.scm (opensc): Likewise.
(python-pyscard): Likewise.
* gnu/packages/selinux.scm (python-setools): Likewise.
* gnu/packages/spice.scm (libcacard): Likewise.
* gnu/packages/telephony.scm (libtgvoip): Likewise.
---
 gnu/packages/bioinformatics.scm   | 12 ++++----
 gnu/packages/emulators.scm        |  3 +-
 gnu/packages/engineering.scm      | 12 ++++----
 gnu/packages/golang.scm           |  4 +--
 gnu/packages/haskell.scm          |  7 ++---
 gnu/packages/irods.scm            |  2 +-
 gnu/packages/language.scm         |  7 +++--
 gnu/packages/lisp-xyz.scm         | 50 +++++++++++--------------------
 gnu/packages/machine-learning.scm | 15 ++++------
 gnu/packages/messaging.scm        |  3 +-
 gnu/packages/mpi.scm              |  3 +-
 gnu/packages/music.scm            |  4 +--
 gnu/packages/pascal.scm           |  6 ++--
 gnu/packages/python-crypto.scm    |  4 +--
 gnu/packages/python-xyz.scm       | 22 +++++---------
 gnu/packages/radio.scm            |  3 +-
 gnu/packages/rust.scm             |  4 +--
 gnu/packages/security-token.scm   |  8 ++---
 gnu/packages/selinux.scm          |  3 +-
 gnu/packages/spice.scm            |  4 +--
 gnu/packages/telephony.scm        |  7 ++---
 21 files changed, 70 insertions(+), 113 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 6adc6a0276..d89e459fa3 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -9481,14 +9481,14 @@ dependency like SeqAn.")
                  inputs
                  (string-append "/include/jellyfish-" ,(package-version jellyfish))))
                (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libjellyfish-2.0.a")
-                (string-append (assoc-ref inputs "jellyfish")
-                               "/lib/libjellyfish-2.0.a"))
+                (search-input-file inputs
+                                   "/lib/libjellyfish-2.0.a"))
                (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libdivsufsort.a")
-                (string-append (assoc-ref inputs "libdivsufsort")
-                               "/lib/libdivsufsort.so"))
+                (search-input-file inputs
+                                   "/lib/libdivsufsort.so"))
                (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libdivsufsort64.a")
-                (string-append (assoc-ref inputs "libdivsufsort")
-                               "/lib/libdivsufsort64.so")))
+                (search-input-file inputs
+                                   "/lib/libdivsufsort64.so")))
              (substitute* "CMakeLists.txt"
                ;; Don't prefer static libs
                (("SET\\(CMAKE_FIND_LIBRARY_SUFFIXES.*") "")
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index e458d24cab..1e28e50155 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -219,8 +219,7 @@ SuperCPU.")
                       (string-append (assoc-ref inputs "font-wqy-microhei")
                                      "/share/fonts/truetype/wqy-microhei.ttc"))
                      (libvulkan
-                      (string-append (assoc-ref inputs "vulkan-loader")
-                                     "/lib/libvulkan.so")))
+                      (search-input-file inputs "/lib/libvulkan.so")))
                  (chdir "docs")
                  (invoke "bash" "-c" "g++ -O2 $(freetype-config \
 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index c02d07fba1..12087a9e83 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -335,12 +335,10 @@ utilities.")
              (substitute* '("libleptongui/scheme/schematic/ffi/gtk.scm.in"
                             "utils/attrib/lepton-attrib.scm")
                (("@LIBGTK@")
-                (string-append (assoc-ref inputs "gtk")
-                               "/lib/libgtk-3.so")))
+                (search-input-file inputs "/lib/libgtk-3.so")))
              (substitute* '("libleptongui/scheme/schematic/ffi/gobject.scm.in")
                (("@LIBGOBJECT@")
-                (string-append (assoc-ref inputs "glib")
-                               "/lib/libgobject-2.0.so")))
+                (search-input-file inputs "/lib/libgobject-2.0.so")))
              (substitute* "liblepton/scheme/lepton/ffi.scm.in"
                (("@LIBLEPTON@")
                 (string-append (assoc-ref outputs "out")
@@ -351,8 +349,7 @@ utilities.")
                                "/lib/libleptonattrib.so")))
              (substitute* "liblepton/scheme/lepton/log.scm.in"
                (("@LIBGLIB@")
-                (string-append (assoc-ref inputs "glib")
-                               "/lib/libglib-2.0.so")))
+                (search-input-file inputs "/lib/libglib-2.0.so")))
 
              ;; For finding libraries when running tests before installation.
              (setenv "LIBLEPTONGUI"
@@ -437,7 +434,8 @@ features.")))
              ;; fix of the mesa package we wrap the pcb executable such that
              ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
              (let* ((out (assoc-ref outputs "out"))
-                    (path (string-append (assoc-ref inputs "udev") "/lib")))
+                    (path (dirname
+                           (search-input-file inputs "/lib/libudev.so"))))
                (wrap-program (string-append out "/bin/pcb")
                  `("LD_LIBRARY_PATH" ":" prefix (,path))))
              #t))
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 05b135b933..444fb7813f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -113,7 +113,7 @@
          (add-before 'build 'prebuild
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
-                    (ld (string-append (assoc-ref inputs "libc") "/lib"))
+                    (ld (dirname (search-input-file inputs "/lib/libc.so")))
                     (loader (car (find-files ld "^ld-linux.+")))
                     (net-base (assoc-ref inputs "net-base"))
                     (tzdata-path
@@ -261,7 +261,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
            (replace 'prebuild
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
-                      (ld (string-append (assoc-ref inputs "libc") "/lib"))
+                      (ld (dirname (search-input-file inputs "/lib/libc.so")))
                       (loader (car (find-files ld "^ld-linux.+")))
                       (net-base (assoc-ref inputs "net-base"))
                       (tzdata-path
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 09732fc594..0ddaad9d52 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.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 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -246,9 +246,8 @@ top of CLISP.")
                      (gmp-lib (string-append gmp "/lib"))
                      (gmp-include (string-append gmp "/include"))
                      (ncurses-lib
-                      (string-append (assoc-ref inputs "ncurses") "/lib"))
-                     (ld-so (string-append (assoc-ref inputs "libc")
-                                           ,(glibc-dynamic-linker)))
+                      (dirname (search-input-file inputs "/lib/libncurses.so")))
+                     (ld-so (search-input-file inputs ,(glibc-dynamic-linker)))
                      (libtinfo-dir
                       (string-append ghc-bootstrap-prefix
                                      "/lib/ghc-7.8.4/terminfo-0.4.0.0")))
diff --git a/gnu/packages/irods.scm b/gnu/packages/irods.scm
index e82888e7ae..e9ac0d5297 100644
--- a/gnu/packages/irods.scm
+++ b/gnu/packages/irods.scm
@@ -120,7 +120,7 @@
                (("'usr', 'lib', 'irods'") "'lib', 'irods'"))
              (substitute* "scripts/irods/pypyodbc.py"
                (("\"/usr/lib/libodbc.so\"")
-                (string-append (assoc-ref inputs "unixodbc") "/lib/libodbc.so")))))
+                (search-input-file inputs "/lib/libodbc.so")))))
          (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((gcc (assoc-ref inputs  "gcc")))
diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 199a0368a9..108aa242f3 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -973,10 +973,11 @@ suitable for both the desktop and mobile devices.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "tegakigtk/fakekey.py"
                  (("libX11.so.6" so)
-                  (string-append (assoc-ref inputs "libx11") "/lib/" so))
+                  (search-input-file inputs
+                                     (string-append "/lib/" so)))
                  (("libXtst.so.6" so)
-                  (string-append (assoc-ref inputs "libxtst") "/lib/" so)))
-               #t))))))
+                  (search-input-file inputs
+                                     (string-append "/lib/" so))))))))))
     (inputs ; required for sending key strokes
      `(("libx11" ,libx11)
        ("libxtst" ,libxtst)))
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index f2fe9c93d1..dc4f213751 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -7202,7 +7202,7 @@ cl-plumbing libraries.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/lzlib.lisp"
                  (("liblz\\.so")
-                  (string-append (assoc-ref inputs "lzlib") "/lib/liblz.so")))
+                  (search-input-file inputs "/lib/liblz.so")))
                #t)))))
       (synopsis "Common Lisp library for lzip (de)compression")
       (description
@@ -7357,11 +7357,10 @@ function.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/init.lisp"
                  (("libgobject-2\\.0\\.so")
-                  (string-append (assoc-ref inputs "glib") "/lib/libgobject-2.0.so"))
+                  (search-input-file inputs "/lib/libgobject-2.0.so"))
                  (("libgirepository-1\\.0\\.so")
-                  (string-append (assoc-ref inputs "gobject-introspection")
-                                 "/lib/libgirepository-1.0.so")))
-               #t)))))
+                  (search-input-file inputs
+                                     "/lib/libgirepository-1.0.so"))))))))
       (synopsis "Common Lisp bindings to GObject Introspection")
       (description
        "This library is a bridge between Common Lisp and GObject
@@ -8519,8 +8518,7 @@ sacrificing much in the way of power.")
             (lambda* (#:key inputs #:allow-other-keys)
               (substitute* "hdf-cffi/hdf-cffi.lisp"
                 (("/usr/lib/i386-linux-gnu/hdf5/serial/libhdf5.so")
-                 (string-append (assoc-ref inputs "hdf5")
-                                "/lib/libhdf5.so")))
+                 (search-input-file inputs "/lib/libhdf5.so")))
               (substitute* "gsl-cffi/gsl-cffi.lisp"
                 (("define-foreign-library gsl-cffi" all)
                  (string-append all " (:unix "
@@ -8850,9 +8848,7 @@ has a small codebase that's easy to understand and use.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "lib.lisp"
                  (("/usr/lib/libuv.so")
-                  (string-append (assoc-ref inputs "libuv")
-                                 "/lib/libuv.so")))
-               #t))
+                  (search-input-file inputs "/lib/libuv.so")))))
            (add-after 'fix-paths 'fix-system-definition
              (lambda _
                (substitute* "cl-libuv.asd"
@@ -8910,12 +8906,9 @@ has a small codebase that's easy to understand and use.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/ssl/package.lisp"
                  (("libcrypto\\.so")
-                  (string-append (assoc-ref inputs "openssl")
-                                 "/lib/libcrypto.so"))
+                  (search-input-file inputs "/lib/libcrypto.so"))
                  (("libssl\\.so")
-                  (string-append (assoc-ref inputs "openssl")
-                                 "/lib/libssl.so")))
-               #t)))))
+                  (search-input-file inputs "/lib/libssl.so"))))))))
       (synopsis "Asynchronous operations for Common Lisp")
       (description
        "Cl-async is a library for general purpose, non-blocking programming in
@@ -12144,13 +12137,10 @@ and saving 2-dimensional pixel-based images.")
                                  "/share/fonts/truetype/")))
                (substitute* "Extensions/fontconfig/src/functions.lisp"
                  (("libfontconfig\\.so")
-                  (string-append (assoc-ref inputs "fontconfig")
-                                 "/lib/libfontconfig.so")))
+                  (search-input-file inputs "/lib/libfontconfig.so")))
                (substitute* "Extensions/harfbuzz/src/functions.lisp"
                  (("libharfbuzz\\.so")
-                  (string-append (assoc-ref inputs "harfbuzz")
-                                 "/lib/libharfbuzz.so")))
-               #t))
+                  (search-input-file inputs "/lib/libharfbuzz.so")))))
            (add-after 'unpack 'fix-build
              (lambda _
                ;; The cffi-grovel system does not get loaded automatically,
@@ -14259,9 +14249,7 @@ library are feedforward neural networks trained using backpropagation.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/libzstd.lisp"
                  (("libzstd\\.so")
-                  (string-append (assoc-ref inputs "zstd-lib")
-                                 "/lib/libzstd.so")))
-               #t)))))
+                  (search-input-file inputs "/lib/libzstd.so"))))))))
       (synopsis "Common Lisp library for Zstandard (de)compression")
       (description
        "This Common Lisp library provides functions for Zstandard
@@ -15827,14 +15815,13 @@ compiled foreign library collection.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "gl/library.lisp"
                  (("libGL.so" all)
-                  (string-append (assoc-ref inputs "mesa") "/lib/" all)))
+                  (search-input-file inputs "/lib/libGL.so")))
                (substitute* "glu/library.lisp"
                  (("libGLU.so" all)
-                  (string-append (assoc-ref inputs "glu") "/lib/" all)))
+                  (search-input-file inputs "/lib/libGLU.so")))
                (substitute* "glut/library.lisp"
                  (("libglut.so" all)
-                  (string-append (assoc-ref inputs "freeglut") "/lib/" all)))
-               #t)))))
+                  (search-input-file inputs "/lib/libglut.so"))))))))
       (inputs
        `(("alexandria" ,sbcl-alexandria)
          ("cffi" ,sbcl-cffi)
@@ -16732,9 +16719,8 @@ Common Lisp.")
            (add-after 'unpack 'patch-libev-lib-path
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "src/lev.lisp"
-                 (("libev.so" all)
-                  (string-append (assoc-ref inputs "libev")
-                                        "/lib/" all))))))))
+                 (("libev.so" _)
+                  (search-input-file inputs "/lib/libev.so"))))))))
       (inputs
        `(("cffi" ,sbcl-cffi)
          ("libev" ,libev)))
@@ -17309,8 +17295,8 @@ and even allows the generic visualisation of graphs in this format.")
            (add-after 'unpack 'patch-glfw-lib-path
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "glfw-bindings.lisp"
-                 (("libglfw.so.3" all)
-                  (string-append (assoc-ref inputs "glfw") "/lib/" all))))))))
+                 (("libglfw.so.3" _)
+                  (search-input-file inputs "/lib/libglfw.so.3"))))))))
       (inputs
        `(("alexandria" ,sbcl-alexandria)
          ("cffi" ,sbcl-cffi)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3f257df832..7d4c637157 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1563,36 +1563,31 @@ Python.")
                  ;; Sqlite
                  (("include\\(sqlite\\)") "")
                  (("\\$\\{sqlite_STATIC_LIBRARIES\\}")
-                  (string-append (assoc-ref inputs "sqlite")
-                                 "/lib/libsqlite3.so"))
+                  (search-input-file inputs "/lib/libsqlite3.so"))
                  (("sqlite_copy_headers_to_destination") "")
 
                  ;; PNG
                  (("include\\(png\\)") "")
                  (("\\$\\{png_STATIC_LIBRARIES\\}")
-                  (string-append (assoc-ref inputs "libpng")
-                                 "/lib/libpng16.so"))
+                  (search-input-file inputs "/lib/libpng16.so"))
                  (("png_copy_headers_to_destination") "")
 
                  ;; JPEG
                  (("include\\(jpeg\\)") "")
                  (("\\$\\{jpeg_STATIC_LIBRARIES\\}")
-                  (string-append (assoc-ref inputs "libjpeg")
-                                 "/lib/libjpeg.so"))
+                  (search-input-file inputs "/lib/libjpeg.so"))
                  (("jpeg_copy_headers_to_destination") "")
 
                  ;; GIF
                  (("include\\(gif\\)") "")
                  (("\\$\\{gif_STATIC_LIBRARIES\\}")
-                  (string-append (assoc-ref inputs "giflib")
-                                 "/lib/libgif.so"))
+                  (search-input-file inputs "/lib/libgif.so"))
                  (("gif_copy_headers_to_destination") "")
 
                  ;; lmdb
                  (("include\\(lmdb\\)") "")
                  (("\\$\\{lmdb_STATIC_LIBRARIES\\}")
-                  (string-append (assoc-ref inputs "lmdb")
-                                 "/lib/liblmdb.so"))
+                  (search-input-file inputs "/lib/liblmdb.so"))
                  (("lmdb_copy_headers_to_destination") "")
 
                  ;; Protobuf
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 9fd0e70afe..19b4b5be63 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1540,8 +1540,7 @@ messenger protocol.")
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (substitute* "../source/src/xlib/gtk.c"
                          (("libgtk-3.so")
-                         (string-append (assoc-ref inputs "gtk+")
-                                        "/lib/libgtk-3.so")))))
+                          (search-input-file inputs "/lib/libgtk-3.so")))))
         (add-after 'install 'wrap-program
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (wrap-program (string-append (assoc-ref outputs "out")
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index af1de10377..b91afc2067 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -348,8 +348,7 @@ software vendors, application developers and computer science researchers.")
                  (lambda* (#:key inputs #:allow-other-keys)
                    (substitute* "ompi/mpi/java/c/Makefile.in"
                      (("\\$\\(top_builddir\\)/ompi/lib@OMPI_LIBMPI_NAME@.la")
-                      (string-append (assoc-ref inputs "openmpi") "/lib/libmpi.la")))
-                   #t))
+                      (search-input-file inputs "/lib/libmpi.la")))))
                (add-after 'install 'strip-jar-timestamps
                  (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
     (synopsis "Java bindings for MPI")))
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 2ae923d6ad..1935a39e65 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3044,9 +3044,7 @@ can connect to any JACK port and record the output into a stereo WAV file.")
              ;; Fix reference to dlopened libraries.
              (substitute* "jackselect/alsainfo.py"
                (("libasound.so.2")
-                (string-append (assoc-ref inputs "alsa-lib")
-                               "/lib/libasound.so.2")))
-             #t))
+                (search-input-file inputs "/lib/libasound.so.2")))))
          (replace 'build
            (assoc-ref python:%standard-phases 'build))
          (add-after 'install 'wrap
diff --git a/gnu/packages/pascal.scm b/gnu/packages/pascal.scm
index 88bc354269..438134a698 100644
--- a/gnu/packages/pascal.scm
+++ b/gnu/packages/pascal.scm
@@ -150,11 +150,9 @@
                (substitute* "fpcsrc/compiler/systems/t_linux.pas"
                  ;; Point to the current glibc dynamic linker.
                  (("/lib/ld-linux.so.2")
-                  (string-append (assoc-ref inputs "libc")
-                                 ,(glibc-dynamic-linker)))
+                  (search-input-file inputs ,(glibc-dynamic-linker)))
                  (("/lib64/ld-linux-x86-64.so.2")
-                  (string-append (assoc-ref inputs "libc")
-                                 ,(glibc-dynamic-linker)))
+                  (search-input-file inputs ,(glibc-dynamic-linker)))
                  ; TODO: /lib/ld-linux-armhf.so.3
                  ; TODO: /lib/ld-linux-aarch64.so.1
                  ; TODO: /lib64/ld64.so.2
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 3a201e4095..593461c56d 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -1220,9 +1220,7 @@ none of them have everything that I'd like, so here's one more.  It uses
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "libnacl/__init__.py"
                (("/usr/local/lib/libsodium.so")
-                (string-append (assoc-ref inputs "libsodium")
-                               "/lib/libsodium.so")))
-             #t)))))
+                (search-input-file inputs "/lib/libsodium.so"))))))))
     (native-inputs
      `(("python-pyhamcrest" ,python-pyhamcrest)))
     (inputs
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 512b5be234..344ae01dde 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6830,22 +6830,16 @@ support for Python 3 and PyPy.  It is based on cffi.")
                (("filenames = \\(library_filename,\\) \\+ filenames")
                 "pass")
                (("libcairo.so.2")
-                (string-append (assoc-ref inputs "cairo")
-                               "/lib/libcairo.so.2")))
+                (search-input-file inputs "/lib/libcairo.so.2")))
              (substitute* "cairocffi/pixbuf.py"
                (("libgdk_pixbuf-2.0.so.0")
-                (string-append (assoc-ref inputs "gdk-pixbuf")
-                               "/lib/libgdk_pixbuf-2.0.so.0"))
+                (search-input-file inputs "/lib/libgdk_pixbuf-2.0.so.0"))
                (("libgobject-2.0.so.0")
-                (string-append (assoc-ref inputs "glib")
-                               "/lib/libgobject-2.0.so.0"))
+                (search-input-file inputs "/lib/libgobject-2.0.so.0"))
                (("libglib-2.0.so.0")
-                (string-append (assoc-ref inputs "glib")
-                               "/lib/libglib-2.0.so.0"))
+                (search-input-file inputs "/lib/libglib-2.0.so.0"))
                (("libgdk-3.so.0")
-                (string-append (assoc-ref inputs "gtk+")
-                               "/lib/libgdk-3.so.0")))
-             #t))
+                (search-input-file inputs "/lib/libgdk-3.so.0")))))
          (add-after 'unpack 'disable-linters
            ;; Their check fails; none of our business.
            (lambda _
@@ -16149,8 +16143,7 @@ Record Format (DWARF).")
        (modify-phases %standard-phases
          (add-after 'unpack 'patch
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((libev (string-append (assoc-ref inputs "libev")
-                                         "/lib/libev.so.4")))
+             (let ((libev (search-input-file inputs "/lib/libev.so.4")))
                (substitute* "setup.py"
                  (("libev_dll_name = find_library\\(\\\"ev\\\"\\)")
                   (string-append "libev_dll_name = \"" libev "\"")))))))))
@@ -24345,8 +24338,7 @@ be necessary when using @code{cmd}.")
        (modify-phases %standard-phases
          (add-before 'build 'qualify-libtidy
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((libtidy (string-append (assoc-ref inputs "tidy")
-                                           "/lib/libtidy.so")))
+             (let ((libtidy (search-input-file inputs "/lib/libtidy.so")))
                (substitute* "tidylib/tidy.py"
                  (("ctypes\\.util\\.find_library\\('tidy'\\)")
                   (format #f "'~a'" libtidy)))
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index c55cd55ac5..21843a688f 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -1588,8 +1588,7 @@ methods:
                 "-lncurses"))
              (substitute* "src/libcw/libcw_pa.c"
                (("libpulse-simple.so" all)
-                (string-append (assoc-ref inputs "pulseaudio")
-                               "/lib/" all))))))))
+                (search-input-file inputs "/lib/libpulse-simple.so"))))))))
     (home-page "http://unixcw.sourceforge.net/")
     (synopsis "Morse code library and programs")
     (description
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 2d29c2acd7..faff349565 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -509,8 +509,8 @@ safety and thread safety guarantees.")
                    (("^jemalloc =.*$") "")
                    (("[[]rust[]]") "\n[rust]\njemalloc=true\n"))
                  (setenv "JEMALLOC_OVERRIDE"
-                         (string-append (assoc-ref inputs "jemalloc")
-                                        "/lib/libjemalloc_pic.a")))))))))))
+                         (search-input-file inputs
+                                            "/lib/libjemalloc_pic.a")))))))))))
 
 (define-public rust-1.33
   (let ((base-rust (rust-bootstrapped-package
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 2339d20cca..a1fc8b5c6f 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -300,8 +300,8 @@ website for more information about Yubico and the YubiKey.")
          ;; configuration file at runtime.
          (add-after 'unpack 'set-default-libpcsclite.so.1-path
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((libpcsclite (string-append (assoc-ref inputs "pcsc-lite")
-                                               "/lib/libpcsclite.so.1")))
+             (let ((libpcsclite (search-input-file inputs
+                                                   "/lib/libpcsclite.so.1")))
                (substitute* "configure"
                  (("DEFAULT_PCSC_PROVIDER=\"libpcsclite\\.so\\.1\"")
                   (string-append
@@ -439,8 +439,8 @@ retrieve a YubiKey's serial number, and so forth.")
                (("lib = \"libpcsclite\\.so\\.1\";")
                 (simple-format #f
                                "lib = \"~a\";"
-                               (string-append (assoc-ref inputs "pcsc-lite")
-                                              "/lib/libpcsclite.so.1"))))
+                               (search-input-file inputs
+                                                  "/lib/libpcsclite.so.1"))))
              #t)))))
     (inputs
      `(("pcsc-lite" ,pcsc-lite)))
diff --git a/gnu/packages/selinux.scm b/gnu/packages/selinux.scm
index e7e6289d1c..8a75538d10 100644
--- a/gnu/packages/selinux.scm
+++ b/gnu/packages/selinux.scm
@@ -329,8 +329,7 @@ based on required access.")
          (add-after 'unpack 'set-SEPOL-variable
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "SEPOL"
-                     (string-append (assoc-ref inputs "libsepol")
-                                    "/lib/libsepol.a"))))
+                     (search-input-file inputs "/lib/libsepol.a"))))
          (add-after 'unpack 'remove-Werror
            (lambda _
              (substitute* "setup.py"
diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm
index 76670463d7..5c065151d1 100644
--- a/gnu/packages/spice.scm
+++ b/gnu/packages/spice.scm
@@ -356,8 +356,8 @@ resolution scaling on graphical console window resize.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "tests/setup-softhsm2.sh"
                (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
-                (string-append (assoc-ref inputs "softhsm")
-                               "/lib/softhsm/libsofthsm2.so"))))))))
+                (search-input-file inputs
+                                   "/lib/softhsm/libsofthsm2.so"))))))))
     (propagated-inputs
      `(("glib" ,glib)                   ; Requires: in the pkg-config file
        ("nss" ,nss)))                   ; Requires.private: in the pkg-config
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index f75a168948..37ff103c42 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -894,14 +894,11 @@ Initiation Protocol (SIP) and a multimedia framework.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "os/linux/AudioPulse.cpp"
                (("libpulse\\.so")
-                (string-append (assoc-ref inputs "pulseaudio")
-                              "/lib/libpulse.so")))
+                (search-input-file inputs "/lib/libpulse.so")))
              (substitute* '("os/linux/AudioInputALSA.cpp"
                             "os/linux/AudioOutputALSA.cpp")
                (("libasound\\.so")
-                (string-append (assoc-ref inputs "alsa-lib")
-                               "/lib/libasound.so")))
-             #t)))))
+                (search-input-file inputs "/lib/libasound.so"))))))))
     (synopsis "VoIP library for Telegram clients")
     (description "A collection of libraries and header files for implementing
 telephony functionality into custom Telegram clients.")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 12/15] gnu: Use 'search-input-file' when looking for executables.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (9 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 11/15] gnu: Use 'search-input-file' when looking for *.so and *.a Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 13/15] gnu: mozjs: Use 'which' where appropriate Ludovic Courtès
                     ` (2 subsequent siblings)
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/admin.scm (isc-dhcp): Use 'search-input-file' when
looking for executables.
* gnu/packages/audio.scm (ableton-link): Likewise.
* gnu/packages/benchmark.scm (fio): Likewise.
* gnu/packages/bioinformatics.scm (roary): Likewise.
(ngless): Likewise.
* gnu/packages/boost.scm (boost-for-irods): Likewise.
* gnu/packages/bootloaders.scm (grub): Likewise.
(grub-efi): Likewise.
* gnu/packages/chemistry.scm (inchi): Likewise.
* gnu/packages/dictionaries.scm (ding): Likewise.
* gnu/packages/dlang.scm (ldc): Likewise.
* gnu/packages/education.scm (childsplay): Likewise.
* gnu/packages/emacs-xyz.scm (emacs-hyperbole): Likewise.
(emacs-haskell-mode): Likewise.
(emacs-auctex): Likewise.
(emacs-ggtags): Likewise.
(emacs-graphviz-dot-mode): Likewise.
(emacs-flycheck-grammalecte): Likewise.
(emacs-counsel-notmuch): Likewise.
(emacspeak): Likewise.
(emacs-exwm): Likewise.
(emacs-exwm-x): Likewise.
(emacs-treemacs): Likewise.
(emacs-telega): Likewise.
(emacs-exiftool): Likewise.
* gnu/packages/emulators.scm (higan): Likewise.
* gnu/packages/engineering.scm (freehdl): Likewise.
(librepcb): Likewise.
* gnu/packages/entr.scm (entr): Likewise.
* gnu/packages/file-systems.scm (libeatmydata): Likewise.
(xfstests): Likewise.
(mergerfs): Likewise.
(mergerfs-tools): Likewise.
* gnu/packages/finance.scm (monero-gui): Likewise.
* gnu/packages/flashing-tools.scm (flashrom): Likewise.
* gnu/packages/fontutils.scm (fontforge): Likewise.
* gnu/packages/game-development.scm (python2-renpy): Likewise.
* gnu/packages/games.scm (opensurge): Likewise.
(xboard): Likewise.
(hyperrogue): Likewise.
(flare-game): Likewise.
(chessx): Likewise.
* gnu/packages/geo.scm (grass): Likewise.
* gnu/packages/glib.scm (glib): Likewise.
* gnu/packages/gnome.scm (mm-common): Likewise.
(network-manager-openvpn): Likewise.
(network-manager-vpnc): Likewise.
(network-manager-openconnect): Likewise.
(apostrophe): Likewise.
* gnu/packages/gnupg.scm (pius): Likewise.
(jetring): Likewise.
* gnu/packages/gnuzilla.scm (icedove): Likewise.
* gnu/packages/golang.scm (go-1.4): Likewise.
* gnu/packages/graphviz.scm (xdot): Likewise.
* gnu/packages/guile-xyz.scm (jupyter-guile-kernel): Likewise.
* gnu/packages/haskell-xyz.scm (ghc-hindent): Likewise.
* gnu/packages/ibus.scm (ibus): Likewise.
* gnu/packages/image.scm (phockup): Likewise.
* gnu/packages/irc.scm (quassel): Likewise.
* gnu/packages/java.scm (drip): Likewise.
(ant-bootstrap): Likewise.
(tla2tools): Likewise.
* gnu/packages/julia.scm (julia): Likewise.
* gnu/packages/less.scm (lesspipe): Likewise.
* gnu/packages/libreoffice.scm (libreoffice): Likewise.
* gnu/packages/linux.scm (fuse): Likewise.
(lm-sensors): Likewise.
(bluez): Likewise.
(fakeroot): Likewise.
(inputattach): Likewise.
* gnu/packages/lisp-xyz.scm (sbcl-cl-diskspace): Likewise.
* gnu/packages/lisp.scm (lisp-repl-core-dumper): Likewise.
* gnu/packages/lua.scm (fennel): Likewise.
* gnu/packages/lxde.scm (spacefm): Likewise.
* gnu/packages/mail.scm (public-inbox): Likewise.
* gnu/packages/maths.scm (hdf-java): Likewise.
(maxima): Likewise.
(frama-c): Likewise.
* gnu/packages/messaging.scm (libgadu): Likewise.
* gnu/packages/music.scm (denemo): Likewise.
(curseradio): Likewise.
* gnu/packages/netpbm.scm (netpbm): Likewise.
* gnu/packages/networking.scm (blueman): Likewise.
(squid): Likewise.
(aircrack-ng): Likewise.
* gnu/packages/node.scm (node): Likewise.
(node-llparse-frontend-bootstrap): Likewise.
(node-llparse-bootstrap): Likewise.
(llhttp-bootstrap): Likewise.
(node-lts): Likewise.
* gnu/packages/ocaml.scm (ocaml-4.11): Likewise.
(opam): Likewise.
(ocaml-graph): Likewise.
* gnu/packages/orpheus.scm (orpheus): Likewise.
* gnu/packages/password-utils.scm (password-store): Likewise.
* gnu/packages/python.scm (pypy3): Likewise.
* gnu/packages/qt.scm (qt5ct): Likewise.
* gnu/packages/radio.scm (libosmo-dsp): Likewise.
* gnu/packages/ruby.scm (ruby-pandoc-ruby): Likewise.
* gnu/packages/rust.scm (rust-1.30): Likewise.
* gnu/packages/screen.scm (byobu): Likewise.
* gnu/packages/statistics.scm (r-with-tests): Likewise.
* gnu/packages/suckless.scm (surf): Likewise.
* gnu/packages/syndication.scm (gfeeds): Likewise.
* gnu/packages/telephony.scm (mumble): Likewise.
* gnu/packages/terminals.scm (alacritty): Likewise.
* gnu/packages/tex.scm (texlive-bin): Likewise.
* gnu/packages/uml.scm (plantuml): Likewise.
* gnu/packages/version-control.scm (python-git-multimail): Likewise.
(gitolite): Likewise.
(hg-commitsigs): Likewise.
(git-when-merged): Likewise.
(git-imerge): Likewise.
(gita): Likewise.
* gnu/packages/video.scm (you-get): Likewise.
* gnu/packages/vim.scm (eovim): Likewise.
* gnu/packages/virtualization.scm (qemu): Likewise.
(virt-manager): Likewise.
(criu): Likewise.
* gnu/packages/vpn.scm (strongswan): Likewise.
(xl2tpd): Likewise.
* gnu/packages/wm.scm (i3lock-fancy): Likewise.
* gnu/packages/wxwidgets.scm (python-wxpython): Likewise.
(python2-wxpython): Likewise.
* gnu/packages/xdisorg.scm (autorandr): Likewise.
* gnu/packages/xorg.scm (hackneyed-x11-cursors): Likewise.
(v86d): Likewise.
(mkfontdir): Likewise.
(xpra): Likewise.
---
 gnu/packages/admin.scm            |  6 ++--
 gnu/packages/audio.scm            |  9 +++---
 gnu/packages/benchmark.scm        |  3 +-
 gnu/packages/bioinformatics.scm   | 14 +++-----
 gnu/packages/boost.scm            |  4 +--
 gnu/packages/bootloaders.scm      | 13 ++++----
 gnu/packages/chemistry.scm        |  3 +-
 gnu/packages/dictionaries.scm     |  5 ++-
 gnu/packages/dlang.scm            |  2 +-
 gnu/packages/education.scm        |  3 +-
 gnu/packages/emacs-xyz.scm        | 50 ++++++++++++----------------
 gnu/packages/emulators.scm        |  3 +-
 gnu/packages/engineering.scm      | 20 ++++--------
 gnu/packages/entr.scm             |  6 ++--
 gnu/packages/file-systems.scm     | 22 ++++++-------
 gnu/packages/finance.scm          |  3 +-
 gnu/packages/flashing-tools.scm   |  6 ++--
 gnu/packages/fontutils.scm        |  3 +-
 gnu/packages/game-development.scm |  5 ++-
 gnu/packages/games.scm            | 17 ++++------
 gnu/packages/geo.scm              |  3 +-
 gnu/packages/glib.scm             | 12 +++----
 gnu/packages/gnome.scm            | 38 ++++++++--------------
 gnu/packages/gnupg.scm            | 12 +++----
 gnu/packages/gnuzilla.scm         |  3 +-
 gnu/packages/golang.scm           |  4 +--
 gnu/packages/graphviz.scm         |  5 ++-
 gnu/packages/guile-xyz.scm        |  4 +--
 gnu/packages/haskell-xyz.scm      |  5 ++-
 gnu/packages/ibus.scm             |  9 ++++--
 gnu/packages/image.scm            |  6 ++--
 gnu/packages/irc.scm              |  2 +-
 gnu/packages/java.scm             | 11 +++----
 gnu/packages/julia.scm            |  2 +-
 gnu/packages/less.scm             |  9 +++---
 gnu/packages/libreoffice.scm      |  7 ++--
 gnu/packages/linux.scm            | 54 ++++++++++++++-----------------
 gnu/packages/lisp-xyz.scm         |  2 +-
 gnu/packages/lisp.scm             | 11 +++----
 gnu/packages/lua.scm              |  4 +--
 gnu/packages/lxde.scm             |  4 +--
 gnu/packages/mail.scm             |  2 +-
 gnu/packages/maths.scm            | 21 +++++-------
 gnu/packages/messaging.scm        |  4 +--
 gnu/packages/music.scm            | 10 +++---
 gnu/packages/netpbm.scm           |  3 +-
 gnu/packages/networking.scm       | 28 +++++++---------
 gnu/packages/node.scm             | 22 +++++--------
 gnu/packages/ocaml.scm            | 10 +++---
 gnu/packages/orpheus.scm          |  9 ++----
 gnu/packages/password-utils.scm   |  6 ++--
 gnu/packages/python.scm           |  2 +-
 gnu/packages/qt.scm               |  4 +--
 gnu/packages/radio.scm            |  4 +--
 gnu/packages/ruby.scm             |  8 ++---
 gnu/packages/rust.scm             |  2 +-
 gnu/packages/screen.scm           |  3 +-
 gnu/packages/statistics.scm       |  3 +-
 gnu/packages/suckless.scm         |  4 +--
 gnu/packages/syndication.scm      |  2 +-
 gnu/packages/telephony.scm        |  4 +--
 gnu/packages/terminals.scm        |  2 +-
 gnu/packages/tex.scm              |  4 +--
 gnu/packages/uml.scm              |  3 +-
 gnu/packages/version-control.scm  | 30 +++++++----------
 gnu/packages/video.scm            |  3 +-
 gnu/packages/vim.scm              |  3 +-
 gnu/packages/virtualization.scm   | 12 +++----
 gnu/packages/vpn.scm              |  7 ++--
 gnu/packages/wm.scm               | 14 +++-----
 gnu/packages/wxwidgets.scm        |  7 ++--
 gnu/packages/xdisorg.scm          |  5 ++-
 gnu/packages/xorg.scm             | 16 ++++-----
 73 files changed, 270 insertions(+), 391 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index aab62331a3..82a4b91cec 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1254,8 +1254,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"
@@ -1548,8 +1547,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 203965f4c6..f0c65040a3 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -5213,11 +5213,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 6a6ac1d8d5..5277933f4c 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 d89e459fa3..d57c00a451 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 e83f21ea63..19bb6e2508 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
@@ -311,9 +311,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 aed7f1f2ab..6001cde9a9 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -458,8 +458,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 e7733d72d0..cc6bcedfb0 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -481,8 +481,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
@@ -1410,7 +1409,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")
@@ -2565,7 +2564,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")
@@ -2931,8 +2930,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
@@ -3038,7 +3036,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"
@@ -5448,8 +5446,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")
@@ -9172,9 +9169,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)
@@ -12873,8 +12868,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
@@ -13580,10 +13574,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"))
@@ -13696,10 +13690,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))))))
@@ -23122,7 +23116,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"))))
@@ -26063,10 +26057,8 @@ other @code{helm-type-file} sources such as @code{helm-locate}.")
            (add-after 'unpack 'patch-sources
              (lambda* (#:key inputs #:allow-other-keys)
                ;; Hard-code paths to `ffplay` and `ffmpeg`.
-               (let ((ffplay-bin (string-append (assoc-ref inputs "ffmpeg")
-                                                "/bin/ffplay"))
-                     (ffmpeg-bin (string-append (assoc-ref inputs "ffmpeg")
-                                                "/bin/ffmpeg")))
+               (let ((ffplay-bin (search-input-file inputs "/bin/ffplay"))
+                     (ffmpeg-bin (search-input-file inputs "/bin/ffmpeg")))
                  (substitute* "telega-ffplay.el"
                    (("\\(executable-find \"ffplay\"\\)")
                     (string-append
@@ -27379,9 +27371,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 1e28e50155..5470c47d1b 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -476,8 +476,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 12087a9e83..608bd4a078 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -1940,19 +1940,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"
@@ -1963,7 +1958,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"))
@@ -2042,8 +2037,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 e2335b8a86..c6ec345736 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -798,7 +798,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
@@ -976,11 +977,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" ".*")
@@ -1027,8 +1026,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)
@@ -1329,8 +1327,9 @@ On Guix System, you will need to invoke the included shell scripts as
              ;; These were copied from the package libfuse.
              (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")
                 (which "sh")))
@@ -1389,10 +1388,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 efeee664d7..83d532f0f3 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -821,8 +821,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 8ea893e7cc..118545de64 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -695,7 +695,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 80f8c77c73..8459de4356 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>
@@ -1199,8 +1199,7 @@ developed mainly for Ren'py.")
          (add-after 'set-paths 'set-build-vars
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "RENPY_CYTHON"
-                     (string-append (assoc-ref inputs "python2-cython")
-                                    "/bin/cython"))
+                     (search-input-file 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 17c61dd387..e351783e58 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -1544,8 +1544,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.
@@ -3342,7 +3341,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)
@@ -5837,7 +5837,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
@@ -9034,10 +9034,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
@@ -11908,8 +11906,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 851bfcfa2e..18cd82e58e 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -2036,8 +2036,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 0c0cfce40c..a625582474 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2021 Mark H Weaver <mhw@netris.org>
@@ -230,11 +230,11 @@ shared NFS home directories.")
                             "gobject/glib-genmarshal.in"
                             "gobject/glib-mkenums.in")
                (("@PYTHON@")
-                (string-append (assoc-ref inputs "python")
-                               "/bin/python"
-                               ,(version-major+minor
-                                 (package-version python)))))
-             #t))
+                (search-input-file inputs
+                                   (string-append
+                                    "/bin/python"
+                                    ,(version-major+minor
+                                      (package-version python))))))))
          (add-before 'check 'pre-check
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; For tests/gdatetime.c.
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 4f63b6bf38..9aec7e052b 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1127,15 +1127,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)
@@ -7829,10 +7824,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)
@@ -7885,10 +7878,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)
@@ -7934,10 +7925,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)
@@ -11608,9 +11598,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 a6ec75765c..581d6e77e2 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -447,8 +447,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)
@@ -662,8 +664,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))))))
@@ -1164,8 +1165,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 a0e72be427..f7170dfc11 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 444fb7813f..58d21c9bee 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>
@@ -193,7 +193,7 @@
            (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 34d6434f60..0e4a4b952e 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>
@@ -357,8 +357,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 2874928883..51fea6c785 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1118,9 +1118,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 1fa7310fab..0744e7e019 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>
@@ -5811,8 +5811,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 0ab910f0dc..c022dfc4e9 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>
@@ -2341,9 +2341,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 7f5394c03c..9370d157cb 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 52dfc95a4d..62f0e232eb 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 e1c93b734c..bdb93b90c7 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 429f3647b7..abcf77b5cb 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>
@@ -1226,10 +1226,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 83921a786a..e4baf6013a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2999,8 +2999,9 @@ 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")))
+                (search-input-file inputs
+                                   (string-append "bin/"
+                                                  maybe-u "mount"))))
              (substitute* '("util/mount.fuse.c")
                (("/bin/sh")
                 (which "sh")))
@@ -4091,27 +4092,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
@@ -5009,7 +5011,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)
@@ -7505,15 +7507,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")
@@ -7614,10 +7612,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 dc4f213751..e04721db42 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -15475,7 +15475,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 6dfb7def72..8e3cbf3e59 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 007a15ee06..337111ed40 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -4087,7 +4087,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 1ddeb93002..3e0b5d0c4b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1391,11 +1391,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))
@@ -3600,13 +3598,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)
@@ -3640,8 +3637,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")
@@ -6393,9 +6389,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 19b4b5be63..be3261e700 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 1935a39e65..1b09a49b3b 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>
@@ -624,7 +624,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")))
@@ -632,8 +632,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 (\""
@@ -3315,8 +3314,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 c212fc3ef7..23c2575d78 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>
@@ -644,11 +644,12 @@ systems with no further dependencies.")
                               "blueman-mechanism.in" "blueman-report.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)
@@ -658,12 +659,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)
@@ -1741,9 +1739,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)
@@ -1838,8 +1834,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 1262c0e303..af64a0a4fd 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -209,8 +209,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
@@ -804,8 +803,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\""))
@@ -3660,8 +3658,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 31fce7072b..9cf2b721b1 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -515,10 +515,8 @@ any X11 window.")
          (add-before 'install 'patch-passmenu-path
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "contrib/dmenu/passmenu"
-               (("dmenu") (string-append (assoc-ref inputs "dmenu")
-                                         "/bin/dmenu"))
-               (("xdotool") (string-append (assoc-ref inputs "xdotool")
-                                           "/bin/xdotool")))
+               (("dmenu") (search-input-file inputs "/bin/dmenu"))
+               (("xdotool") (search-input-file inputs "/bin/xdotool")))
              #t))
          (add-after 'install 'install-passmenu
            (lambda* (#:key outputs #:allow-other-keys)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 227c612a68..a3695ad674 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -812,7 +812,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 19fcc2f37e..2fd9374bd5 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -170,9 +170,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 21843a688f..7a4f4866da 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -715,9 +715,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 34c0a6f79f..b333e4b9df 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>
@@ -1173,8 +1173,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)))
@@ -4848,8 +4847,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 faff349565..97944a1fb5 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 2b4e1607f7..7c617711e7 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -215,8 +215,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 de106e1882..b9ef430744 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 f8ef791c71..ab68355ced 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -470,8 +470,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 3fe6d11653..1fc92a6dec 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2402,8 +2402,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 6145a77dc4..f014585de4 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -766,8 +766,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 b0041de976..be7bd3dee0 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>
@@ -246,7 +246,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
@@ -1232,8 +1232,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)
@@ -1364,9 +1364,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 8e91f19ce4..ddb9121fe2 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>
@@ -116,7 +116,7 @@ endpoints.")
            (lambda* (#:key inputs #:allow-other-keys)
              (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"))
@@ -907,8 +907,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 f7a9dda800..2a92051ffb 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>
@@ -612,14 +612,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 423da37a3c..83801176b4 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 d0da2d28d1..b4723920c4 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>
@@ -230,8 +230,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 b54523f3b1..3c4ca3bf17 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>
@@ -2288,8 +2288,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
@@ -3592,8 +3591,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:
@@ -4964,9 +4962,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
@@ -6403,7 +6400,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.*: \"\",")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 13/15] gnu: mozjs: Use 'which' where appropriate.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (10 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 12/15] gnu: Use 'search-input-file' when looking for executables Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files Ludovic Courtès
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 15/15] gnu: Use 'search-input-directory' and 'search-input-file' where appropriate Ludovic Courtès
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/gnuzilla.scm (mozjs-52): Use 'which' for "autoconf".
(mozjs-60): Likewise.
(mozjs-78): Likewise.
---
 gnu/packages/gnuzilla.scm | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index f7170dfc11..3f5b215746 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
-;;; 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, 2019, 2020, 2021 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -337,8 +337,7 @@ in C/C++.")
                (let ((out (assoc-ref outputs "out")))
                  (setenv "SHELL" (which "sh"))
                  (setenv "CONFIG_SHELL" (which "sh"))
-                 (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
-                                                   "/bin/autoconf"))
+                 (setenv "AUTOCONF" (which "autoconf"))
                  (apply invoke "./configure"
                         (cons (string-append "--prefix=" out)
                               configure-flags))))))))
@@ -394,8 +393,7 @@ in C/C++.")
                (chdir "run-configure-from-here")
                (setenv "SHELL" (which "sh"))
                (setenv "CONFIG_SHELL" (which "sh"))
-               (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
-                                                 "/bin/autoconf"))
+               (setenv "AUTOCONF" (which "autoconf"))
                (apply invoke "../js/src/configure"
                       (cons (string-append "--prefix=" out)
                             configure-flags))
@@ -476,8 +474,7 @@ in C/C++.")
                (chdir "run-configure-from-here")
                (setenv "SHELL" (which "sh"))
                (setenv "CONFIG_SHELL" (which "sh"))
-               (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
-                                                 "/bin/autoconf"))
+               (setenv "AUTOCONF" (which "autoconf"))
                (apply invoke "../js/src/configure"
                       (cons (string-append "--prefix=" out)
                             configure-flags))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (11 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 13/15] gnu: mozjs: Use 'which' where appropriate Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  2021-07-18 15:56     ` Maxime Devos
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 15/15] gnu: Use 'search-input-directory' and 'search-input-file' where appropriate Ludovic Courtès
  13 siblings, 1 reply; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

* gnu/packages/bioinformatics.scm (java-picard-1.113): Use
'search-input-file' when looking for *.jar.
(fastqc): Likewise.
* gnu/packages/groovy.scm (groovy): Likewise.
* gnu/packages/java.scm (ant-bootstrap): Likewise.
(ecj-bootstrap): Likewise.
(java-cisd-base): Likewise.
(java-cisd-args4j): Likewise.
(java-cisd-jhdf5): Likewise.
(java-native-access): Likewise.
(java-native-access-platform): Likewise.
* gnu/packages/maths.scm (hdf-java): Likewise.
---
 gnu/packages/bioinformatics.scm | 20 ++++-----
 gnu/packages/groovy.scm         |  2 +-
 gnu/packages/java.scm           | 76 +++++++++++++++++----------------
 gnu/packages/maths.scm          |  3 +-
 4 files changed, 49 insertions(+), 52 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index d57c00a451..7a8e5f16c0 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -4379,9 +4379,7 @@ VCF.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "build.xml"
                (("\\$\\{lib\\}/apache-ant-1.8.2-bzip2.jar")
-                (string-append (assoc-ref inputs "ant")
-                               "/lib/ant.jar")))
-             #t))
+                (search-input-file inputs "/lib/ant.jar")))))
          (add-after 'unpack 'make-test-target-independent
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "build.xml"
@@ -4478,15 +4476,13 @@ VCF.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "build.xml"
                (("jbzip2-0.9.jar")
-                (string-append (assoc-ref inputs "java-jbzip2")
-                               "/share/java/jbzip2.jar"))
+                (search-input-file inputs "/share/java/jbzip2.jar"))
                (("sam-1.103.jar")
-                (string-append (assoc-ref inputs "java-picard-1.113")
-                               "/share/java/sam-1.112.jar"))
+                (search-input-file inputs
+                                   "/share/java/sam-1.112.jar"))
                (("cisd-jhdf5.jar")
-                (string-append (assoc-ref inputs "java-cisd-jhdf5")
-                               "/share/java/sis-jhdf5.jar")))
-             #t))
+                (search-input-file inputs
+                                   "/share/java/sis-jhdf5.jar")))))
          ;; There is no installation target
          (replace 'install
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -9137,8 +9133,8 @@ browser.")
                  (substitute* "bin/linux/fseq"
                    (("java") (which "java"))
                    (("\\$REALDIR/../lib/commons-cli-1.1.jar")
-                    (string-append (assoc-ref inputs "java-commons-cli")
-                                   "/share/java/commons-cli.jar"))
+                    (search-input-file inputs
+                                       "/share/java/commons-cli.jar"))
                    (("REALDIR=.*")
                     (string-append "REALDIR=" bin "\n")))
                  (install-file "README.txt" doc)
diff --git a/gnu/packages/groovy.scm b/gnu/packages/groovy.scm
index c44a17b59e..73a62e1045 100644
--- a/gnu/packages/groovy.scm
+++ b/gnu/packages/groovy.scm
@@ -827,7 +827,7 @@ and modify groovy's @dfn{Abstract Syntax Tree} (AST)."))))
                      "java-jansi" "java-jline-2"))
                  ;; antlr.jar is present twice in antlr2.  Symlink doesn't like
                  ;; it, so we symlink it here.
-                 (symlink (string-append (assoc-ref inputs "antlr2") "/lib/antlr.jar")
+                 (symlink (search-input-file inputs "/lib/antlr.jar")
                           (string-append out-lib "/antlr.jar"))
                  (for-each
                    (lambda (tool)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index fdfd044926..f4a426e559 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -382,8 +382,7 @@ JNI.")
              (setenv "JAVAC"
                      (search-input-file inputs "/bin/jikes"))
              (setenv "CLASSPATH"
-                     (string-append (assoc-ref inputs "jamvm")
-                                    "/lib/rt.jar"))
+                     (search-input-file inputs "/lib/rt.jar"))
 
              ;; Ant complains if this file doesn't exist.
              (setenv "HOME" "/tmp")
@@ -486,8 +485,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CLASSPATH"
                      (string-join
-                      (cons (string-append (assoc-ref inputs "jamvm")
-                                           "/lib/rt.jar")
+                      (cons (search-input-file inputs "/lib/rt.jar")
                             (find-files (string-append
                                          (assoc-ref inputs "ant-bootstrap")
                                          "/lib")
@@ -3221,19 +3219,22 @@ Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n"
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "build/build.xml"
                  (("\\$\\{lib\\}/testng/testng-jdk15.jar")
-                  (string-append (assoc-ref inputs "java-testng")
-                                 "/share/java/java-testng.jar"))
+                  (search-input-file inputs
+                                     "/share/java/java-testng.jar"))
                  (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
-                  (string-append (assoc-ref inputs "java-commons-lang")
-                                 "/share/java/commons-lang-"
-                                 ,(package-version java-commons-lang) ".jar"))
+                  (search-input-file inputs
+                                     (string-append
+                                      "/share/java/commons-lang-"
+                                      ,(package-version java-commons-lang)
+                                      ".jar")))
                  (("\\$\\{lib\\}/commons-io/commons-io.jar")
-                  (string-append (assoc-ref inputs "java-commons-io")
-                                 "/lib/m2/commons-io/commons-io/"
-                                 ,(package-version java-commons-io)
-                                 "/commons-io-"
-                                 ,(package-version java-commons-io)
-                                 ".jar"))
+                  (search-input-file inputs
+                                     (string-append
+                                      "/lib/m2/commons-io/commons-io/"
+                                      ,(package-version java-commons-io)
+                                      "/commons-io-"
+                                      ,(package-version java-commons-io)
+                                      ".jar")))
                  ;; Remove dependency on svn
                  (("<build-info.*") "")
                  (("\\$\\{revision.number\\}")
@@ -3406,8 +3407,7 @@ libraries from the SIS division at ETH Zurich like jHDF5.")
                  (rename-file "build-common.xml.new" "build-common.xml"))
                (substitute* "build/build.xml"
                  (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
-                  (string-append (assoc-ref inputs "java-cisd-base")
-                                 "/share/java/sis-base.jar"))
+                  (search-input-file inputs "/share/java/sis-base.jar"))
                  ;; Remove dependency on svn
                  (("<build-info.*") "")
                  (("\\$\\{revision.number\\}")
@@ -3509,29 +3509,32 @@ libraries from the SIS division at ETH Zurich like jHDF5.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "../build_resources/ant/build-common.xml"
                  (("../libraries/testng/testng-jdk15.jar")
-                  (string-append (assoc-ref inputs "java-testng")
-                                 "/share/java/java-testng.jar")))
+                  (search-input-file inputs
+                                     "/share/java/java-testng.jar")))
                (substitute* "build/build.xml"
                  (("\\$\\{lib\\}/sis-base/sis-base.jar")
-                  (string-append (assoc-ref inputs "java-cisd-base")
-                                 "/share/java/sis-base.jar"))
+                  (search-input-file inputs
+                                     "/share/java/sis-base.jar"))
                  (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
-                  (string-append (assoc-ref inputs "java-cisd-args4j")
-                                 "/share/java/cisd-args4j.jar"))
+                  (search-input-file inputs
+                                     "/share/java/cisd-args4j.jar"))
                  (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
-                  (string-append (assoc-ref inputs "java-commons-lang")
-                                 "/share/java/commons-lang-"
-                                 ,(package-version java-commons-lang) ".jar"))
+                  (search-input-file inputs
+                                     (string-append
+                                      "/share/java/commons-lang-"
+                                      ,(package-version java-commons-lang)
+                                      ".jar")))
                  (("\\$\\{lib\\}/commons-io/commons-io.jar")
-                  (string-append (assoc-ref inputs "java-commons-io")
-                                 "/lib/m2/commons-io/commons-io/"
-                                 ,(package-version java-commons-io)
-                                 "/commons-io-"
-                                 ,(package-version java-commons-io)
-                                 ".jar"))
+                  (search-input-file inputs
+                                     (string-append
+                                      "/lib/m2/commons-io/commons-io/"
+                                      ,(package-version java-commons-io)
+                                      "/commons-io-"
+                                      ,(package-version java-commons-io)
+                                      ".jar")))
                  (("\\$\\{lib\\}/testng/testng-jdk15.jar")
-                  (string-append (assoc-ref inputs "java-testng")
-                                 "/share/java/java-testng.jar"))
+                  (search-input-file inputs
+                                     "/share/java/java-testng.jar"))
                  (("\\$\\{lib\\}/junit4/junit.jar")
                   (car (find-files (assoc-ref inputs "java-junit") "jar$")))
                  (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
@@ -12916,7 +12919,7 @@ from ORO, Inc.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "build.xml"
                ;; Since we removed the bundled ant.jar, give the correct path
-               (("lib/ant.jar") (string-append (assoc-ref inputs "ant") "/lib/ant.jar"))
+               (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
                ;; We removed generated native libraries. We can only rebuild one
                ;; so don't fail if we can't find a native library for another architecture.
                (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
@@ -12970,8 +12973,7 @@ Java method invocation.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "nbproject/project.properties"
                (("../../build/jna.jar")
-                (string-append (assoc-ref inputs "java-native-access")
-                               "/share/java/jna.jar"))
+                (search-input-file inputs "/share/java/jna.jar"))
                (("../../lib/hamcrest-core-.*.jar")
                 (car (find-files (assoc-ref inputs "java-hamcrest-core")
                                  "jar$")))
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 3e0b5d0c4b..7362ce9a8e 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1348,8 +1348,7 @@ extremely large and complex data collections.")
                             "hdf/hdf5lib/exceptions/Makefile.in"
                             "hdf/hdflib/Makefile.in")
                (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
-                (string-append (assoc-ref inputs "slf4j-api")
-                               "/share/java/slf4j-api.jar")))
+                (search-input-file inputs "/share/java/slf4j-api.jar")))
              ;; Replace outdated config.sub and config.guess:
              (with-directory-excursion "config"
                (for-each (lambda (file)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 15/15] gnu: Use 'search-input-directory' and 'search-input-file' where appropriate.
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
                     ` (12 preceding siblings ...)
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files Ludovic Courtès
@ 2021-07-16 15:54   ` Ludovic Courtès
  13 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-16 15:54 UTC (permalink / raw)
  To: 49597; +Cc: Ludovic Courtès

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 <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>
@@ -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 <bavier@posteo.net>
 ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
 ;;; Copyright © 2014 Sylvain Beucler <beuc@beuc.net>
-;;; Copyright © 2014, 2015, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2014, 2015, 2019 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
@@ -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 <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -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 <bavier@member.fsf.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
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 <mail@brendan.scot>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 ison <ison@airmail.cc>
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
 ;;;
@@ -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 <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2017, 2020 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2014 Sou Bunnbu <iyzsong@gmail.com>
@@ -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 <andreas@enge.fr>
-;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; 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 <nikita@karetnikov.org>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2017, 2019 Eric Bavier <bavier@member.fsf.org>
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 <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
@@ -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 <ludo@gnu.org>
+;;; Copyright © 2014, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
@@ -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 <andreas@enge.fr>
 ;;; Copyright © 2013 Aljosha Papsch <misc@rpapsch.de>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Raoul Jean Pierre Bonnal <ilpuccio.febo@gmail.com>
@@ -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





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-16 15:50 [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
@ 2021-07-17 15:06 ` Mathieu Othacehe
  2021-07-18 15:44 ` Maxime Devos
  2021-07-24 14:29 ` bug#49597: " Ludovic Courtès
  3 siblings, 0 replies; 29+ messages in thread
From: Mathieu Othacehe @ 2021-07-17 15:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 49597


Hello Ludo,

> I initially made the ‘search-input-file’ changes by grepping for
> “(string-append (search-input inputs”, replacing everything in wgrep
> mode.  I then reviewed changes one by one (though without rebuilding
> everything) and committed them in chunks of similar changes for
> easier review/bisecting.
>
> I’d like to push this to core-updates soonish.

I don't have a powerful enough machine at hand right now to build all
the impacted packages, but I had a look the whole series at it looks
really nice to me.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-16 15:50 [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
  2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
  2021-07-17 15:06 ` [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Mathieu Othacehe
@ 2021-07-18 15:44 ` Maxime Devos
  2021-07-19 14:50   ` Ludovic Courtès
  2021-07-24 14:29 ` bug#49597: " Ludovic Courtès
  3 siblings, 1 reply; 29+ messages in thread
From: Maxime Devos @ 2021-07-18 15:44 UTC (permalink / raw)
  To: Ludovic Courtès, 49597

[-- Attachment #1: Type: text/plain, Size: 3721 bytes --]

Hi,

Ludovic Courtès schreef op vr 16-07-2021 om 17:50 [+0200]:
> The rest is about removing reliance on input labels in build-side
> code, primarily by changing:
> 
>   (string-append (assoc-ref inputs "LABEL") "FILE")
> 
> to one of:
> 
>   (search-input-file inputs "FILE")
>   (search-input-directory inputs "FILE")
> 
> This change will help if we eventually remove input labels entirely
> from the API (remember that input labels are now unnecessary in
> package definitions but they’re still returned by ‘package-inputs’
> and similar procedures).
> 
> The idea is that code should not rely on package names when looking
> for files as this would prevent things such as
> ‘--with-inputs=openmpi=mpich’ since the label in the original package
> would be “openmpi” whereas it’d be “mpich” in the transformed package.
> In this case (a kind of “virtual dependencies”), a better idiom is:
> 
>   (search-input-file inputs "lib/libmpi.so")
> 
> as this explicitly accommodates any implementation of that library.

I would have expected that --with-inputs=x=y would turn the following:

(package
  [...]
  (inputs `(("x" ,x))))

into:

(package
  [...]
  (inputs `(("x" ,y))))

i.e., keep the label intact, but change the package value.
If "with-inputs" functioned like that, then "search-input-file" wouldn't
be necessary in this case.

Thus, the input label would be by default the package name of the default
package in 'inputs' or 'native-inputs', and if a input is replaced,
then the package name of the original package is still used as label,
but with the new package as value.

(This might or might not currently be the case, I dunno)

So, interpreting
‘The idea is that code should not rely on _package names_ when looking ...’
as ‘The idea is that code should not rely on _labels_ when looking ...’,
I don't agree, as labels (shouldn't) spontanuously change even when using
--with-inputs, so I consider them perfectly fine to use when it's convenient.

In the example you gave, both search-input-file and the original 'string-append'
and 'assoc-ref' look convenient to me, though the latter more so than the other,
and a third variant could be

  #$(file-append (this-package-native-input "openmpi") "/lib/libmpi.so")

which avoids 'string-append' and 'assoc-ref'.

(I prefer explicitely writing in the package definition in which input a file
will be found, as a kind of documentation, though in this case it probably
doesn't really matter.)

> I initially made the ‘search-input-file’ changes by grepping for
> “(string-append (search-input inputs”, replacing everything in wgrep
> mode.  I then reviewed changes one by one (though without rebuilding
> everything) and committed them in chunks of similar changes for
> easier review/bisecting.
> 
> I’d like to push this to core-updates soonish.
> 
> Feedback welcome!

An idea behind this series of patch series seems to be to eliminate
input labels entirely. Is that true / false?

A benefit of having procedures like 'modify-inputs' instead of having
random code assume package inputs are alists with a certain structure,
is that this opens some opportunities to experiment with the nature
of inputs.

More specifically, take 'propagated-inputs'.  Guile dependencies of
guile libraries usually have to be added to 'propagated-inputs',
even if the library package can also be used as a program.  If the
user only wants to use it as a program, then the propagation isn't
necessary.  So introducing some kind of 'context-dependent propagation'
might be interesting, to reduce propagation conflicts.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files.
  2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files Ludovic Courtès
@ 2021-07-18 15:56     ` Maxime Devos
  2021-07-19 14:52       ` [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
  0 siblings, 1 reply; 29+ messages in thread
From: Maxime Devos @ 2021-07-18 15:56 UTC (permalink / raw)
  To: Ludovic Courtès, 49597

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index fdfd044926..f4a426e559 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -382,8 +382,7 @@ JNI.")
>               (setenv "JAVAC"
>                       (search-input-file inputs "/bin/jikes"))
>               (setenv "CLASSPATH"
> -                     (string-append (assoc-ref inputs "jamvm")
> -                                    "/lib/rt.jar"))
> +                     (search-input-file inputs "/lib/rt.jar"))
>  
>               ;; Ant complains if this file doesn't exist.
>               (setenv "HOME" "/tmp")

This is "ant-bootstrap", right?
"jikes" and "jamvm" are in 'native-inputs',
so 'search-input-file (or native-inputs inputs) [...]' is required
here.

> @@ -486,8 +485,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
>             (lambda* (#:key inputs #:allow-other-keys)
>               (setenv "CLASSPATH"
>                       (string-join
> -                      (cons (string-append (assoc-ref inputs "jamvm")
> -                                           "/lib/rt.jar")
> +                      (cons (search-input-file inputs "/lib/rt.jar")
>                              (find-files (string-append
>                                           (assoc-ref inputs "ant-bootstrap")
>                                           "/lib")

Likewise.

That issue was present in the original code, though,
but something to consider.

Greetings,
Maxime.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-18 15:44 ` Maxime Devos
@ 2021-07-19 14:50   ` Ludovic Courtès
  2021-07-19 16:47     ` Maxime Devos
  0 siblings, 1 reply; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-19 14:50 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 49597

Hello Maxime!

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op vr 16-07-2021 om 17:50 [+0200]:
>> The rest is about removing reliance on input labels in build-side
>> code, primarily by changing:
>> 
>>   (string-append (assoc-ref inputs "LABEL") "FILE")
>> 
>> to one of:
>> 
>>   (search-input-file inputs "FILE")
>>   (search-input-directory inputs "FILE")
>> 
>> This change will help if we eventually remove input labels entirely
>> from the API (remember that input labels are now unnecessary in
>> package definitions but they’re still returned by ‘package-inputs’
>> and similar procedures).
>> 
>> The idea is that code should not rely on package names when looking
>> for files as this would prevent things such as
>> ‘--with-inputs=openmpi=mpich’ since the label in the original package
>> would be “openmpi” whereas it’d be “mpich” in the transformed package.
>> In this case (a kind of “virtual dependencies”), a better idiom is:
>> 
>>   (search-input-file inputs "lib/libmpi.so")
>> 
>> as this explicitly accommodates any implementation of that library.
>
> I would have expected that --with-inputs=x=y would turn the following:
>
> (package
>   [...]
>   (inputs `(("x" ,x))))
>
> into:
>
> (package
>   [...]
>   (inputs `(("x" ,y))))
>
> i.e., keep the label intact, but change the package value.

Yes, that’s what happens right now, even on ‘core-updates’.  So to be
clear, there’s no problem at this point.

There will be a problem when we remove input labels entirely from the
API.  At that point, the labels that build-side code will see (if we
keep them at all…) will necessarily be package names.  In the example
above, “x” would be replaced by “y”.

This series is one way to anticipate for this change (which would happen
at the earliest on the next ‘core-updates’ cycle, which could be six
months from now, maybe more).

[...]

> In the example you gave, both search-input-file and the original 'string-append'
> and 'assoc-ref' look convenient to me, though the latter more so than the other,
> and a third variant could be
>
>   #$(file-append (this-package-native-input "openmpi") "/lib/libmpi.so")
>
> which avoids 'string-append' and 'assoc-ref'.

Yes, but you’re still relying on the name, “openmpi”.

If I do:

  (package
    (inherit thing)
    (inputs `(("mpich" ,mpich)
              ,@(delete "openmpi" (package-inputs thing)))))

… then you have a problem: ‘this-package-input’ won’t find “openmpi”.
It’s a real, common use case.  That’s why we need to be careful about
the idioms we promote.

WDYT?

> (I prefer explicitely writing in the package definition in which input a file
> will be found, as a kind of documentation, though in this case it probably
> doesn't really matter.)

Yeah, I like that too.  OTOH, ‘search-input-file’ has the advantage that
it errors out if the file is not found, whereas

  (string-append (assoc-ref inputs "foo") "bar")

always “works” and problems occur possibly much later, at run time.

> An idea behind this series of patch series seems to be to eliminate
> input labels entirely. Is that true / false?

This is true: it’s a step to make it possible to eventually remove input
labels entirely.

> A benefit of having procedures like 'modify-inputs' instead of having
> random code assume package inputs are alists with a certain structure,
> is that this opens some opportunities to experiment with the nature
> of inputs.

Exactly.

> More specifically, take 'propagated-inputs'.  Guile dependencies of
> guile libraries usually have to be added to 'propagated-inputs',
> even if the library package can also be used as a program.  If the
> user only wants to use it as a program, then the propagation isn't
> necessary.  So introducing some kind of 'context-dependent propagation'
> might be interesting, to reduce propagation conflicts.

Ah ha!  That’s a different can of worms though.  :-)

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-18 15:56     ` Maxime Devos
@ 2021-07-19 14:52       ` Ludovic Courtès
  0 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-19 14:52 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 49597

Maxime Devos <maximedevos@telenet.be> skribis:

>> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
>> index fdfd044926..f4a426e559 100644
>> --- a/gnu/packages/java.scm
>> +++ b/gnu/packages/java.scm
>> @@ -382,8 +382,7 @@ JNI.")
>>               (setenv "JAVAC"
>>                       (search-input-file inputs "/bin/jikes"))
>>               (setenv "CLASSPATH"
>> -                     (string-append (assoc-ref inputs "jamvm")
>> -                                    "/lib/rt.jar"))
>> +                     (search-input-file inputs "/lib/rt.jar"))
>>  
>>               ;; Ant complains if this file doesn't exist.
>>               (setenv "HOME" "/tmp")
>
> This is "ant-bootstrap", right?
> "jikes" and "jamvm" are in 'native-inputs',
> so 'search-input-file (or native-inputs inputs) [...]' is required
> here.

[...]

> That issue was present in the original code, though,
> but something to consider.

Ah, good catch.  Let’s address it separately.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-19 14:50   ` Ludovic Courtès
@ 2021-07-19 16:47     ` Maxime Devos
  2021-07-20 21:14       ` Ludovic Courtès
  0 siblings, 1 reply; 29+ messages in thread
From: Maxime Devos @ 2021-07-19 16:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 49597

[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]

Ludovic Courtès schreef op ma 19-07-2021 om 16:50 [+0200]:
> [...]
> 
> > In the example you gave, both search-input-file and the original 'string-append'
> > and 'assoc-ref' look convenient to me, though the latter more so than the other,
> > and a third variant could be
> > 
> >   #$(file-append (this-package-native-input "openmpi") "/lib/libmpi.so")
> > 
> > which avoids 'string-append' and 'assoc-ref'.
> 
> Yes, but you’re still relying on the name, “openmpi”.
> 
> If I do:
> 
>   (package
>     (inherit thing)
>     (inputs `(("mpich" ,mpich)
>               ,@(delete "openmpi" (package-inputs thing)))))
> 
> … then you have a problem: ‘this-package-input’ won’t find “openmpi”.
> It’s a real, common use case.  That’s why we need to be careful about
> the idioms we promote.
> 
> WDYT?

Then you could do:

  (package
     (inherit thing)
     (inputs `(("openmpi" ,mpich) ; use "openmpi" label
               ,@(delete "openmpi" (package-inputs thing)))))

or just use "mpi" in the original and new package as input label,
but that doesn't mesh well with eventually removing input labels.

Myself, I don't mind input labels much. They look like arguments to
a procedure to me, albeit with an unusual syntax for referring to
them.

> > (I prefer explicitely writing in the package definition in which input a file
> > will be found, as a kind of documentation, though in this case it probably
> > doesn't really matter.)
> 
> Yeah, I like that too.  OTOH, ‘search-input-file’ has the advantage that
> it errors out if the file is not found, whereas
> 
>   (string-append (assoc-ref inputs "foo") "bar")
> 
> always “works” and problems occur possibly much later, at run time.

I'd suggest using #+/#$(file-append (this-package-[native]-input "foo") "/bar"
instead of (string-append (assoc-ref ...) ...).

I think I have a method for explicitely choosing which input to use,
using package names instead of labels, that still works nicely with
"--with-input":

(define* (lookup-libmpi-library package)
  ;; open-coding could be avoided by adding a 'is-mpi-library?'
  ;; package property and using that instead of hard-coding a list
  ;; of package names 
  (file-append (or (lookup-package-input package "openmpi")
                   (lookup-package-input package "mpich")
                   ...)
               "/lib/libmpi.so"))

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-19 16:47     ` Maxime Devos
@ 2021-07-20 21:14       ` Ludovic Courtès
  0 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-20 21:14 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 49597

Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op ma 19-07-2021 om 16:50 [+0200]:
>> [...]
>> 
>> > In the example you gave, both search-input-file and the original 'string-append'
>> > and 'assoc-ref' look convenient to me, though the latter more so than the other,
>> > and a third variant could be
>> > 
>> >   #$(file-append (this-package-native-input "openmpi") "/lib/libmpi.so")
>> > 
>> > which avoids 'string-append' and 'assoc-ref'.
>> 
>> Yes, but you’re still relying on the name, “openmpi”.
>> 
>> If I do:
>> 
>>   (package
>>     (inherit thing)
>>     (inputs `(("mpich" ,mpich)
>>               ,@(delete "openmpi" (package-inputs thing)))))
>> 
>> … then you have a problem: ‘this-package-input’ won’t find “openmpi”.
>> It’s a real, common use case.  That’s why we need to be careful about
>> the idioms we promote.
>> 
>> WDYT?
>
> Then you could do:
>
>   (package
>      (inherit thing)
>      (inputs `(("openmpi" ,mpich) ; use "openmpi" label
>                ,@(delete "openmpi" (package-inputs thing)))))
>
> or just use "mpi" in the original and new package as input label,
> but that doesn't mesh well with eventually removing input labels.

Yes, but the goal is to remove input labels.  :-)

> Myself, I don't mind input labels much. They look like arguments to
> a procedure to me, albeit with an unusual syntax for referring to
> them.

Well, we can deal with labels, but removing them lowers the barrier to
entry and reduces boilerplate, which most of us enjoy.

>> > (I prefer explicitely writing in the package definition in which input a file
>> > will be found, as a kind of documentation, though in this case it probably
>> > doesn't really matter.)
>> 
>> Yeah, I like that too.  OTOH, ‘search-input-file’ has the advantage that
>> it errors out if the file is not found, whereas
>> 
>>   (string-append (assoc-ref inputs "foo") "bar")
>> 
>> always “works” and problems occur possibly much later, at run time.
>
> I'd suggest using #+/#$(file-append (this-package-[native]-input "foo") "/bar"
> instead of (string-append (assoc-ref ...) ...).

That’s what I had in mind initially, but that means you’re still relying
on labels or package names¹.  Sometimes that’s OK, sometimes not.

> I think I have a method for explicitely choosing which input to use,
> using package names instead of labels, that still works nicely with
> "--with-input":
>
> (define* (lookup-libmpi-library package)
>   ;; open-coding could be avoided by adding a 'is-mpi-library?'
>   ;; package property and using that instead of hard-coding a list
>   ;; of package names 
>   (file-append (or (lookup-package-input package "openmpi")
>                    (lookup-package-input package "mpich")
>                    ...)
>                "/lib/libmpi.so"))

Yes, an ‘mpi-library?’ property could do the job, together with a
variant of ‘lookup-package-input’ that accepts a predicate rather than a
name.

Yet, that would only work for cases that packagers have explicitly
prepared.  For example, the example above won’t work with:

  --with-input=emacs=emacs-next

unless you actually to the same kind of enumeration or property.  This
approach just doesn’t scale.


But look, in the majority of cases, we don’t do (assoc-ref inputs …) at
all; we just use things that happen to be in $PATH, $PYTHONPATH, and so
on.

In a sense, this whole ‘search-input-file’ strategy follows that
approach.  ‘search-input-file’ is just a generalized version of ‘which’,
as you know.

WDYT?

Ludo’.

¹ Nix doesn’t have this particular problem: “packages” are actually
  functions, so one can refer to their inputs by value, as in:

    { stdenv, openmpi, … }: {     # <- formal parameters of the function
      configureFlags = [ "--with-mpi=${openmpi}" ];
      # …
    }

  I thought about using advanced macrology so that, say, ‘openmpi’ is
  the lexical scope of ‘arguments’ would be bound to the same ‘openmpi’
  referred to in ‘inputs’, such that you could write:

    (package
      ;; …
      (arguments
       (list #:configure-flags
             #~(list (string-append "--with-mpi=" #$openmpi))))
      (inputs (list openmpi)))

  I couldn’t think of a reliable way to do that, though.

  I also think it’s a good idea, performance-wise, to move as much as
  possible from the host side to the build side for packages.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* bug#49597: [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-16 15:50 [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
                   ` (2 preceding siblings ...)
  2021-07-18 15:44 ` Maxime Devos
@ 2021-07-24 14:29 ` Ludovic Courtès
  2021-07-25  9:54   ` [bug#49597] " Mathieu Othacehe
  3 siblings, 1 reply; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-24 14:29 UTC (permalink / raw)
  To: 49597-done

Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

>   gnu: commencement: Use gexps and 'local-file' to refer to patches.
>   gnu: tzdata: Remove input labels.
>   gnu: Simplify "Xvbf" invocation in pre-check phases.
>   gnu: Use 'search-input-directory' when looking for tzdata.
>   gnu: Use 'search-input-directory' for the SDL header directory.
>   gnu: Use 'search-input-directory' for the OpenEXR header directory.
>   gnu: Use 'search-input-file' when searching for Automake files.
>   gnu: Use 'search-input-directory' for the Eigen header directory.
>   gnu: Use 'search-input-directory' for glibc locale data.
>   gnu: Use 'search-input-directory' when looking for C/C++ library
>     headers.
>   gnu: Use 'search-input-file' when looking for *.so and *.a.
>   gnu: Use 'search-input-file' when looking for executables.
>   gnu: mozjs: Use 'which' where appropriate.
>   gnu: Use 'search-input-file' when looking for .jar files.
>   gnu: Use 'search-input-directory' and 'search-input-file' where
>     appropriate.

I went ahead and pushed as d468a03a00738bb0742148e056f7a557aae08f2f.

Now to see if I broke something…

Ludo’.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-24 14:29 ` bug#49597: " Ludovic Courtès
@ 2021-07-25  9:54   ` Mathieu Othacehe
  2021-07-25 15:13     ` Maxime Devos
  2021-07-25 17:05     ` Ludovic Courtès
  0 siblings, 2 replies; 29+ messages in thread
From: Mathieu Othacehe @ 2021-07-25  9:54 UTC (permalink / raw)
  To: 49597; +Cc: ludo

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]


Hey Ludo,

> I went ahead and pushed as d468a03a00738bb0742148e056f7a557aae08f2f.

The CI reports that core-updates evaluation is broken. That's because
"search-input-file" expects a relative FILE whereas some calls, such as
the one in the glib package provide an absolute one:

--8<---------------cut here---------------start------------->8---
(search-input-file (or native-inputs inputs)
                   (string-append
                    "/bin/python"
                    ,(version-major+minor
                      (package-version python))))))))
--8<---------------cut here---------------end--------------->8---

We could edit all those calls to use relative FILE arguments. Another
solution would be to make sure that search-input-file treats
"/bin/python" and "bin/python" the same way as proposed in the attached
patch.

That would be consistent with search-input-directory that already
accepts both "/include/xxx" and "include/xxx".

WDYT?

Thanks,

Mathieu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-build-utils-Trim-trailing-slashes-from-search-input-.patch --]
[-- Type: text/x-patch, Size: 1328 bytes --]

From 6920b87a9cb22c0a5c2ceaf6b6ca852a8e094732 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Sun, 25 Jul 2021 11:43:05 +0200
Subject: [PATCH] build: utils: Trim trailing slashes from search-input-file
 input.

Make sure that both:

(search-input-file inputs "/bin/sh") and (search-input-file inputs "bin/sh")

are supported.

* guix/build/utils (search-input-file): Trim starting slash character from
FILE.
---
 guix/build/utils.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index e7782d3e08..3beb7da67a 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -631,8 +631,11 @@ FILE must be a string like \"bin/sh\". If FILE is not found, an exception is
 raised."
   (match inputs
     (((_ . directories) ...)
-     (or (search-path directories file)
-         (raise (condition (&search-error (path directories) (file file))))))))
+     ;; Accept both "bin/sh" and "/bin/sh" as FILE argument.
+     (let ((file (string-trim file #\/)))
+       (or (search-path directories file)
+           (raise
+            (condition (&search-error (path directories) (file file)))))))))
 
 (define (search-input-directory inputs directory)
   "Find a sub-directory named DIRECTORY among the INPUTS and return its
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-25  9:54   ` [bug#49597] " Mathieu Othacehe
@ 2021-07-25 15:13     ` Maxime Devos
  2021-07-25 17:17       ` Mathieu Othacehe
  2021-07-25 17:05     ` Ludovic Courtès
  1 sibling, 1 reply; 29+ messages in thread
From: Maxime Devos @ 2021-07-25 15:13 UTC (permalink / raw)
  To: Mathieu Othacehe, 49597; +Cc: ludo

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

Mathieu Othacehe schreef op zo 25-07-2021 om 11:54 [+0200]:
> The CI reports that core-updates evaluation is broken. That's because
> "search-input-file" expects a relative FILE whereas some calls, such as
> the one in the glib package provide an absolute one: [...]
> 
> We could edit all those calls to use relative FILE arguments. Another
> solution would be to make sure that search-input-file treats
> "/bin/python" and "bin/python" the same way as proposed in the attached
> patch.
> 
> That would be consistent with search-input-directory that already
> accepts both "/include/xxx" and "include/xxx".

Allowing both "/bin/python" and "bin/python" seems more robust than only
allowing "bin/python", so I'm not opposed to trimming leading slashes.
(Also less work than editing all those calls I presume.)

Nitpick (‘build: utils: Trim trailing slashes from search-input-file’):
it is leading slashes that are trimmed, not trailing slashes.

Maybe a warning could be emitted if there were any leading slashes?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-25  9:54   ` [bug#49597] " Mathieu Othacehe
  2021-07-25 15:13     ` Maxime Devos
@ 2021-07-25 17:05     ` Ludovic Courtès
  2021-07-25 17:18       ` Mathieu Othacehe
  1 sibling, 1 reply; 29+ messages in thread
From: Ludovic Courtès @ 2021-07-25 17:05 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 49597

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> The CI reports that core-updates evaluation is broken. That's because
> "search-input-file" expects a relative FILE whereas some calls, such as
> the one in the glib package provide an absolute one:
>
> (search-input-file (or native-inputs inputs)
>                    (string-append
>                     "/bin/python"
>                     ,(version-major+minor
>                       (package-version python))))))))
>
> We could edit all those calls to use relative FILE arguments. Another
> solution would be to make sure that search-input-file treats
> "/bin/python" and "bin/python" the same way as proposed in the attached
> patch.

Ouch, my bad; I was confident it was OK to have a leading slash.

> From 6920b87a9cb22c0a5c2ceaf6b6ca852a8e094732 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othacehe@gnu.org>
> Date: Sun, 25 Jul 2021 11:43:05 +0200
> Subject: [PATCH] build: utils: Trim trailing slashes from search-input-file
>  input.
>
> Make sure that both:
>
> (search-input-file inputs "/bin/sh") and (search-input-file inputs "bin/sh")
>
> are supported.
>
> * guix/build/utils (search-input-file): Trim starting slash character from
> FILE.

I agree with Maxime, let’s do that.

Thank you, and apologies for the mess!

Ludo’.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-25 15:13     ` Maxime Devos
@ 2021-07-25 17:17       ` Mathieu Othacehe
  0 siblings, 0 replies; 29+ messages in thread
From: Mathieu Othacehe @ 2021-07-25 17:17 UTC (permalink / raw)
  To: Maxime Devos; +Cc: ludo, 49597-done


Hey Maxime,

> Nitpick (‘build: utils: Trim trailing slashes from search-input-file’):
> it is leading slashes that are trimmed, not trailing slashes.
>
> Maybe a warning could be emitted if there were any leading slashes?

Thanks for having a look, I fixed the commit message and pushed as
0236013cd0fc86ff4a042885c735e3f36a7f5c25. I find both versions (with an
without leading slash) acceptable so didn't add a warning.

Mathieu




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
  2021-07-25 17:05     ` Ludovic Courtès
@ 2021-07-25 17:18       ` Mathieu Othacehe
  0 siblings, 0 replies; 29+ messages in thread
From: Mathieu Othacehe @ 2021-07-25 17:18 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 49597


Hey Ludo,

> I agree with Maxime, let’s do that.

Here we go, let's see if it fixes the evaluation :).

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2021-07-25 17:19 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-16 15:50 [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
2021-07-16 15:54 ` [bug#49597] [PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 02/15] gnu: tzdata: Remove input labels Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 03/15] gnu: Simplify "Xvbf" invocation in pre-check phases Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 04/15] gnu: Use 'search-input-directory' when looking for tzdata Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 05/15] gnu: Use 'search-input-directory' for the SDL header directory Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 06/15] gnu: Use 'search-input-directory' for the OpenEXR " Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 07/15] gnu: Use 'search-input-file' when searching for Automake files Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 08/15] gnu: Use 'search-input-directory' for the Eigen header directory Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 09/15] gnu: Use 'search-input-directory' for glibc locale data Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 10/15] gnu: Use 'search-input-directory' when looking for C/C++ library headers Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 11/15] gnu: Use 'search-input-file' when looking for *.so and *.a Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 12/15] gnu: Use 'search-input-file' when looking for executables Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 13/15] gnu: mozjs: Use 'which' where appropriate Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files Ludovic Courtès
2021-07-18 15:56     ` Maxime Devos
2021-07-19 14:52       ` [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Ludovic Courtès
2021-07-16 15:54   ` [bug#49597] [PATCH core-updates 15/15] gnu: Use 'search-input-directory' and 'search-input-file' where appropriate Ludovic Courtès
2021-07-17 15:06 ` [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Mathieu Othacehe
2021-07-18 15:44 ` Maxime Devos
2021-07-19 14:50   ` Ludovic Courtès
2021-07-19 16:47     ` Maxime Devos
2021-07-20 21:14       ` Ludovic Courtès
2021-07-24 14:29 ` bug#49597: " Ludovic Courtès
2021-07-25  9:54   ` [bug#49597] " Mathieu Othacehe
2021-07-25 15:13     ` Maxime Devos
2021-07-25 17:17       ` Mathieu Othacehe
2021-07-25 17:05     ` Ludovic Courtès
2021-07-25 17:18       ` Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).