Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
76002e54 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
cf0a154c | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
c44899a2 | 4 | ;;; |
233e7676 | 5 | ;;; This file is part of GNU Guix. |
c44899a2 | 6 | ;;; |
233e7676 | 7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
c44899a2 LC |
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 | ;;; | |
233e7676 | 12 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
c44899a2 LC |
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 | |
233e7676 | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
c44899a2 | 19 | |
1ffa7090 | 20 | (define-module (gnu packages gawk) |
4a44e743 | 21 | #:use-module (guix licenses) |
76002e54 | 22 | #:use-module (gnu packages) |
63c0c19a | 23 | #:use-module (gnu packages bash) |
1ffa7090 | 24 | #:use-module (gnu packages libsigsegv) |
c44899a2 | 25 | #:use-module (guix packages) |
87f5d366 | 26 | #:use-module (guix download) |
c44899a2 LC |
27 | #:use-module (guix build-system gnu)) |
28 | ||
29 | (define-public gawk | |
30 | (package | |
31 | (name "gawk") | |
e0649ff3 | 32 | (version "4.1.4") |
c44899a2 | 33 | (source (origin |
87f5d366 | 34 | (method url-fetch) |
0db342a5 | 35 | (uri (string-append "mirror://gnu/gawk/gawk-" version |
cecb712c | 36 | ".tar.xz")) |
c44899a2 | 37 | (sha256 |
e0649ff3 | 38 | (base32 "0rn2mmjxm767zliqzd67j7h2ncjn4j0321c60y9fy3grs3i89qak")))) |
c44899a2 | 39 | (build-system gnu-build-system) |
c2031363 | 40 | (arguments |
21c203a5 | 41 | `(#:parallel-tests? #f ; test suite fails in parallel |
c2031363 | 42 | |
3964e358 LC |
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") | |
f537ad0b | 50 | (string-append bash "/bin/bash"))) |
1e4310f1 | 51 | |
3964e358 LC |
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 | '())))) | |
e9bab1df | 60 | |
3964e358 LC |
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") "")) | |
e0649ff3 | 67 | |
3964e358 LC |
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))))) | |
e0649ff3 | 74 | |
63c0c19a LC |
75 | (inputs `(("libsigsegv" ,libsigsegv) |
76 | ||
63c0c19a LC |
77 | ,@(if (%current-target-system) |
78 | `(("bash" ,bash)) | |
79 | '()))) | |
fa5731ba | 80 | |
c44899a2 | 81 | (home-page "http://www.gnu.org/software/gawk/") |
9e771e3b | 82 | (synopsis "Text scanning and processing language") |
c44899a2 | 83 | (description |
79c311b8 LC |
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. | |
c5779c93 | 86 | Gawk features many extensions beyond the traditional implementation, |
79c311b8 | 87 | including network access, sorting, and large libraries.") |
4a44e743 | 88 | (license gpl3+))) |