gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / gawk.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages gawk)
21 #:use-module (guix licenses)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages bash)
24 #:use-module (gnu packages libsigsegv)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu))
28
29 (define-public gawk
30 (package
31 (name "gawk")
32 (version "4.1.4")
33 (source (origin
34 (method url-fetch)
35 (uri (string-append "mirror://gnu/gawk/gawk-" version
36 ".tar.xz"))
37 (sha256
38 (base32 "0rn2mmjxm767zliqzd67j7h2ncjn4j0321c60y9fy3grs3i89qak"))))
39 (build-system gnu-build-system)
40 (arguments
41 `(#:parallel-tests? #f ; test suite fails in parallel
42
43 #:phases (modify-phases %standard-phases
44 (add-before 'configure 'set-shell-file-name
45 (lambda* (#:key inputs #:allow-other-keys)
46 ;; Refer to the right shell.
47 (let ((bash (assoc-ref inputs "bash")))
48 (substitute* "io.c"
49 (("/bin/sh")
50 (string-append bash "/bin/bash")))
51
52 ;; When cross-compiling, remove dependencies on the
53 ;; `check-for-shared-lib-support' target, which tries
54 ;; to run the cross-built `gawk'.
55 ,@(if (%current-target-system)
56 '((substitute* "extension/Makefile.in"
57 (("^.*: check-for-shared-lib-support" match)
58 (string-append "### " match))))
59 '()))))
60
61 (add-before 'check 'adjust-test-infrastructure
62 (lambda _
63 ;; Remove dependency on 'more' (from util-linux), which
64 ;; would needlessly complicate bootstrapping.
65 (substitute* "test/Makefile"
66 (("\\| more") ""))
67
68 ;; Adjust the shebang in that file since it is then diff'd
69 ;; against the actual test output.
70 (substitute* "test/watchpoint1.ok"
71 (("#! /usr/bin/gawk")
72 (string-append "#!" (which "gawk"))))
73 #t)))))
74
75 (inputs `(("libsigsegv" ,libsigsegv)
76
77 ,@(if (%current-target-system)
78 `(("bash" ,bash))
79 '())))
80
81 (home-page "http://www.gnu.org/software/gawk/")
82 (synopsis "Text scanning and processing language")
83 (description
84 "Gawk is the GNU implementation of Awk, a specialized programming
85 language for the easy manipulation of formatted text, such as tables of data.
86 Gawk features many extensions beyond the traditional implementation,
87 including network access, sorting, and large libraries.")
88 (license gpl3+)))