* Making 'file' an implicit native input in core-updates @ 2014-08-20 18:58 mhw 2014-08-20 19:21 ` Eric Bavier 2014-08-20 21:33 ` Ludovic Courtès 0 siblings, 2 replies; 8+ messages in thread From: mhw @ 2014-08-20 18:58 UTC (permalink / raw) To: guix-devel Hi, I recently updated libffi, libatomic_ops, and libgc on core-updates. Unfortunately, all three of them fail on MIPS, for the same reason that sudo and gawk currently need workarounds: all of these packages were bootstrapped with a version of 'libtool' that requires /usr/bin/file on MIPS. Given that this problem is becoming increasingly common, I think we should add 'file' as an implicit native-input for the gnu-build-system in core-updates, and also add a new phase to %standard-phases that substitutes /usr/bin/file in the usual places with a path that works in the build environment. What do you think? Mark ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Making 'file' an implicit native input in core-updates 2014-08-20 18:58 Making 'file' an implicit native input in core-updates mhw @ 2014-08-20 19:21 ` Eric Bavier 2014-08-20 21:33 ` Ludovic Courtès 1 sibling, 0 replies; 8+ messages in thread From: Eric Bavier @ 2014-08-20 19:21 UTC (permalink / raw) To: mhw; +Cc: guix-devel mhw@netris.org writes: > Unfortunately, all three of them fail on MIPS, for the same reason that > sudo and gawk currently need workarounds: all of these packages were > bootstrapped with a version of 'libtool' that requires /usr/bin/file on > MIPS. > > Given that this problem is becoming increasingly common, I think we > should add 'file' as an implicit native-input for the gnu-build-system > in core-updates, and also add a new phase to %standard-phases that > substitutes /usr/bin/file in the usual places with a path that works in > the build environment. > > What do you think? I had wanted to do this a while back for pedenatic reasons. The reason at the time for not doing it was that "it doesn't create a real problem in most cases". Causing failed builds on MIPS seems to me to be enough of a real problem to justify the change. -- Eric Bavier ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Making 'file' an implicit native input in core-updates 2014-08-20 18:58 Making 'file' an implicit native input in core-updates mhw 2014-08-20 19:21 ` Eric Bavier @ 2014-08-20 21:33 ` Ludovic Courtès 2014-08-21 16:02 ` [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file mhw 1 sibling, 1 reply; 8+ messages in thread From: Ludovic Courtès @ 2014-08-20 21:33 UTC (permalink / raw) To: mhw; +Cc: guix-devel mhw@netris.org skribis: > Given that this problem is becoming increasingly common, I think we > should add 'file' as an implicit native-input for the gnu-build-system > in core-updates, and also add a new phase to %standard-phases that > substitutes /usr/bin/file in the usual places with a path that works in > the build environment. Yes, that makes sense. If you want, you (yes, you ;-)) can start it in a branch off core-updates, or directly in core-updates, if that’s fine this way. I had reported the Libtool issue at <http://bugs.gnu.org/17840>, but the thread eventually stalled. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file 2014-08-20 21:33 ` Ludovic Courtès @ 2014-08-21 16:02 ` mhw 2014-08-22 6:12 ` mhw ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: mhw @ 2014-08-21 16:02 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 1240 bytes --] ludo@gnu.org (Ludovic Courtès) writes: > mhw@netris.org skribis: > >> Given that this problem is becoming increasingly common, I think we >> should add 'file' as an implicit native-input for the gnu-build-system >> in core-updates, and also add a new phase to %standard-phases that >> substitutes /usr/bin/file in the usual places with a path that works in >> the build environment. > > Yes, that makes sense. > > If you want, you (yes, you ;-)) can start it in a branch off > core-updates, or directly in core-updates, if that’s fine this way. Here are proposed patches for core-updates. I chose to add a 'file-boot0' to '%boot0-inputs' to make 'file' available as early as possible in the bootstrap, on the theory that any library could soon depend on 'file'. I've successfully built 'hello' on i686 with these patches applied, but I've not yet tested them on MIPS. If I test them on the Loongson 3A machine, then when hydra offloads the same builds, the build logs on hydra will be empty. It would be good if hydra would copy over the saved build log in that case. Do these patches look right to you? Do you expect that cross-compilation would be handled correctly? Thanks! Mark [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: [PATCH 1/3] gnu: bootstrap: Add 'file' to %boot0-inputs and %final-inputs --] [-- Type: text/x-patch, Size: 1888 bytes --] From cc6c36bb7ab93271c302b6e3c44a051ace1e729d Mon Sep 17 00:00:00 2001 From: Mark H Weaver <mhw@netris.org> Date: Thu, 21 Aug 2014 11:26:40 -0400 Subject: [PATCH 1/3] gnu: bootstrap: Add 'file' to %boot0-inputs and %final-inputs. * gnu/packages/base.scm (file-boot0): New variable. (%boot0-inputs): Add 'file-boot0'. (%final-inputs): Add 'file' to list of packages to 'finalize'. --- gnu/packages/base.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 8060ab6..30176cf 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages gcc) #:use-module (gnu packages ed) + #:use-module (gnu packages file) #:use-module (gnu packages gawk) #:use-module (gnu packages guile) #:use-module (gnu packages multiprecision) @@ -630,11 +631,20 @@ and daylight-saving rules.") (current-source-location) #:guile %bootstrap-guile))) +(define file-boot0 + (package-with-bootstrap-guile + (package-with-explicit-inputs file + `(("make" ,gnu-make-boot0) + ,@%bootstrap-inputs) + (current-source-location) + #:guile %bootstrap-guile))) + (define %boot0-inputs `(("make" ,gnu-make-boot0) ("diffutils" ,diffutils-boot0) ("findutils" ,findutils-boot0) + ("file" ,file-boot0) ,@%bootstrap-inputs)) (define* (nix-system->gnu-triplet @@ -1187,6 +1197,7 @@ store.") ("gzip" ,gzip) ("bzip2" ,bzip2) ("xz" ,xz) + ("file" ,file) ("diffutils" ,diffutils) ("patch" ,patch) ("sed" ,sed) -- 1.8.4 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: [PATCH 2/3] build-system/gnu: Add 'patch-usr-bin-file' to %standard-phases --] [-- Type: text/x-patch, Size: 1975 bytes --] From c41191e84b79af9021c7a17cdd1fd10564e96ad9 Mon Sep 17 00:00:00 2001 From: Mark H Weaver <mhw@netris.org> Date: Thu, 21 Aug 2014 11:30:08 -0400 Subject: [PATCH 2/3] build-system/gnu: Add 'patch-usr-bin-file' to %standard-phases. * guix/build/gnu-build-system.scm (patch-usr-bin-file): New procedure. (%standard-phases): Add it. --- guix/build/gnu-build-system.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 8636931..470e96e 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -106,6 +106,23 @@ working directory." (and (zero? (system* "tar" "xvf" source)) (chdir (first-subdirectory "."))))) +(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)) + (define* (patch-source-shebangs #:key source #:allow-other-keys) "Patch shebangs in all source files; this includes non-executable files such as `.in' templates. Most scripts honor $SHELL and @@ -353,6 +370,7 @@ makefiles." (let-syntax ((phases (syntax-rules () ((_ p ...) `((p . ,p) ...))))) (phases set-paths unpack + patch-usr-bin-file patch-source-shebangs configure patch-generated-file-shebangs build check install patch-shebangs strip))) -- 1.8.4 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #4: [PATCH 3/3] gnu: Rely on 'file' as an implicit input, and on 'patch-usr-bin-file' --] [-- Type: text/x-patch, Size: 17500 bytes --] From 02afc88c008bbe42d15199fc8e062a3fba6cf762 Mon Sep 17 00:00:00 2001 From: Mark H Weaver <mhw@netris.org> Date: Thu, 21 Aug 2014 11:40:43 -0400 Subject: [PATCH 3/3] gnu: Rely on 'file' as an implicit input, and on 'patch-usr-bin-file'. * gnu/packages/admin.scm (sudo): Remove 'file' native-input * gnu/packages/bdw-gc.scm (libatomic-ops, libgc): Remove 'file' native-input. * gnu/packages/bittorrent.scm (transmission): Remove 'file' input. * gnu/packages/cmake.scm (cmake): Remove 'file' input. * gnu/packages/file.scm (file): Remove 'file' native-input. * gnu/packages/gawk.scm (gawk): Remove 'file' native-input. * gnu/packages/image.scm (libtiff): Remove 'file' native-input. Remove 'patch-configure' phase. * gnu/packages/libffi.scm (libffi): Remove 'file' native-input. * gnu/packages/mc.scm (mc): Remove 'file' native-input. Remove 'patch-configure' phase. * gnu/packages/mcrypt.scm (libmcrypt, libmhash): Remove 'file' native-input. * gnu/packages/patchutils.scm (quilt): Remove 'file' input. * gnu/packages/pretty-print.scm (a2ps, trueprint, source-highlight): Remove 'file' native-input. Remove 'patch-configure' phase. --- gnu/packages/admin.scm | 6 --- gnu/packages/bdw-gc.scm | 14 +----- gnu/packages/bittorrent.scm | 1 - gnu/packages/cmake.scm | 2 - gnu/packages/file.scm | 3 -- gnu/packages/gawk.scm | 6 --- gnu/packages/image.scm | 11 +---- gnu/packages/libffi.scm | 6 --- gnu/packages/mc.scm | 10 +--- gnu/packages/mcrypt.scm | 4 +- gnu/packages/patchutils.scm | 1 - gnu/packages/pretty-print.scm | 109 +++++++++++++++++------------------------- 12 files changed, 49 insertions(+), 124 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 83b0180..8a85827 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -659,12 +659,6 @@ system administrator.") `(("groff" ,groff) ("linux-pam" ,linux-pam) ("coreutils" ,coreutils))) - (native-inputs - `(;; 'file' is needed by the pre-release libtool on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - `(("file" ,file)) - '()))) (home-page "http://www.sudo.ws/") (synopsis "Run commands as root") (description diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm index e68ca50..e5a08b0 100644 --- a/gnu/packages/bdw-gc.scm +++ b/gnu/packages/bdw-gc.scm @@ -76,12 +76,6 @@ C or C++ programs, though that is not its primary goal.") (base32 "1pdm0h1y7bgkczr8byg20r6bq15m5072cqm5pny4f9crc9gn3yh4")))) (build-system gnu-build-system) - (native-inputs - `(;; 'file' is needed by the pre-release libtool on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - `(("file" ,file)) - '()))) (outputs '("out" "debug")) (synopsis "Accessing hardware atomic memory update operations") (description @@ -106,13 +100,7 @@ lock-free code, experiment with thread programming paradigms, etc.") "18mg28rr6kwr5clc65k4l4hkyy4kd16amx831sjf8q2lqkbhlck3")))) ;; New dependencies. - (native-inputs - `(("pkg-config" ,pkg-config) - ;; 'file' is needed by the pre-release libtool on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - `(("file" ,file)) - '()))) + (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(("libatomic-ops" ,libatomic-ops))) ;; 'USE_LIBC_PRIVATES' is now the default. diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm index 496120a..c3e874b 100644 --- a/gnu/packages/bittorrent.scm +++ b/gnu/packages/bittorrent.scm @@ -66,7 +66,6 @@ ("libevent" ,libevent) ("curl" ,curl) ("openssl" ,openssl) - ("file" ,file) ("zlib" ,zlib) ("gtk+" ,gtk+))) (native-inputs diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm index 87a70de..afe816d 100644 --- a/gnu/packages/cmake.scm +++ b/gnu/packages/cmake.scm @@ -78,8 +78,6 @@ (string-join (take (string-split version #\.) 2) ".")))))) %standard-phases))) - (inputs - `(("file" ,file))) (home-page "http://www.cmake.org/") (synopsis "Cross-platform build system") (description diff --git a/gnu/packages/file.scm b/gnu/packages/file.scm index f53c22f..067f20e 100644 --- a/gnu/packages/file.scm +++ b/gnu/packages/file.scm @@ -35,9 +35,6 @@ (sha256 (base32 "01xz106biz6x4h5ilymg5v3367djvgnfp4lm87132cjqdmqgn6b5")))) (build-system gnu-build-system) - (native-inputs - ;; This package depends upon a native install of itself. - (if (%current-target-system) `(("file" ,file)) '() )) (synopsis "file, a file type guesser") (description "The file command is a file type guesser, a command-line tool that tells diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 737e610..adcf385 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -63,12 +63,6 @@ ,@(if (%current-target-system) `(("bash" ,bash)) '()))) - (native-inputs - `(;; 'file' is needed by the pre-release libtool on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - `(("file" ,file)) - '()))) (home-page "http://www.gnu.org/software/gawk/") (synopsis "A text scanning and processing language") (description diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 014266c..25bb0e1 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -97,20 +97,11 @@ image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.") (inputs `(("zlib" ,zlib) ("libjpeg-8" ,libjpeg-8))) ;; currently does not compile with libjpeg version 9 - (native-inputs `(("file" ,file))) (arguments `(#:configure-flags (list (string-append "--with-jpeg-include-dir=" (assoc-ref %build-inputs "libjpeg-8") - "/include")) - #:phases - (alist-cons-before - 'configure 'patch-configure - (lambda _ - (substitute* "configure" - (("`/usr/bin/file") - (string-append "`" (which "file"))))) - %standard-phases))) + "/include")))) (synopsis "Libtiff, a library for handling TIFF files") (description "Libtiff provides support for the Tag Image File Format (TIFF), a format diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index 067838f..8033fdc 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -45,12 +45,6 @@ (base32 "1sznmrhcswwbyqla9y2ximlkzbxks59wjfs3lh7qf8ayranyxzlp")))) (build-system gnu-build-system) - (native-inputs - `(;; 'file' is needed by the pre-release libtool on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - `(("file" ,file)) - '()))) (arguments `(#:phases (alist-cons-after 'install 'post-install ,post-install-phase %standard-phases))) diff --git a/gnu/packages/mc.scm b/gnu/packages/mc.scm index aba14d5..e83f82c 100644 --- a/gnu/packages/mc.scm +++ b/gnu/packages/mc.scm @@ -46,7 +46,6 @@ (patches (list (search-patch "mc-fix-ncurses-build.patch"))))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) - ("file" ,file) ("perl" ,perl))) (inputs `(("aspell" ,aspell) ("ncurses" ,ncurses) @@ -55,14 +54,7 @@ ("check" ,check))) (arguments `(#:configure-flags - '("--with-screen=ncurses" "--enable-aspell") - #:phases - (alist-cons-before - 'configure 'patch-configure - (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) - %standard-phases))) + '("--with-screen=ncurses" "--enable-aspell"))) (home-page "http://www.midnight-commander.org") (synopsis "Graphical file manager") (description diff --git a/gnu/packages/mcrypt.scm b/gnu/packages/mcrypt.scm index eac8c72..a656639 100644 --- a/gnu/packages/mcrypt.scm +++ b/gnu/packages/mcrypt.scm @@ -68,7 +68,6 @@ them.") (base32 "0gipgb939vy9m66d3k8il98rvvwczyaw2ixr8yn6icds9c3nrsz4")))) (build-system gnu-build-system) - (native-inputs `(("file" ,file))) (home-page "http://mcrypt.sourceforge.net/") (synopsis "Encryption algorithm library") (description @@ -95,8 +94,7 @@ XTEA, 3WAY, TWOFISH, BLOWFISH, ARCFOUR, WAKE and more.") (patches (list (search-patch "mhash-keygen-test-segfault.patch"))))) (build-system gnu-build-system) (native-inputs - `(("file" ,file) - ("perl" ,perl))) ;for tests + `(("perl" ,perl))) ;for tests (home-page "http://mhash.sourceforge.net/") (synopsis "Thread-safe hash library") (description diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index 48f4d29..854be3c 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -96,7 +96,6 @@ listing the files modified by a patch.") (build-system gnu-build-system) (inputs `(("perl" ,perl) ("less" ,less) - ("file" ,file) ("ed" ,ed))) (arguments '(#:parallel-tests? #f diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm index 8c51b54..2209cb9 100644 --- a/gnu/packages/pretty-print.scm +++ b/gnu/packages/pretty-print.scm @@ -53,45 +53,39 @@ ("imagemagick" ,imagemagick))) (native-inputs `(("gperf" ,gperf) - ("perl" ,perl) - ("file" ,file))) + ("perl" ,perl))) (arguments '(#:phases (alist-cons-before - 'configure 'patch-configure + 'build 'patch-scripts (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) + (substitute* + '("afm/make_fonts_map.sh" + "tests/defs" + "tests/backup.tst" + "tests/styles.tst") + (("/bin/rm") (which "rm")))) (alist-cons-before - 'build 'patch-scripts - (lambda _ - (substitute* - '("afm/make_fonts_map.sh" - "tests/defs" - "tests/backup.tst" - "tests/styles.tst") - (("/bin/rm") (which "rm")))) - (alist-cons-before - 'check 'patch-test-files - ;; Alternatively, we could unpatch the shebangs in tstfiles - (lambda* (#:key inputs #:allow-other-keys) - (let ((perl (assoc-ref inputs "perl"))) - (substitute* '("tests/ps-ref/includeres.ps" - "tests/gps-ref/includeres.ps") - (("/usr/local/bin/perl") - (string-append perl "/bin/perl")))) - ;; Some of the reference postscript contain a 'version 3' - ;; string that in inconsistent with the source text in the - ;; tstfiles directory. Erroneous search-and-replace? - (substitute* '("tests/ps-ref/InsertBlock.ps" - "tests/gps-ref/InsertBlock.ps" - "tests/ps-ref/bookie.ps" - "tests/gps-ref/bookie.ps") - (("version 3") "version 2")) - (substitute* '("tests/ps-ref/psmandup.ps" - "tests/gps-ref/psmandup.ps") - (("#! */bin/sh") (string-append - "#!" (which "sh"))))) - %standard-phases))))) + 'check 'patch-test-files + ;; Alternatively, we could unpatch the shebangs in tstfiles + (lambda* (#:key inputs #:allow-other-keys) + (let ((perl (assoc-ref inputs "perl"))) + (substitute* '("tests/ps-ref/includeres.ps" + "tests/gps-ref/includeres.ps") + (("/usr/local/bin/perl") + (string-append perl "/bin/perl")))) + ;; Some of the reference postscript contain a 'version 3' + ;; string that in inconsistent with the source text in the + ;; tstfiles directory. Erroneous search-and-replace? + (substitute* '("tests/ps-ref/InsertBlock.ps" + "tests/gps-ref/InsertBlock.ps" + "tests/ps-ref/bookie.ps" + "tests/gps-ref/bookie.ps") + (("version 3") "version 2")) + (substitute* '("tests/ps-ref/psmandup.ps" + "tests/gps-ref/psmandup.ps") + (("#! */bin/sh") (string-append + "#!" (which "sh"))))) + %standard-phases)))) (home-page "http://www.gnu.org/software/a2ps") (synopsis "Any file to PostScript, including pretty-printing") (description @@ -115,16 +109,9 @@ special cases, such as pretty-printing \"--help\" output.") (base32 "13rkc0fga10xyf56yy9dnq95zndnfadkhxflnp24skszj21y8jqh")))) (build-system gnu-build-system) - (native-inputs `(("file" ,file))) (arguments ;; Must define DIFF_CMD for tests to pass - '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\"") - #:phases (alist-cons-before - 'configure 'patch-configure - (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) - %standard-phases))) + '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\""))) (home-page "http://www.gnu.org/software/trueprint") (synopsis "Pretty-print C sources and other plain text to PostScript") (description @@ -178,34 +165,28 @@ different programming languages.") `(("boost" ,boost))) (native-inputs `(("bison" ,bison) - ("flex" ,flex) - ("file" ,file))) + ("flex" ,flex))) (arguments `(#:configure-flags (list (string-append "--with-boost=" (assoc-ref %build-inputs "boost"))) #:parallel-tests? #f ;There appear to be race conditions #:phases (alist-cons-before - 'configure 'patch-configure + 'check 'patch-test-files (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) - (alist-cons-before - 'check 'patch-test-files - (lambda _ - ;; Unpatch shebangs in test input so that source-highlight - ;; is still able to infer input language - (substitute* '("tests/test.sh" - "tests/test2.sh" - "tests/test.tcl") - (((string-append "#! *" (which "sh"))) "#!/bin/sh")) - ;; Initial patching unrecoverably removes whitespace, so - ;; remove it also in the comparison output. - (substitute* '("tests/test.sh.html" - "tests/test2.sh.html" - "tests/test.tcl.html") - (("#! */bin/sh") "#!/bin/sh"))) - %standard-phases)))) + ;; Unpatch shebangs in test input so that source-highlight + ;; is still able to infer input language + (substitute* '("tests/test.sh" + "tests/test2.sh" + "tests/test.tcl") + (((string-append "#! *" (which "sh"))) "#!/bin/sh")) + ;; Initial patching unrecoverably removes whitespace, so + ;; remove it also in the comparison output. + (substitute* '("tests/test.sh.html" + "tests/test2.sh.html" + "tests/test.tcl.html") + (("#! */bin/sh") "#!/bin/sh"))) + %standard-phases))) (home-page "http://www.gnu.org/software/src-highlite") (synopsis "Produce a document with syntax highlighting from a source file") (description -- 1.8.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file 2014-08-21 16:02 ` [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file mhw @ 2014-08-22 6:12 ` mhw 2014-08-22 9:09 ` Ludovic Courtès 2014-08-22 9:03 ` Ludovic Courtès 2014-08-30 20:22 ` Ludovic Courtès 2 siblings, 1 reply; 8+ messages in thread From: mhw @ 2014-08-22 6:12 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 92 bytes --] Here are updated versions of these patches. Please disregard the earlier ones. Mark [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: [PATCH 1/3] gnu: bootstrap: Add 'file' to %boot0-inputs and %final-inputs --] [-- Type: text/x-patch, Size: 1888 bytes --] From 554d86b02c75922a1c05b5e65cfccd3cc8bd23db Mon Sep 17 00:00:00 2001 From: Mark H Weaver <mhw@netris.org> Date: Thu, 21 Aug 2014 11:26:40 -0400 Subject: [PATCH 1/3] gnu: bootstrap: Add 'file' to %boot0-inputs and %final-inputs. * gnu/packages/base.scm (file-boot0): New variable. (%boot0-inputs): Add 'file-boot0'. (%final-inputs): Add 'file' to list of packages to 'finalize'. --- gnu/packages/base.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 8060ab6..30176cf 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages gcc) #:use-module (gnu packages ed) + #:use-module (gnu packages file) #:use-module (gnu packages gawk) #:use-module (gnu packages guile) #:use-module (gnu packages multiprecision) @@ -630,11 +631,20 @@ and daylight-saving rules.") (current-source-location) #:guile %bootstrap-guile))) +(define file-boot0 + (package-with-bootstrap-guile + (package-with-explicit-inputs file + `(("make" ,gnu-make-boot0) + ,@%bootstrap-inputs) + (current-source-location) + #:guile %bootstrap-guile))) + (define %boot0-inputs `(("make" ,gnu-make-boot0) ("diffutils" ,diffutils-boot0) ("findutils" ,findutils-boot0) + ("file" ,file-boot0) ,@%bootstrap-inputs)) (define* (nix-system->gnu-triplet @@ -1187,6 +1197,7 @@ store.") ("gzip" ,gzip) ("bzip2" ,bzip2) ("xz" ,xz) + ("file" ,file) ("diffutils" ,diffutils) ("patch" ,patch) ("sed" ,sed) -- 1.8.4 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: [PATCH 2/3] gnu-build-system: Add 'patch-usr-bin-file' to %standard-phases --] [-- Type: text/x-patch, Size: 2419 bytes --] From 883f77d92f5b1e8af294f88abea0b09487fb901b Mon Sep 17 00:00:00 2001 From: Mark H Weaver <mhw@netris.org> Date: Thu, 21 Aug 2014 11:30:08 -0400 Subject: [PATCH 2/3] gnu-build-system: Add 'patch-usr-bin-file' to %standard-phases. * guix/build/gnu-build-system.scm (patch-usr-bin-file): New procedure. (%standard-phases): Add it. --- guix/build/gnu-build-system.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 8636931..a1fe26e 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -106,6 +106,31 @@ working directory." (and (zero? (system* "tar" "xvf" source)) (chdir (first-subdirectory "."))))) +(define* (patch-usr-bin-file #:key native-inputs inputs #:allow-other-keys) + "Patch occurrences of /usr/bin/file in configure, if present." + (let ((file "configure") + (file-command (or (and=> (assoc-ref (or native-inputs inputs) "file") + (cut string-append <> "/bin/file")) + (which "file")))) + (cond ((not (file-exists? file)) + (format (current-error-port) + "patch-usr-bin-file: warning: `~a' not found~%" + file)) + ((not file-command) + (format (current-error-port) + "patch-usr-bin-file: warning: `file' not found in PATH~%")) + (else + (let ((st (stat file))) + (substitute* file + (("/usr/bin/file") + (begin + (format (current-error-port) + "patch-usr-bin-file: ~a: changing `~a' to `~a'~%" + file "/usr/bin/file" file-command) + file-command))) + (set-file-time file st)))) + #t)) + (define* (patch-source-shebangs #:key source #:allow-other-keys) "Patch shebangs in all source files; this includes non-executable files such as `.in' templates. Most scripts honor $SHELL and @@ -353,6 +378,7 @@ makefiles." (let-syntax ((phases (syntax-rules () ((_ p ...) `((p . ,p) ...))))) (phases set-paths unpack + patch-usr-bin-file patch-source-shebangs configure patch-generated-file-shebangs build check install patch-shebangs strip))) -- 1.8.4 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #4: [PATCH 3/3] gnu: Rely on 'file' implicit input and 'patch-usr-bin-file' --] [-- Type: text/x-patch, Size: 15538 bytes --] From 6818e2a6e53afa7b90379a4a99f014308c8cd2ee Mon Sep 17 00:00:00 2001 From: Mark H Weaver <mhw@netris.org> Date: Thu, 21 Aug 2014 22:39:18 -0400 Subject: [PATCH 3/3] gnu: Rely on 'file' implicit input and 'patch-usr-bin-file'. * gnu/packages/admin.scm (sudo): * gnu/packages/gawk.scm (gawk): Remove workaround on MIPS. * gnu/packages/mcrypt.scm (mcrypt, libmhash): * gnu/packages/file.scm (file): Remove 'file' from native-inputs. * gnu/packages/mc.scm (mc): * gnu/packages/pretty-print.scm (a2ps, trueprint, source-highlight): * gnu/packages/image.scm (libtiff): Remove 'file' from native-inputs. Remove 'patch-configure' phase. --- gnu/packages/admin.scm | 13 +---- gnu/packages/file.scm | 3 -- gnu/packages/gawk.scm | 11 ----- gnu/packages/image.scm | 12 +---- gnu/packages/mc.scm | 11 +---- gnu/packages/mcrypt.scm | 7 +-- gnu/packages/pretty-print.scm | 112 +++++++++++++++++------------------------- 7 files changed, 51 insertions(+), 118 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index c259974..4d60c17 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -648,18 +648,7 @@ system administrator.") "") (("^install: (.*)install-sudoers(.*)" _ before after) ;; Don't try to create /etc/sudoers. - (string-append "install: " before after "\n"))) - - ;; XXX FIXME sudo 1.8.10p3 was bootstrapped with a - ;; prerelease libtool, which fails on MIPS in the absence - ;; of /usr/bin/file. As a temporary workaround, we patch - ;; the configure script to hardcode use of the little - ;; endian N32 ABI on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - '((substitute* "configure" - (("\\$emul") "elf32ltsmipn32"))) - '())) + (string-append "install: " before after "\n")))) %standard-phases) ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but diff --git a/gnu/packages/file.scm b/gnu/packages/file.scm index f53c22f..067f20e 100644 --- a/gnu/packages/file.scm +++ b/gnu/packages/file.scm @@ -35,9 +35,6 @@ (sha256 (base32 "01xz106biz6x4h5ilymg5v3367djvgnfp4lm87132cjqdmqgn6b5")))) (build-system gnu-build-system) - (native-inputs - ;; This package depends upon a native install of itself. - (if (%current-target-system) `(("file" ,file)) '() )) (synopsis "file, a file type guesser") (description "The file command is a file type guesser, a command-line tool that tells diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 6185409..fd14b4c 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -55,17 +55,6 @@ '((substitute* "extension/Makefile.in" (("^.*: check-for-shared-lib-support" match) (string-append "### " match)))) - '()) - - ;; XXX FIXME gawk 4.1.1 was bootstrapped with a prerelease - ;; libtool, which fails on MIPS in the absence of - ;; /usr/bin/file. As a temporary workaround, we patch - ;; the configure script to hardcode use of the little - ;; endian N32 ABI on MIPS. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) - (%current-system))) - '((substitute* "extension/configure" - (("\\$emul") "elf32ltsmipn32"))) '()))) %standard-phases))) (inputs `(("libsigsegv" ,libsigsegv) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 014266c..06f6271 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -19,7 +19,6 @@ (define-module (gnu packages image) #:use-module (gnu packages) #:use-module (gnu packages compression) - #:use-module (gnu packages file) #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:)) #:use-module (guix packages) #:use-module (guix download) @@ -97,20 +96,11 @@ image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.") (inputs `(("zlib" ,zlib) ("libjpeg-8" ,libjpeg-8))) ;; currently does not compile with libjpeg version 9 - (native-inputs `(("file" ,file))) (arguments `(#:configure-flags (list (string-append "--with-jpeg-include-dir=" (assoc-ref %build-inputs "libjpeg-8") - "/include")) - #:phases - (alist-cons-before - 'configure 'patch-configure - (lambda _ - (substitute* "configure" - (("`/usr/bin/file") - (string-append "`" (which "file"))))) - %standard-phases))) + "/include")))) (synopsis "Libtiff, a library for handling TIFF files") (description "Libtiff provides support for the Tag Image File Format (TIFF), a format diff --git a/gnu/packages/mc.scm b/gnu/packages/mc.scm index aba14d5..6e3747c 100644 --- a/gnu/packages/mc.scm +++ b/gnu/packages/mc.scm @@ -28,7 +28,6 @@ #:use-module (gnu packages ssh) #:use-module (gnu packages pkg-config) #:use-module (gnu packages check) - #:use-module (gnu packages file) #:use-module (gnu packages perl)) (define-public mc @@ -46,7 +45,6 @@ (patches (list (search-patch "mc-fix-ncurses-build.patch"))))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) - ("file" ,file) ("perl" ,perl))) (inputs `(("aspell" ,aspell) ("ncurses" ,ncurses) @@ -55,14 +53,7 @@ ("check" ,check))) (arguments `(#:configure-flags - '("--with-screen=ncurses" "--enable-aspell") - #:phases - (alist-cons-before - 'configure 'patch-configure - (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) - %standard-phases))) + '("--with-screen=ncurses" "--enable-aspell"))) (home-page "http://www.midnight-commander.org") (synopsis "Graphical file manager") (description diff --git a/gnu/packages/mcrypt.scm b/gnu/packages/mcrypt.scm index eac8c72..12a4827 100644 --- a/gnu/packages/mcrypt.scm +++ b/gnu/packages/mcrypt.scm @@ -23,8 +23,7 @@ #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) - #:use-module (gnu packages perl) - #:use-module (gnu packages file)) + #:use-module (gnu packages perl)) (define-public mcrypt (package @@ -68,7 +67,6 @@ them.") (base32 "0gipgb939vy9m66d3k8il98rvvwczyaw2ixr8yn6icds9c3nrsz4")))) (build-system gnu-build-system) - (native-inputs `(("file" ,file))) (home-page "http://mcrypt.sourceforge.net/") (synopsis "Encryption algorithm library") (description @@ -95,8 +93,7 @@ XTEA, 3WAY, TWOFISH, BLOWFISH, ARCFOUR, WAKE and more.") (patches (list (search-patch "mhash-keygen-test-segfault.patch"))))) (build-system gnu-build-system) (native-inputs - `(("file" ,file) - ("perl" ,perl))) ;for tests + `(("perl" ,perl))) ;for tests (home-page "http://mhash.sourceforge.net/") (synopsis "Thread-safe hash library") (description diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm index 8c51b54..07837eb 100644 --- a/gnu/packages/pretty-print.scm +++ b/gnu/packages/pretty-print.scm @@ -30,8 +30,7 @@ #:use-module (gnu packages bison) #:use-module (gnu packages flex) #:use-module (gnu packages gperf) - #:use-module (gnu packages perl) - #:use-module (gnu packages file)) + #:use-module (gnu packages perl)) (define-public a2ps (package @@ -53,45 +52,39 @@ ("imagemagick" ,imagemagick))) (native-inputs `(("gperf" ,gperf) - ("perl" ,perl) - ("file" ,file))) + ("perl" ,perl))) (arguments '(#:phases (alist-cons-before - 'configure 'patch-configure + 'build 'patch-scripts (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) + (substitute* + '("afm/make_fonts_map.sh" + "tests/defs" + "tests/backup.tst" + "tests/styles.tst") + (("/bin/rm") (which "rm")))) (alist-cons-before - 'build 'patch-scripts - (lambda _ - (substitute* - '("afm/make_fonts_map.sh" - "tests/defs" - "tests/backup.tst" - "tests/styles.tst") - (("/bin/rm") (which "rm")))) - (alist-cons-before - 'check 'patch-test-files - ;; Alternatively, we could unpatch the shebangs in tstfiles - (lambda* (#:key inputs #:allow-other-keys) - (let ((perl (assoc-ref inputs "perl"))) - (substitute* '("tests/ps-ref/includeres.ps" - "tests/gps-ref/includeres.ps") - (("/usr/local/bin/perl") - (string-append perl "/bin/perl")))) - ;; Some of the reference postscript contain a 'version 3' - ;; string that in inconsistent with the source text in the - ;; tstfiles directory. Erroneous search-and-replace? - (substitute* '("tests/ps-ref/InsertBlock.ps" - "tests/gps-ref/InsertBlock.ps" - "tests/ps-ref/bookie.ps" - "tests/gps-ref/bookie.ps") - (("version 3") "version 2")) - (substitute* '("tests/ps-ref/psmandup.ps" - "tests/gps-ref/psmandup.ps") - (("#! */bin/sh") (string-append - "#!" (which "sh"))))) - %standard-phases))))) + 'check 'patch-test-files + ;; Alternatively, we could unpatch the shebangs in tstfiles + (lambda* (#:key inputs #:allow-other-keys) + (let ((perl (assoc-ref inputs "perl"))) + (substitute* '("tests/ps-ref/includeres.ps" + "tests/gps-ref/includeres.ps") + (("/usr/local/bin/perl") + (string-append perl "/bin/perl")))) + ;; Some of the reference postscript contain a 'version 3' + ;; string that in inconsistent with the source text in the + ;; tstfiles directory. Erroneous search-and-replace? + (substitute* '("tests/ps-ref/InsertBlock.ps" + "tests/gps-ref/InsertBlock.ps" + "tests/ps-ref/bookie.ps" + "tests/gps-ref/bookie.ps") + (("version 3") "version 2")) + (substitute* '("tests/ps-ref/psmandup.ps" + "tests/gps-ref/psmandup.ps") + (("#! */bin/sh") (string-append + "#!" (which "sh"))))) + %standard-phases)))) (home-page "http://www.gnu.org/software/a2ps") (synopsis "Any file to PostScript, including pretty-printing") (description @@ -115,16 +108,9 @@ special cases, such as pretty-printing \"--help\" output.") (base32 "13rkc0fga10xyf56yy9dnq95zndnfadkhxflnp24skszj21y8jqh")))) (build-system gnu-build-system) - (native-inputs `(("file" ,file))) (arguments ;; Must define DIFF_CMD for tests to pass - '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\"") - #:phases (alist-cons-before - 'configure 'patch-configure - (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) - %standard-phases))) + '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\""))) (home-page "http://www.gnu.org/software/trueprint") (synopsis "Pretty-print C sources and other plain text to PostScript") (description @@ -178,34 +164,28 @@ different programming languages.") `(("boost" ,boost))) (native-inputs `(("bison" ,bison) - ("flex" ,flex) - ("file" ,file))) + ("flex" ,flex))) (arguments `(#:configure-flags (list (string-append "--with-boost=" (assoc-ref %build-inputs "boost"))) #:parallel-tests? #f ;There appear to be race conditions #:phases (alist-cons-before - 'configure 'patch-configure + 'check 'patch-test-files (lambda _ - (substitute* "configure" - (("/usr/bin/file") (which "file")))) - (alist-cons-before - 'check 'patch-test-files - (lambda _ - ;; Unpatch shebangs in test input so that source-highlight - ;; is still able to infer input language - (substitute* '("tests/test.sh" - "tests/test2.sh" - "tests/test.tcl") - (((string-append "#! *" (which "sh"))) "#!/bin/sh")) - ;; Initial patching unrecoverably removes whitespace, so - ;; remove it also in the comparison output. - (substitute* '("tests/test.sh.html" - "tests/test2.sh.html" - "tests/test.tcl.html") - (("#! */bin/sh") "#!/bin/sh"))) - %standard-phases)))) + ;; Unpatch shebangs in test input so that source-highlight + ;; is still able to infer input language + (substitute* '("tests/test.sh" + "tests/test2.sh" + "tests/test.tcl") + (((string-append "#! *" (which "sh"))) "#!/bin/sh")) + ;; Initial patching unrecoverably removes whitespace, so + ;; remove it also in the comparison output. + (substitute* '("tests/test.sh.html" + "tests/test2.sh.html" + "tests/test.tcl.html") + (("#! */bin/sh") "#!/bin/sh"))) + %standard-phases))) (home-page "http://www.gnu.org/software/src-highlite") (synopsis "Produce a document with syntax highlighting from a source file") (description -- 1.8.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file 2014-08-22 6:12 ` mhw @ 2014-08-22 9:09 ` Ludovic Courtès 0 siblings, 0 replies; 8+ messages in thread From: Ludovic Courtès @ 2014-08-22 9:09 UTC (permalink / raw) To: mhw; +Cc: guix-devel mhw@netris.org skribis: > From 554d86b02c75922a1c05b5e65cfccd3cc8bd23db Mon Sep 17 00:00:00 2001 > From: Mark H Weaver <mhw@netris.org> > Date: Thu, 21 Aug 2014 11:26:40 -0400 > Subject: [PATCH 1/3] gnu: bootstrap: Add 'file' to %boot0-inputs and > %final-inputs. > > * gnu/packages/base.scm (file-boot0): New variable. > (%boot0-inputs): Add 'file-boot0'. > (%final-inputs): Add 'file' to list of packages to 'finalize'. LGTM. Please try to do the same check that ‘check-final-inputs-self-contained.scm’ does by hand, to make sure nothing is breaking here. > From 883f77d92f5b1e8af294f88abea0b09487fb901b Mon Sep 17 00:00:00 2001 > From: Mark H Weaver <mhw@netris.org> > Date: Thu, 21 Aug 2014 11:30:08 -0400 > Subject: [PATCH 2/3] gnu-build-system: Add 'patch-usr-bin-file' to > %standard-phases. > > * guix/build/gnu-build-system.scm (patch-usr-bin-file): New procedure. > (%standard-phases): Add it. [...] > +(define* (patch-usr-bin-file #:key native-inputs inputs #:allow-other-keys) > + "Patch occurrences of /usr/bin/file in configure, if present." Please add a link to the Libtool bug report. Also, for convenience, it might help to add a #:patch-/usr/bin/file? keyword parameter. > From 6818e2a6e53afa7b90379a4a99f014308c8cd2ee Mon Sep 17 00:00:00 2001 > From: Mark H Weaver <mhw@netris.org> > Date: Thu, 21 Aug 2014 22:39:18 -0400 > Subject: [PATCH 3/3] gnu: Rely on 'file' implicit input and > 'patch-usr-bin-file'. > > * gnu/packages/admin.scm (sudo): > * gnu/packages/gawk.scm (gawk): Remove workaround on MIPS. > > * gnu/packages/mcrypt.scm (mcrypt, libmhash): > * gnu/packages/file.scm (file): Remove 'file' from native-inputs. > > * gnu/packages/mc.scm (mc): > * gnu/packages/pretty-print.scm (a2ps, trueprint, source-highlight): > * gnu/packages/image.scm (libtiff): Remove 'file' from native-inputs. > Remove 'patch-configure' phase. OK. Thanks for all this! Ludo’. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file 2014-08-21 16:02 ` [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file mhw 2014-08-22 6:12 ` mhw @ 2014-08-22 9:03 ` Ludovic Courtès 2014-08-30 20:22 ` Ludovic Courtès 2 siblings, 0 replies; 8+ messages in thread From: Ludovic Courtès @ 2014-08-22 9:03 UTC (permalink / raw) To: mhw; +Cc: guix-devel mhw@netris.org skribis: > I chose to add a 'file-boot0' to '%boot0-inputs' to make 'file' > available as early as possible in the bootstrap, on the theory that any > library could soon depend on 'file'. That makes sense. > I've successfully built 'hello' on i686 with these patches applied, but > I've not yet tested them on MIPS. If I test them on the Loongson 3A > machine, then when hydra offloads the same builds, the build logs on > hydra will be empty. It would be good if hydra would copy over the > saved build log in that case. Yes, that’s annoying. The crux of the problem is that the offload hook just invokes ‘guix build’ on the remote machine, and ‘guix build’ produces no output when the thing is already built. We could add a ‘--replay-log’ option to ‘guix build’ to handle that case. Thoughts? Ludo’. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file 2014-08-21 16:02 ` [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file mhw 2014-08-22 6:12 ` mhw 2014-08-22 9:03 ` Ludovic Courtès @ 2014-08-30 20:22 ` Ludovic Courtès 2 siblings, 0 replies; 8+ messages in thread From: Ludovic Courtès @ 2014-08-30 20:22 UTC (permalink / raw) To: mhw; +Cc: guix-devel mhw@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’. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-08-30 20:22 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-08-20 18:58 Making 'file' an implicit native input in core-updates mhw 2014-08-20 19:21 ` Eric Bavier 2014-08-20 21:33 ` Ludovic Courtès 2014-08-21 16:02 ` [PATCHES] Add 'file' to %final-inputs; patch /usr/bin/file mhw 2014-08-22 6:12 ` mhw 2014-08-22 9:09 ` Ludovic Courtès 2014-08-22 9:03 ` Ludovic Courtès 2014-08-30 20:22 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/guix.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).