gnu: Add dfc.
[jackhill/guix/guix.git] / gnu / packages / m4.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
21c203a5 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
c44899a2 3;;;
233e7676 4;;; This file is part of GNU Guix.
c44899a2 5;;;
233e7676 6;;; GNU Guix is free software; you can redistribute it and/or modify it
c44899a2
LC
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;;;
233e7676 11;;; GNU Guix is distributed in the hope that it will be useful, but
c44899a2
LC
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
233e7676 17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c44899a2 18
1ffa7090 19(define-module (gnu packages m4)
4a44e743 20 #:use-module (guix licenses)
59a43334 21 #:use-module (gnu packages)
c44899a2 22 #:use-module (guix packages)
87f5d366 23 #:use-module (guix download)
c44899a2
LC
24 #:use-module (guix build-system gnu))
25
26(define-public m4
27 (package
28 (name "m4")
29 (version "1.4.16")
30 (source (origin
87f5d366 31 (method url-fetch)
0db342a5 32 (uri (string-append "mirror://gnu/m4/m4-"
c44899a2
LC
33 version ".tar.bz2"))
34 (sha256
35 (base32
36 "035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22"))))
37 (build-system gnu-build-system)
21c203a5
LC
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 "patch/s_isdir")
45 (assoc-ref %build-inputs
46 "patch/readlink-EINVAL")
47 (assoc-ref %build-inputs "patch/gets"))
48 #:phases (alist-cons-before
49 'check 'pre-check
50 (lambda* (#:key inputs #:allow-other-keys)
51 ;; Fix references to /bin/sh.
52 (let ((bash (assoc-ref inputs "bash")))
53 (for-each patch-shebang
54 (find-files "tests" "\\.sh$"))
55 (substitute* (find-files "tests"
56 "posix_spawn")
57 (("/bin/sh")
58 (format #f "~a/bin/bash" bash)))))
59 %standard-phases)))
c44899a2
LC
60 (inputs `(("patch/s_isdir" ,(search-patch "m4-s_isdir.patch"))
61 ("patch/readlink-EINVAL"
62 ,(search-patch "m4-readlink-EINVAL.patch"))
63 ("patch/gets" ,(search-patch "m4-gets-undeclared.patch"))))
f50d2669 64 (synopsis "Macro processor")
c44899a2
LC
65 (description
66 "GNU M4 is an implementation of the traditional Unix macro processor. It
67is mostly SVR4 compatible although it has some extensions (for example,
68handling more than 9 positional parameters to macros). GNU M4 also has
69built-in functions for including files, running shell commands, doing
70arithmetic, etc.
71
72GNU M4 is a macro processor in the sense that it copies its input to the
73output expanding macros as it goes. Macros are either builtin or
74user-defined and can take any number of arguments. Besides just doing macro
75expansion, m4 has builtin functions for including named files, running UNIX
76commands, doing integer arithmetic, manipulating text in various ways,
77recursion etc... m4 can be used either as a front-end to a compiler or as a
78macro processor in its own right.")
4a44e743 79 (license gpl3+)
c44899a2 80 (home-page "http://www.gnu.org/software/m4/")))