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