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