guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file


From: Ludovic Courtès
Subject: Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file
Date: Sat, 30 Aug 2014 22:22:09 +0200
User-agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux)

address@hidden 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]