From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file Date: Sat, 30 Aug 2014 22:22:09 +0200 Message-ID: <8761h9918u.fsf@gnu.org> References: <87mwazasyc.fsf@netris.org> <877g22978h.fsf@gnu.org> <87iollbzkm.fsf_-_@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNpAA-0002pj-O7 for guix-devel@gnu.org; Sat, 30 Aug 2014 16:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNpA3-0001bi-Ou for guix-devel@gnu.org; Sat, 30 Aug 2014 16:22:18 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:52017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNpA3-0001bX-I4 for guix-devel@gnu.org; Sat, 30 Aug 2014 16:22:11 -0400 In-Reply-To: <87iollbzkm.fsf_-_@netris.org> (mhw@netris.org's message of "Thu, 21 Aug 2014 12:02:49 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: mhw@netris.org Cc: guix-devel@gnu.org mhw@netris.org skribis: > +(define* (patch-usr-bin-file #:key native-inputs inputs #:allow-other-ke= ys) > + "Patch occurrences of /usr/bin/file in configure script, if present." > + (let ((file "configure") > + (new (and=3D> (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/bi= n/file in extension/configure. I was thinking that perhaps the =E2=80=98patch-usr-bin-file=E2=80=99 phase = should operate on all the executable =E2=80=98configure=E2=80=99 files found in th= e source tree, recursively. WDYT? Also, perhaps the procedure that does the actual patching could be moved to (guix build utils), and then called from =E2=80=98patch-usr-bin-file=E2= =80=99. (This change can wait for the next core-updates if this one is going to be merged real soon.) Thanks, Ludo=E2=80=99.