Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / m4.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
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 m4)
21 #:use-module (guix licenses)
22 #:use-module (gnu packages)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu))
26
27 (define-public m4
28 (package
29 (name "m4")
30 (version "1.4.18")
31 (source (origin
32 (method url-fetch)
33 (uri (string-append "mirror://gnu/m4/m4-"
34 version ".tar.xz"))
35 (sha256
36 (base32
37 "01sfjd5a4waqw83bibvmn522g69qfqvwig9i2qlgy154l1nfihgj"))))
38 (build-system gnu-build-system)
39 (arguments
40 `(;; Explicitly disable tests when cross-compiling, otherwise 'make check'
41 ;; proceeds and fails, unsurprisingly.
42 #:tests? ,(not (%current-target-system))
43
44 #:phases
45 (modify-phases %standard-phases
46 (add-before 'check 'pre-check
47 (lambda* (#:key inputs #:allow-other-keys)
48 ;; Fix references to /bin/sh.
49 (let ((bash (assoc-ref inputs "bash")))
50 (for-each patch-shebang
51 (find-files "tests" "\\.sh$"))
52 (substitute* (find-files "tests"
53 "posix_spawn")
54 (("/bin/sh")
55 (format #f "~a/bin/sh" bash)))
56 #t))))))
57 (synopsis "Macro processor")
58 (description
59 "GNU M4 is an implementation of the M4 macro language, which features
60 some extensions over other implementations, some of which are required by GNU
61 Autoconf. It is used as a macro processor, which means it processes text,
62 expanding macros as it encounters them. It also has some built-in functions,
63 for example to run shell commands or to do arithmetic.")
64 (license gpl3+)
65 (home-page "https://www.gnu.org/software/m4/")))