projects/guix·blob javascript-team · refs

96 lines · 4.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <[email protected]>
3;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2022 Marius Bakke <[email protected]>
5;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages m4)
23 #:use-module (guix licenses)
24 #:use-module (gnu packages)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix utils))
29
30(define-public m4
31 (package
32 (name "m4")
33 (version "1.4.19")
34 (source (origin
35 (method url-fetch)
36 (uri (string-append "mirror://gnu/m4/m4-"
37 version ".tar.xz"))
38 (sha256
39 (base32
40 "15mghcksh11saylpm86h1zkz4in0rbi0pk8i6nqxkdikdmfdxbk3"))))
41 (build-system gnu-build-system)
42 (arguments
43 `(;; Explicitly disable tests when cross-compiling, otherwise 'make check'
44 ;; proceeds and fails, unsurprisingly.
45 #:tests? ,(not (%current-target-system))
46 ,@(if (system-hurd64?)
47 (list #:configure-flags
48 `'(,(string-append
49 "CFLAGS=-g -O2"
50 " -Wno-error=implicit-function-declaration")))
51 '())
52 #:phases
53 (modify-phases %standard-phases
54 (add-after 'unpack 'disable-test
55 (lambda _
56 ;; Test 5 raises SIGINT from a child and immediately returns
57 ;; code 71, and tests whether the child was killed by a signal.
58 ;; Since there is no signal handler for SIGINT in the build
59 ;; container, the parent sees the return code, and fails.
60 ;; XXX: For some reason adding signal handlers in Guile before
61 ;; running tests has no effect.
62 (substitute* "tests/test-execute.sh"
63 (("4 5 6")
64 "4 6"))))
65 ,@(if (target-hurd?)
66 '((add-after 'unpack 'skip-stack-overflow-tests
67 (lambda _
68 (substitute* '("tests/test-sigsegv-catch-stackoverflow1.c"
69 "tests/test-sigsegv-catch-stackoverflow2.c")
70 (("(^| )main *\\(.*" all)
71 (string-append all "{\n exit (77);//"))))))
72 '())
73 ,@(if (target-hurd64?)
74 '((add-after 'unpack 'patch-sigsegv
75 (lambda _
76 ;; Stack overflow recovery does not compile
77 (substitute* "lib/sigsegv.in.h"
78 (("__GNU__") "__XGNU__")))))
79 '())
80 (add-after 'unpack 'configure-shell
81 (lambda* (#:key native-inputs inputs #:allow-other-keys)
82 (let ((/bin/sh (search-input-file (or native-inputs inputs)
83 "/bin/sh")))
84 ;; Adjust hard-coded /bin/sh for tests.
85 (substitute* "lib/config.hin"
86 (("\"/bin/sh\"")
87 (format #f "\"~a\"" /bin/sh)))))))))
88 (synopsis "Macro processor")
89 (description
90 "GNU M4 is an implementation of the M4 macro language, which features
91some extensions over other implementations, some of which are required by GNU
92Autoconf. It is used as a macro processor, which means it processes text,
93expanding macros as it encounters them. It also has some built-in functions,
94for example to run shell commands or to do arithmetic.")
95 (license gpl3+)
96 (home-page "https://www.gnu.org/software/m4/")))