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