[PATCH core-updates 00/15] Ajust packages to label-less input style

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:50
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155009.32118-1-ludo@gnu.org
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 02/15] gnu: tzdata: Remove input labels.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-2-ludo@gnu.org
* 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(-)

Toggle diff (158 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 03/15] gnu: Simplify "Xvbf" invocation in pre-check phases.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-3-ludo@gnu.org
* 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(-)

Toggle diff (138 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 01/15] gnu: commencement: Use gexps and 'local-file' to refer to patches.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-1-ludo@gnu.org
* 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(-)

Toggle diff (377 lines)
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 _
-
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 04/15] gnu: Use 'search-input-directory' when looking for tzdata.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-4-ludo@gnu.org
* 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(-)

Toggle diff (355 lines)
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/v
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 05/15] gnu: Use 'search-input-directory' for the SDL header directory.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-5-ludo@gnu.org
* 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(-)

Toggle diff (227 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 06/15] gnu: Use 'search-input-directory' for the OpenEXR header directory.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-6-ludo@gnu.org
* 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(-)

Toggle diff (108 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 07/15] gnu: Use 'search-input-file' when searching for Automake files.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-7-ludo@gnu.org
* 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(-)

Toggle diff (40 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 08/15] gnu: Use 'search-input-directory' for the Eigen header directory.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-8-ludo@gnu.org
* 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(-)

Toggle diff (48 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 09/15] gnu: Use 'search-input-directory' for glibc locale data.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-9-ludo@gnu.org
* 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(-)

Toggle diff (44 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 10/15] gnu: Use 'search-input-directory' when looking for C/C++ library headers.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-10-ludo@gnu.org
* 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(-)

Toggle diff (304 lines)
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") "")))
+
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 12/15] gnu: Use 'search-input-file' when looking for executables.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-12-ludo@gnu.org
* 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(-)

Toggle diff (207 lines)
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
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 13/15] gnu: mozjs: Use 'which' where appropriate.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-13-ludo@gnu.org
* 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(-)

Toggle diff (44 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 11/15] gnu: Use 'search-input-file' when looking for *.so and *.a.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-11-ludo@gnu.org
* 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(-)

Toggle diff (332 lines)
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"))
+
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-14-ludo@gnu.org
* 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(-)

Toggle diff (213 lines)
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
L
L
Ludovic Courtès wrote on 16 Jul 2021 17:54
[PATCH core-updates 15/15] gnu: Use 'search-input-directory' and 'search-input-file' where appropriate.
(address . 49597@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20210716155420.32447-15-ludo@gnu.org
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(-)

Toggle diff (298 lines)
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
in
This message was truncated. Download the full message here.
M
M
Mathieu Othacehe wrote on 17 Jul 2021 17:06
Re: [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 49597@debbugs.gnu.org)
87im19ou86.fsf@gnu.org
Hello Ludo,

Toggle quote (8 lines)
> 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
M
M
Maxime Devos wrote on 18 Jul 2021 17:44
cc5d986077cba71f6f6d11146fc1cd5bde541534.camel@telenet.be
Hi,

Ludovic Courtès schreef op vr 16-07-2021 om 17:50 [+0200]:
Toggle quote (25 lines)
> 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.)

Toggle quote (10 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYPRMQxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7k3MAQDMelXs/ujVzLvovjnA/MVNW7xK
7wuU9tYxWEK4CO5RKAEAk+wFlKAVS2opWvdL9QjKnubCLrp5665JVLlKZfCF+gk=
=lwoG
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 18 Jul 2021 17:56
Re: [bug#49597] [PATCH core-updates 14/15] gnu: Use 'search-input-file' when looking for .jar files.
bd4426815b84e427fe27f816e652dc3946c743d8.camel@telenet.be
Toggle quote (15 lines)
> 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.

Toggle quote (11 lines)
> @@ -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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYPRPGxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hcUAP9uGLmKTC6L3074DPMu4d3JwCJ2
ipWkTheTbX6+uAC+HQEAgaTA61BVSN7Ei+YUMkn6pS/2+G19OohU3L47trt3dAE=
=+FnH
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 19 Jul 2021 16:50
Re: bug#49597: [PATCH core-updates 00/15] Ajust packages to label-less input style
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 49597@debbugs.gnu.org)
87tukqmk73.fsf_-_@gnu.org
Hello Maxime!

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (40 lines)
> 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).

[...]

Toggle quote (8 lines)
> 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?

Toggle quote (4 lines)
> (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.

Toggle quote (3 lines)
> 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.

Toggle quote (5 lines)
> 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.

Toggle quote (7 lines)
> 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’.
L
L
Ludovic Courtès wrote on 19 Jul 2021 16:52
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 49597@debbugs.gnu.org)
87pmvemk4j.fsf_-_@gnu.org
Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (20 lines)
>> 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.

[...]

Toggle quote (3 lines)
> That issue was present in the original code, though,
> but something to consider.

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

Thanks,
Ludo’.
M
M
Maxime Devos wrote on 19 Jul 2021 18:47
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 49597@debbugs.gnu.org)
f33a9e6421b987886f47bed218c64e4759e51f67.camel@telenet.be
Ludovic Courtès schreef op ma 19-07-2021 om 16:50 [+0200]:
Toggle quote (25 lines)
> [...]
>
> > 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.

Toggle quote (11 lines)
> > (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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYPWsuhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mqgAP0WdTpirVH6nqs23zl7Djhwxi1R
A5bOT03pPJIl1v8xxAD+Jyzy1WezpJ3nC9Q+ZWBsUh/PNHFMkXDBVZ1Cf7WRQw0=
=b2gw
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 20 Jul 2021 23:14
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 49597@debbugs.gnu.org)
87wnpkit6d.fsf_-_@gnu.org
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (36 lines)
> 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. :-)

Toggle quote (4 lines)
> 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.

Toggle quote (14 lines)
>> > (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.

Toggle quote (13 lines)
> 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.
L
L
Ludovic Courtès wrote on 24 Jul 2021 16:29
(address . 49597-done@debbugs.gnu.org)
87o8araiph.fsf@gnu.org
Hi,

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

Toggle quote (18 lines)
> 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’.
Closed
M
M
Mathieu Othacehe wrote on 25 Jul 2021 11:54
(address . 49597@debbugs.gnu.org)(address . ludo@gnu.org)
877dhehg6t.fsf@gnu.org
Hey Ludo,

Toggle quote (2 lines)
> 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:

Toggle snippet (7 lines)
(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.

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

WDYT?

Thanks,

Mathieu
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(-)

Toggle diff (20 lines)
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
M
M
Maxime Devos wrote on 25 Jul 2021 17:13
Re: [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
(address . ludo@gnu.org)
7271a724321d6307fa0f16726f250e209ca648ee.camel@telenet.be
Mathieu Othacehe schreef op zo 25-07-2021 om 11:54 [+0200]:
Toggle quote (12 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYP1/iRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uefAP9MON12XuE+LMfUq8ArIEjHREDz
J1oTK05dmXvQU7nyjwD/c3t909N7L3skTkQdit4B0TQW54aMz68818LB37PybA4=
=WuI6
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 25 Jul 2021 19:05
Re: bug#49597: [PATCH core-updates 00/15] Ajust packages to label-less input style
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 49597@debbugs.gnu.org)
87czr69veg.fsf@gnu.org
Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

Toggle quote (15 lines)
> 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.

Toggle quote (15 lines)
> 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’.
M
M
Mathieu Othacehe wrote on 25 Jul 2021 19:17
Re: [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style
(name . Maxime Devos)(address . maximedevos@telenet.be)
87wnpepb2m.fsf@gnu.org
Hey Maxime,

Toggle quote (5 lines)
> 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
Closed
M
M
Mathieu Othacehe wrote on 25 Jul 2021 19:18
Re: bug#49597: [PATCH core-updates 00/15] Ajust packages to label-less input style
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 49597@debbugs.gnu.org)
87r1fmpb14.fsf@gnu.org
Hey Ludo,

Toggle quote (2 lines)
> I agree with Maxime, let’s do that.

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

Thanks,

Mathieu
?