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