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