gnu: ruby-listen: Update to 3.1.5.
[jackhill/guix/guix.git] / gnu / packages / autotools.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
5 ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
6 ;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
8 ;;; Copyright © 2017 ng0 <ng0@libertad.pw>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages autotools)
26 #:use-module (guix licenses)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages m4)
30 #:use-module (gnu packages man)
31 #:use-module (gnu packages bash)
32 #:use-module (guix utils)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system trivial)
37 #:use-module (ice-9 match)
38 #:export (autoconf-wrapper))
39
40 (define-public autoconf
41 (package
42 (name "autoconf")
43 (version "2.69")
44 (source
45 (origin
46 (method url-fetch)
47 (uri (string-append "mirror://gnu/autoconf/autoconf-"
48 version ".tar.xz"))
49 (sha256
50 (base32
51 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
52 (build-system gnu-build-system)
53 (native-inputs
54 `(("perl" ,perl)
55 ("m4" ,m4)))
56 ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
57 ;; should use our own "cpp" instead of "/lib/cpp".
58 (arguments `(#:tests? #f))
59 (home-page
60 "http://www.gnu.org/software/autoconf/")
61 (synopsis "Create source code configuration scripts")
62 (description
63 "Autoconf offers the developer a robust set of M4 macros which expand
64 into shell code to test the features of Unix-like systems and to adapt
65 automatically their software package to these systems. The resulting shell
66 scripts are self-contained and portable, freeing the user from needing to
67 know anything about Autoconf or M4.")
68 (license gpl3+))) ; some files are under GPLv2+
69
70 (define-public autoconf-2.68
71 (package (inherit autoconf)
72 (version "2.68")
73 (source
74 (origin
75 (method url-fetch)
76 (uri (string-append "mirror://gnu/autoconf/autoconf-"
77 version ".tar.xz"))
78 (sha256
79 (base32
80 "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
81
82 (define-public autoconf-2.64
83 ;; As of GDB 7.8, GDB is still developed using this version of Autoconf.
84 (package (inherit autoconf)
85 (version "2.64")
86 (source
87 (origin
88 (method url-fetch)
89 (uri (string-append "mirror://gnu/autoconf/autoconf-"
90 version ".tar.xz"))
91 (sha256
92 (base32
93 "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
94
95 (define-public autoconf-2.13
96 ;; GNU IceCat 52.x requires autoconf-2.13 to build!
97 (package (inherit autoconf)
98 (version "2.13")
99 (source
100 (origin
101 (method url-fetch)
102 (uri (string-append "mirror://gnu/autoconf/autoconf-"
103 version ".tar.gz"))
104 (sha256
105 (base32
106 "07krzl4czczdsgzrrw9fiqx35xcf32naf751khg821g5pqv12qgh"))))
107 (arguments
108 `(#:tests? #f
109 #:phases
110 ;; The 'configure' script in autoconf-2.13 can't cope with "SHELL=" and
111 ;; "CONFIG_SHELL=" arguments, so we set them as environment variables
112 ;; and pass a simplified set of arguments.
113 (modify-phases %standard-phases
114 (replace 'configure
115 (lambda* (#:key build inputs outputs #:allow-other-keys)
116 (let ((bash (which "bash"))
117 (out (assoc-ref outputs "out")))
118 (setenv "CONFIG_SHELL" bash)
119 (setenv "SHELL" bash)
120 (zero? (system* bash "./configure"
121 (string-append "--prefix=" out)
122 (string-append "--build=" build)))))))))))
123
124
125 (define* (autoconf-wrapper #:optional (autoconf autoconf))
126 "Return an wrapper around AUTOCONF that generates `configure' scripts that
127 use our own Bash instead of /bin/sh in shebangs. For that reason, it should
128 only be used internally---users should not end up distributing `configure'
129 files with a system-specific shebang."
130 (package (inherit autoconf)
131 (name (string-append (package-name autoconf) "-wrapper"))
132 (build-system trivial-build-system)
133 (inputs `(("guile"
134 ;; XXX: Kludge to hide the circular dependency.
135 ,(module-ref (resolve-interface '(gnu packages guile))
136 'guile-2.0))
137 ("autoconf" ,autoconf)
138 ("bash" ,bash)))
139 (arguments
140 '(#:modules ((guix build utils))
141 #:builder
142 (begin
143 (use-modules (guix build utils))
144 (let* ((out (assoc-ref %outputs "out"))
145 (bin (string-append out "/bin"))
146 (autoconf (string-append
147 (assoc-ref %build-inputs "autoconf")
148 "/bin/autoconf"))
149 (guile (string-append
150 (assoc-ref %build-inputs "guile")
151 "/bin/guile"))
152 (sh (string-append
153 (assoc-ref %build-inputs "bash")
154 "/bin/sh"))
155 (modules ((compose dirname dirname dirname)
156 (search-path %load-path
157 "guix/build/utils.scm"))))
158 (mkdir-p bin)
159
160 ;; Symlink all the binaries but `autoconf'.
161 (with-directory-excursion bin
162 (for-each (lambda (file)
163 (unless (string=? (basename file) "autoconf")
164 (symlink file (basename file))))
165 (find-files (dirname autoconf) ".*")))
166
167 ;; Add an `autoconf' binary that wraps the real one.
168 (call-with-output-file (string-append bin "/autoconf")
169 (lambda (port)
170 ;; Shamefully, Guile can be used in shebangs only if a
171 ;; single argument is passed (-ds); otherwise it gets
172 ;; them all as a single argument and fails to parse them.
173 (format port "#!~a
174 export GUILE_LOAD_PATH=\"~a\"
175 export GUILE_LOAD_COMPILED_PATH=\"~a\"
176 exec ~a --no-auto-compile \"$0\" \"$@\"
177 !#~%"
178 sh modules modules guile)
179 (write
180 `(begin
181 (use-modules (guix build utils))
182 (let ((result (apply system* ,autoconf
183 (cdr (command-line)))))
184 (when (and (file-exists? "configure")
185 (not (file-exists? "/bin/sh")))
186 ;; Patch regardless of RESULT, because `autoconf
187 ;; -Werror' can both create a `configure' file and
188 ;; return a non-zero exit code.
189 (patch-shebang "configure"))
190 (exit (status:exit-val result))))
191 port)))
192 (chmod (string-append bin "/autoconf") #o555)))))))
193
194 (define-public autoconf-archive
195 (package
196 (name "autoconf-archive")
197 (version "2017.03.21")
198 (source
199 (origin
200 (method url-fetch)
201 (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
202 version ".tar.xz"))
203 (sha256
204 (base32
205 "0rfpapadka2023qhy8294ca5awxpb8d4904js6kv7piby5ax8siq"))))
206 (build-system gnu-build-system)
207 (home-page "https://www.gnu.org/software/autoconf-archive/")
208 (synopsis "Collection of freely reusable Autoconf macros")
209 (description
210 "Autoconf Archive is a collection of over 450 new macros for Autoconf,
211 greatly expanding the domain of its functionality. These macros have been
212 contributed as free software by the community.")
213 (license gpl3+)))
214
215 (define-public autobuild
216 (package
217 (name "autobuild")
218 (version "5.3")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "mirror://savannah/autobuild/autobuild-"
222 version ".tar.gz"))
223 (sha256
224 (base32
225 "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
226 (build-system gnu-build-system)
227 (inputs `(("perl" ,perl)))
228 (synopsis "Process generated build logs")
229 (description "Autobuild is a package that processes build logs generated
230 when building software. Autobuild is primarily focused on packages using
231 Autoconf and Automake, but can be used with other build systems too.
232 Autobuild generates an HTML summary file, containing links to each build log.
233 The summary includes project name, version, build hostname, host type (cross
234 compile aware), date of build, and indication of success or failure. The
235 output is indexed in many ways to simplify browsing.")
236 (home-page "http://josefsson.org/autobuild/")
237 (license gpl3+)))
238
239 (define-public automake
240 ;; Replace with 'automake/latest' on the next rebuild cycle.
241 (package
242 (name "automake")
243 (version "1.15")
244 (source (origin
245 (method url-fetch)
246 (uri (string-append "mirror://gnu/automake/automake-"
247 version ".tar.xz"))
248 (sha256
249 (base32
250 "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
251 (patches
252 (search-patches "automake-regexp-syntax.patch"
253 "automake-skip-amhello-tests.patch"
254 "automake-test-gzip-warning.patch"))))
255 (build-system gnu-build-system)
256 (native-inputs
257 `(("autoconf" ,(autoconf-wrapper))
258 ("perl" ,perl)))
259 (native-search-paths
260 (list (search-path-specification
261 (variable "ACLOCAL_PATH")
262 (files '("share/aclocal")))))
263 (arguments
264 '(#:modules ((guix build gnu-build-system)
265 (guix build utils)
266 (srfi srfi-1)
267 (srfi srfi-26)
268 (rnrs io ports))
269 #:phases (alist-cons-before
270 'patch-source-shebangs 'patch-tests-shebangs
271 (lambda _
272 (let ((sh (which "sh")))
273 (substitute* (find-files "t" "\\.(sh|tap)$")
274 (("#![[:blank:]]?/bin/sh")
275 (string-append "#!" sh)))
276
277 ;; Set these variables for all the `configure' runs
278 ;; that occur during the test suite.
279 (setenv "SHELL" sh)
280 (setenv "CONFIG_SHELL" sh)))
281
282 ;; Files like `install-sh', `mdate.sh', etc. must use
283 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
284 ;; in the wild. See <http://bugs.gnu.org/14201> for an
285 ;; example.
286 (alist-cons-after
287 'install 'unpatch-shebangs
288 (lambda* (#:key outputs #:allow-other-keys)
289 (let* ((out (assoc-ref outputs "out"))
290 (dir (string-append out "/share")))
291 (define (starts-with-shebang? file)
292 (equal? (call-with-input-file file
293 (lambda (p)
294 (list (get-u8 p) (get-u8 p))))
295 (map char->integer '(#\# #\!))))
296
297 (for-each (lambda (file)
298 (when (and (starts-with-shebang? file)
299 (executable-file? file))
300 (format #t "restoring shebang on `~a'~%"
301 file)
302 (substitute* file
303 (("^#!.*/bin/sh")
304 "#!/bin/sh")
305 (("^#!.*/bin/env(.*)$" _ args)
306 (string-append "#!/usr/bin/env"
307 args)))))
308 (find-files dir ".*"))))
309 %standard-phases))))
310 (home-page "https://www.gnu.org/software/automake/")
311 (synopsis "Making GNU standards-compliant Makefiles")
312 (description
313 "Automake the part of the GNU build system for producing
314 standards-compliant Makefiles. Build requirements are entered in an
315 intuitive format and then Automake works with Autoconf to produce a robust
316 Makefile, simplifying the entire process for the developer.")
317 (license gpl2+))) ; some files are under GPLv3+
318
319
320 (define-public automake/latest
321 ;; Merge with 'automake' on the next rebuild cycle.
322 (package
323 (inherit automake)
324 (version "1.15.1")
325 (source (origin
326 (method url-fetch)
327 (uri (string-append "mirror://gnu/automake/automake-"
328 version ".tar.xz"))
329 (sha256
330 (base32
331 "1bzd9g32dfm4rsbw93ld9x7b5nc1y6i4m6zp032qf1i28a8s6sxg"))
332 (patches
333 (search-patches "automake-skip-amhello-tests.patch"))))))
334
335 (define-public libtool
336 (package
337 (name "libtool")
338 (version "2.4.6")
339 (source (origin
340 (method url-fetch)
341 (uri (string-append "mirror://gnu/libtool/libtool-"
342 version ".tar.xz"))
343 (sha256
344 (base32
345 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
346 (patches (search-patches "libtool-skip-tests2.patch"))))
347 (build-system gnu-build-system)
348 (propagated-inputs `(("m4" ,m4)))
349 (native-inputs `(("m4" ,m4)
350 ("perl" ,perl)
351 ("help2man" ,help2man) ;because we modify ltmain.sh
352 ("automake" ,automake) ;some tests rely on 'aclocal'
353 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
354
355 (arguments
356 `(;; Libltdl is provided as a separate package, so don't install it here.
357 #:configure-flags '("--disable-ltdl-install")
358
359 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
360 ;; <http://hydra.gnu.org/build/181662>.
361 #:tests? ,(not (string-prefix? "mips64"
362 (or (%current-target-system)
363 (%current-system))))
364
365 #:phases
366 (modify-phases %standard-phases
367 (add-before 'check 'pre-check
368 (lambda* (#:key inputs #:allow-other-keys)
369 ;; Run the test suite in parallel, if possible.
370 (setenv "TESTSUITEFLAGS"
371 (string-append
372 "-j"
373 (number->string (parallel-job-count))))
374 ;; Patch references to /bin/sh.
375 (let ((bash (assoc-ref inputs "bash")))
376 (substitute* "tests/testsuite"
377 (("/bin/sh")
378 (string-append bash "/bin/sh")))
379 #t)))
380 (add-after 'patch-source-shebangs 'restore-ltmain-shebang
381 (lambda* (#:key inputs #:allow-other-keys)
382 (substitute* "build-aux/ltmain.in"
383 (("^#!.*/bin/sh$") "#!/bin/sh"))
384 #t)))))
385
386 (synopsis "Generic shared library support tools")
387 (description
388 "GNU Libtool helps in the creation and use of shared libraries, by
389 presenting a single consistent, portable interface that hides the usual
390 complexity of working with shared libraries across platforms.")
391 (license gpl3+)
392 (home-page "https://www.gnu.org/software/libtool/")))
393
394 (define-public libltdl
395 ;; This is a libltdl package separate from the libtool package. This is
396 ;; useful because, unlike libtool, it has zero extra dependencies (making it
397 ;; readily usable during bootstrap), and it builds very quickly since
398 ;; Libtool's extensive test suite isn't run.
399 (package
400 (name "libltdl")
401 (version "2.4.6")
402 (source (origin
403 (method url-fetch)
404 (uri (string-append "mirror://gnu/libtool/libtool-"
405 version ".tar.xz"))
406 (sha256
407 (base32
408 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
409 (build-system gnu-build-system)
410 (arguments
411 '(#:configure-flags '("--enable-ltdl-install") ;really install it
412 #:phases (alist-cons-before
413 'configure 'change-directory
414 (lambda _
415 (chdir "libltdl"))
416 %standard-phases)))
417
418 (synopsis "System-independent dlopen wrapper of GNU libtool")
419 (description (package-description libtool))
420 (home-page (package-home-page libtool))
421 (license lgpl2.1+)))