Merge branch 'core-updates'
[jackhill/guix/guix.git] / gnu / packages / m4.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 (gnu packages m4)
20 #:use-module (guix licenses)
21 #:use-module (gnu packages)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu))
25
26 (define-public m4
27 (package
28 (name "m4")
29 (version "1.4.17")
30 (source (origin
31 (method url-fetch)
32 (uri (string-append "mirror://gnu/m4/m4-"
33 version ".tar.bz2"))
34 (sha256
35 (base32
36 "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf"))))
37 (build-system gnu-build-system)
38 (arguments
39 ;; XXX: Disable tests on those platforms with know issues.
40 `(#:tests? ,(not (member (%current-system)
41 '("x86_64-darwin"
42 "i686-cygwin"
43 "i686-sunos")))
44 #:patches (list (assoc-ref %build-inputs
45 "patch/readlink-EINVAL"))
46 #:phases (alist-cons-before
47 'check 'pre-check
48 (lambda* (#:key inputs #:allow-other-keys)
49 ;; Fix references to /bin/sh.
50 (let ((bash (assoc-ref inputs "bash")))
51 (for-each patch-shebang
52 (find-files "tests" "\\.sh$"))
53 (substitute* (find-files "tests"
54 "posix_spawn")
55 (("/bin/sh")
56 (format #f "~a/bin/bash" bash)))))
57 %standard-phases)))
58 (inputs `(("patch/readlink-EINVAL"
59 ,(search-patch "m4-readlink-EINVAL.patch"))))
60 (synopsis "Macro processor")
61 (description
62 "GNU M4 is an implementation of the traditional Unix macro processor. It
63 is mostly SVR4 compatible although it has some extensions (for example,
64 handling more than 9 positional parameters to macros). GNU M4 also has
65 built-in functions for including files, running shell commands, doing
66 arithmetic, etc.
67
68 GNU M4 is a macro processor in the sense that it copies its input to the
69 output expanding macros as it goes. Macros are either builtin or
70 user-defined and can take any number of arguments. Besides just doing macro
71 expansion, m4 has builtin functions for including named files, running UNIX
72 commands, doing integer arithmetic, manipulating text in various ways,
73 recursion etc... m4 can be used either as a front-end to a compiler or as a
74 macro processor in its own right.")
75 (license gpl3+)
76 (home-page "http://www.gnu.org/software/m4/")))