Update `HACKING'.
[jackhill/guix/guix.git] / distro / packages / gawk.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (distro packages gawk)
20 #:use-module (guix licenses)
21 #:use-module (distro packages libsigsegv)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix utils)
25 #:use-module (guix build-system gnu))
26
27 (define-public gawk
28 (package
29 (name "gawk")
30 (version "4.0.0")
31 (source (origin
32 (method url-fetch)
33 (uri (string-append "mirror://gnu/gawk/gawk-" version
34 ".tar.bz2"))
35 (sha256
36 (base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0"))))
37 (build-system gnu-build-system)
38 (arguments
39 (case-lambda
40 ((system)
41 `(#:parallel-tests? #f ; test suite fails in parallel
42
43 ;; Work around test failure on Cygwin.
44 #:tests? ,(not (string=? system "i686-cygwin"))
45
46 #:phases (alist-cons-before
47 'configure 'set-shell-file-name
48 (lambda* (#:key inputs #:allow-other-keys)
49 ;; Refer to the right shell.
50 (let ((bash (assoc-ref inputs "bash")))
51 (substitute* "io.c"
52 (("/bin/sh")
53 (string-append bash "/bin/bash")))))
54 %standard-phases)))
55 ((system cross-system)
56 '(#:parallel-tests? #f))))
57 (inputs `(("libsigsegv" ,libsigsegv)))
58 (home-page "http://www.gnu.org/software/gawk/")
59 (synopsis "GNU implementation of the Awk programming language")
60 (description
61 "Many computer users need to manipulate text files: extract and then
62 operate on data from parts of certain lines while discarding the rest, make
63 changes in various text files wherever certain patterns appear, and so on.
64 To write a program to do these things in a language such as C or Pascal is a
65 time-consuming inconvenience that may take many lines of code. The job is
66 easy with awk, especially the GNU implementation: Gawk.
67
68 The awk utility interprets a special-purpose programming language that makes
69 it possible to handle many data-reformatting jobs with just a few lines of
70 code.")
71 (license gpl3+)))