m...@netris.org skribis: > +(define* (patch-usr-bin-file #:key native-inputs inputs #:allow-other-keys) > + "Patch occurrences of /usr/bin/file in configure script, if present." > + (let ((file "configure") > + (new (and=> (assoc-ref (or native-inputs inputs) "file") > + (cut string-append <> "/bin/file")))) > + (when (and new (file-exists? file)) > + (let ((st (stat file))) > + (substitute* file > + (("/usr/bin/file" old) > + (begin > + (format (current-error-port) > + "patch-usr-bin-file: ~a: changing `~a' to `~a'~%" > + file old new) > + new))) > + (set-file-time file st))) > + #t))
Having seen this commit: commit 6646747c020402fd077a719af99627d9cf3fe54d gnu: gawk: Patch /usr/bin/file in extension/configure on MIPS. * gnu/packages/gawk.scm (gawk): When building for MIPS, patch /usr/bin/file in extension/configure. I was thinking that perhaps the ‘patch-usr-bin-file’ phase should operate on all the executable ‘configure’ files found in the source tree, recursively. WDYT? Also, perhaps the procedure that does the actual patching could be moved to (guix build utils), and then called from ‘patch-usr-bin-file’. (This change can wait for the next core-updates if this one is going to be merged real soon.) Thanks, Ludo’.