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