From e9bab1df6d4c71f9617362c2bd8babe61dec759d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Nov 2014 23:34:34 +0100 Subject: gnu: gawk: Build a UTF-8 locale for the tests. * gnu/packages/gawk.scm (gawk)[arguments]: Add 'install-locales' phase. --- gnu/packages/gawk.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 10506197f3..996be7af4a 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -64,7 +64,17 @@ (define-public gawk '((substitute* "extension/configure" (("/usr/bin/file") (which "file")))) '()))) - %standard-phases))) + + (alist-cons-before + 'check 'install-locales + (lambda _ + ;; A bunch of tests require the availability of a UTF-8 + ;; locale and otherwise fail. Give them what they want. + (setenv "LOCPATH" (getcwd)) + (zero? (system* "localedef" "--no-archive" + "--prefix" (getcwd) "-i" "en_US" + "-f" "UTF-8" "./en_US.UTF-8"))) + %standard-phases)))) (inputs `(("libsigsegv" ,libsigsegv) ,@(if (%current-target-system) -- cgit v1.2.3 From cf0a154c4105abf42824007848f4e319ce23f987 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 13:27:18 -0500 Subject: gnu: gawk: Fix target-system check. * gnu/packages/gawk.scm (gawk): Fix target-system check. --- gnu/packages/gawk.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 996be7af4a..74d0720567 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,7 +59,7 @@ (define-public gawk ;; XXX FIXME prerelease libtool fails on MIPS in the ;; absence of /usr/bin/file. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) + ,@(if (string-prefix? "mips64" (or (%current-target-system) (%current-system))) '((substitute* "extension/configure" (("/usr/bin/file") (which "file")))) -- cgit v1.2.3 From 4eb01e5442aa7bbaa880ae8e72bd5d27434855ef Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 9 Jan 2015 22:35:33 +0100 Subject: build-system/gnu: Patch /usr/bin/file in all 'configure' files. * guix/build/utils.scm (patch-/usr/bin/file): New procedure. * guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using it. Patch all the files returned by 'find-files' that are executable. * gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*' for 'extension/configure'. --- gnu/packages/gawk.scm | 10 +--------- guix/build/gnu-build-system.scm | 30 ++++++++---------------------- guix/build/utils.scm | 26 +++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 32 deletions(-) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 74d0720567..e0d3f41ac2 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -55,14 +55,6 @@ (define-public gawk '((substitute* "extension/Makefile.in" (("^.*: check-for-shared-lib-support" match) (string-append "### " match)))) - '()) - - ;; XXX FIXME prerelease libtool fails on MIPS in the - ;; absence of /usr/bin/file. - ,@(if (string-prefix? "mips64" (or (%current-target-system) - (%current-system))) - '((substitute* "extension/configure" - (("/usr/bin/file") (which "file")))) '()))) (alist-cons-before diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index cdfba2f9b7..2880168273 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -115,29 +115,15 @@ (define* (unpack #:key source #:allow-other-keys) (define* (patch-usr-bin-file #:key native-inputs inputs (patch-/usr/bin/file? #t) #:allow-other-keys) - "Patch occurrences of /usr/bin/file in configure, if present." + "Patch occurrences of \"/usr/bin/file\" in all the executable 'configure' +files found in the source tree. This works around Libtool's Autoconf macros, +which generates invocations of \"/usr/bin/file\" that are used to determine +things like the ABI being used." (when patch-/usr/bin/file? - (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)))))) + (for-each (lambda (file) + (when (executable-file? file) + (patch-/usr/bin/file file))) + (find-files "." "^configure$"))) #t) (define* (patch-source-shebangs #:key source #:allow-other-keys) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 86b7ca0155..4407f9af23 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; @@ -61,6 +61,7 @@ (define-module (guix build utils) set-file-time patch-shebang patch-makefile-SHELL + patch-/usr/bin/file fold-port-matches remove-store-references wrap-program)) @@ -681,6 +682,29 @@ (define (find-shell name) (when keep-mtime? (set-file-time file st)))) +(define* (patch-/usr/bin/file file + #:key + (file-command (which "file")) + (keep-mtime? #t)) + "Patch occurrences of \"/usr/bin/file\" in FILE, replacing them with +FILE-COMMAND. When KEEP-MTIME? is true, keep FILE's modification time +unchanged." + (if (not file-command) + (format (current-error-port) + "patch-/usr/bin/file: warning: \ +no replacement 'file' command, doing nothing~%") + (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))) + + (when keep-mtime? + (set-file-time file st))))) + (define* (fold-port-matches proc init pattern port #:optional (unmatched (lambda (_ r) r))) "Read from PORT character-by-character; for each match against -- cgit v1.2.3