Correct name and Email for ng0.
[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>
fe18e257 6;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org>
6b0686fa 7;;; Copyright © 2016 David Thompson <davet@gnu.org>
4a78fd46 8;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
08d97842 9;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
96b4f5ad 10;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
80ffc708 11;;;
233e7676 12;;; This file is part of GNU Guix.
80ffc708 13;;;
233e7676 14;;; GNU Guix is free software; you can redistribute it and/or modify it
80ffc708
NK
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
233e7676 19;;; GNU Guix is distributed in the hope that it will be useful, but
80ffc708
NK
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
233e7676 25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
80ffc708 26
1ffa7090 27(define-module (gnu packages autotools)
4a44e743 28 #:use-module (guix licenses)
59a43334 29 #:use-module (gnu packages)
1ffa7090 30 #:use-module (gnu packages perl)
bfe88e0c 31 #:use-module (gnu packages python)
1ffa7090 32 #:use-module (gnu packages m4)
98341757 33 #:use-module (gnu packages man)
7cd1d7bd
LC
34 #:use-module (gnu packages bash)
35 #:use-module (guix utils)
80ffc708
NK
36 #:use-module (guix packages)
37 #:use-module (guix download)
7cd1d7bd 38 #:use-module (guix build-system gnu)
c6e96280
MR
39 #:use-module (guix build-system trivial)
40 #:use-module (ice-9 match)
41 #:export (autoconf-wrapper))
80ffc708
NK
42
43(define-public autoconf
44 (package
45 (name "autoconf")
46 (version "2.69")
47 (source
48 (origin
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/autoconf/autoconf-"
51 version ".tar.xz"))
52 (sha256
53 (base32
54 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
55 (build-system gnu-build-system)
a6abac9f 56 (native-inputs
80ffc708
NK
57 `(("perl" ,perl)
58 ("m4" ,m4)))
59 ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
60 ;; should use our own "cpp" instead of "/lib/cpp".
61 (arguments `(#:tests? #f))
62 (home-page
63 "http://www.gnu.org/software/autoconf/")
f50d2669 64 (synopsis "Create source code configuration scripts")
80ffc708 65 (description
a22dc0c4
LC
66 "Autoconf offers the developer a robust set of M4 macros which expand
67into shell code to test the features of Unix-like systems and to adapt
68automatically their software package to these systems. The resulting shell
69scripts are self-contained and portable, freeing the user from needing to
70know anything about Autoconf or M4.")
4a44e743 71 (license gpl3+))) ; some files are under GPLv2+
80ffc708 72
c6e96280
MR
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
2a7050ab
LC
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
fe18e257
MW
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 (zero? (system* bash "./configure"
124 (string-append "--prefix=" out)
125 (string-append "--build=" build)))))))))))
126
2a7050ab 127
464f5447
LC
128(define (make-autoconf-wrapper autoconf)
129 "Return a wrapper around AUTOCONF that generates `configure' scripts that
c6e96280
MR
130use our own Bash instead of /bin/sh in shebangs. For that reason, it should
131only be used internally---users should not end up distributing `configure'
132files with a system-specific shebang."
7cd1d7bd 133 (package (inherit autoconf)
7cd1d7bd
LC
134 (name (string-append (package-name autoconf) "-wrapper"))
135 (build-system trivial-build-system)
136 (inputs `(("guile"
168030ea
LC
137 ;; XXX: Kludge to hide the circular dependency.
138 ,(module-ref (resolve-interface '(gnu packages guile))
139 'guile-2.0))
7cd1d7bd
LC
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
177export GUILE_LOAD_PATH=\"~a\"
178export GUILE_LOAD_COMPILED_PATH=\"~a\"
179exec ~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)))))
f11617d8
LC
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))))
7cd1d7bd 194 port)))
464f5447
LC
195 (chmod (string-append bin "/autoconf") #o555)))))
196
197 ;; Do not show it in the UI since it's meant for internal use.
198 (properties '((hidden? . #t)))))
199
200(define-public autoconf-wrapper
201 (make-autoconf-wrapper autoconf))
7cd1d7bd 202
6b0686fa
DT
203(define-public autoconf-archive
204 (package
205 (name "autoconf-archive")
96b4f5ad 206 (version "2018.03.13")
6b0686fa
DT
207 (source
208 (origin
209 (method url-fetch)
210 (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
211 version ".tar.xz"))
212 (sha256
213 (base32
96b4f5ad 214 "0ng1lvpijf3kv7w7nb1shqs23vp0398yicyvkf9lsk56kw6zjxb1"))))
6b0686fa 215 (build-system gnu-build-system)
6fd52309 216 (home-page "https://www.gnu.org/software/autoconf-archive/")
6b0686fa
DT
217 (synopsis "Collection of freely reusable Autoconf macros")
218 (description
219 "Autoconf Archive is a collection of over 450 new macros for Autoconf,
220greatly expanding the domain of its functionality. These macros have been
221contributed as free software by the community.")
222 (license gpl3+)))
223
2b00a550
ML
224(define-public autobuild
225 (package
226 (name "autobuild")
227 (version "5.3")
228 (source (origin
229 (method url-fetch)
230 (uri (string-append "mirror://savannah/autobuild/autobuild-"
231 version ".tar.gz"))
232 (sha256
233 (base32
234 "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
235 (build-system gnu-build-system)
236 (inputs `(("perl" ,perl)))
237 (synopsis "Process generated build logs")
238 (description "Autobuild is a package that processes build logs generated
239when building software. Autobuild is primarily focused on packages using
240Autoconf and Automake, but can be used with other build systems too.
241Autobuild generates an HTML summary file, containing links to each build log.
242The summary includes project name, version, build hostname, host type (cross
243compile aware), date of build, and indication of success or failure. The
244output is indexed in many ways to simplify browsing.")
245 (home-page "http://josefsson.org/autobuild/")
246 (license gpl3+)))
247
80ffc708
NK
248(define-public automake
249 (package
250 (name "automake")
01c7193e 251 (version "1.15.1")
7cd1d7bd
LC
252 (source (origin
253 (method url-fetch)
254 (uri (string-append "mirror://gnu/automake/automake-"
255 version ".tar.xz"))
256 (sha256
257 (base32
01c7193e 258 "1bzd9g32dfm4rsbw93ld9x7b5nc1y6i4m6zp032qf1i28a8s6sxg"))
01eafd38 259 (patches
01c7193e 260 (search-patches "automake-skip-amhello-tests.patch"))))
80ffc708 261 (build-system gnu-build-system)
a6abac9f 262 (native-inputs
464f5447 263 `(("autoconf" ,autoconf-wrapper)
01eafd38 264 ("perl" ,perl)))
a9db7d10
LC
265 (native-search-paths
266 (list (search-path-specification
267 (variable "ACLOCAL_PATH")
af070955 268 (files '("share/aclocal")))))
7cd1d7bd 269 (arguments
01eafd38 270 '(#:modules ((guix build gnu-build-system)
63b7c6c1
LC
271 (guix build utils)
272 (srfi srfi-1)
273 (srfi srfi-26)
274 (rnrs io ports))
759807e8
EF
275 #:phases
276 (modify-phases %standard-phases
277 (add-before 'patch-source-shebangs 'patch-tests-shebangs
278 (lambda _
279 (let ((sh (which "sh")))
280 (substitute* (find-files "t" "\\.(sh|tap)$")
281 (("#![[:blank:]]?/bin/sh")
282 (string-append "#!" sh)))
7cd1d7bd 283
759807e8
EF
284 ;; Set these variables for all the `configure' runs
285 ;; that occur during the test suite.
286 (setenv "SHELL" sh)
287 (setenv "CONFIG_SHELL" sh)
288 #t)))
9be8d7c8 289
759807e8
EF
290 ;; Files like `install-sh', `mdate.sh', etc. must use
291 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
292 ;; in the wild. See <http://bugs.gnu.org/14201> for an
293 ;; example.
294 (add-after 'install 'unpatch-shebangs
295 (lambda* (#:key outputs #:allow-other-keys)
296 (let* ((out (assoc-ref outputs "out"))
297 (dir (string-append out "/share")))
298 (define (starts-with-shebang? file)
299 (equal? (call-with-input-file file
300 (lambda (p)
301 (list (get-u8 p) (get-u8 p))))
302 (map char->integer '(#\# #\!))))
63b7c6c1 303
759807e8
EF
304 (for-each (lambda (file)
305 (when (and (starts-with-shebang? file)
306 (executable-file? file))
307 (format #t "restoring shebang on `~a'~%"
308 file)
309 (substitute* file
310 (("^#!.*/bin/sh")
311 "#!/bin/sh")
312 (("^#!.*/bin/env(.*)$" _ args)
313 (string-append "#!/usr/bin/env"
314 args)))))
315 (find-files dir ".*"))))))))
6fd52309 316 (home-page "https://www.gnu.org/software/automake/")
f50d2669 317 (synopsis "Making GNU standards-compliant Makefiles")
80ffc708 318 (description
79c311b8
LC
319 "Automake the part of the GNU build system for producing
320standards-compliant Makefiles. Build requirements are entered in an
321intuitive format and then Automake works with Autoconf to produce a robust
322Makefile, simplifying the entire process for the developer.")
7cd1d7bd 323 (license gpl2+))) ; some files are under GPLv3+
36d4d49e 324
ecbea1bc
LC
325(define-public automake-1.16
326 ;; Make this the default on the next rebuild cycle.
327 (package
328 (inherit automake)
93f3b776 329 (version "1.16.1")
ecbea1bc
LC
330 (source (origin
331 (method url-fetch)
332 (uri (string-append "mirror://gnu/automake/automake-"
333 version ".tar.xz"))
334 (sha256
335 (base32
93f3b776 336 "08g979ficj18i1w6w5219bgmns7czr03iadf20mk3lrzl8wbn1ax"))
ecbea1bc
LC
337 (patches
338 (search-patches "automake-skip-amhello-tests.patch"))))))
339
36d4d49e
NK
340(define-public libtool
341 (package
342 (name "libtool")
192c6f96 343 (version "2.4.6")
36d4d49e 344 (source (origin
c154e1ea
LC
345 (method url-fetch)
346 (uri (string-append "mirror://gnu/libtool/libtool-"
347 version ".tar.xz"))
348 (sha256
349 (base32
192c6f96 350 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
fc1adab1 351 (patches (search-patches "libtool-skip-tests2.patch"))))
36d4d49e 352 (build-system gnu-build-system)
62c155c0 353 (propagated-inputs `(("m4" ,m4)))
36d4d49e 354 (native-inputs `(("m4" ,m4)
c154e1ea 355 ("perl" ,perl)
98341757 356 ("help2man" ,help2man) ;because we modify ltmain.sh
c154e1ea 357 ("automake" ,automake) ;some tests rely on 'aclocal'
464f5447 358 ("autoconf" ,autoconf-wrapper))) ;others on 'autom4te'
2f8a123e 359
36d4d49e 360 (arguments
3246cc91
LC
361 `(;; Libltdl is provided as a separate package, so don't install it here.
362 #:configure-flags '("--disable-ltdl-install")
363
364 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
365 ;; <http://hydra.gnu.org/build/181662>.
366 #:tests? ,(not (string-prefix? "mips64"
367 (or (%current-target-system)
368 (%current-system))))
c154e1ea 369
dc70626d 370 #:phases
371 (modify-phases %standard-phases
372 (add-before 'check 'pre-check
373 (lambda* (#:key inputs #:allow-other-keys)
374 ;; Run the test suite in parallel, if possible.
375 (setenv "TESTSUITEFLAGS"
376 (string-append
377 "-j"
378 (number->string (parallel-job-count))))
c5862bda 379 ;; Patch references to /bin/sh.
dc70626d 380 (let ((bash (assoc-ref inputs "bash")))
381 (substitute* "tests/testsuite"
382 (("/bin/sh")
78c172a5
LF
383 (string-append bash "/bin/sh")))
384 #t)))
98341757 385 (add-after 'patch-source-shebangs 'restore-ltmain-shebang
386 (lambda* (#:key inputs #:allow-other-keys)
387 (substitute* "build-aux/ltmain.in"
92e77959 388 (("^#!.*/bin/sh$") "#!/bin/sh"))
78c172a5 389 #t)))))
42ff70e2 390
f50d2669 391 (synopsis "Generic shared library support tools")
36d4d49e 392 (description
79c311b8
LC
393 "GNU Libtool helps in the creation and use of shared libraries, by
394presenting a single consistent, portable interface that hides the usual
395complexity of working with shared libraries across platforms.")
4a44e743 396 (license gpl3+)
6fd52309 397 (home-page "https://www.gnu.org/software/libtool/")))
e13f715b 398
3cbb3f9c
LC
399(define-public libltdl
400 ;; This is a libltdl package separate from the libtool package. This is
401 ;; useful because, unlike libtool, it has zero extra dependencies (making it
402 ;; readily usable during bootstrap), and it builds very quickly since
403 ;; Libtool's extensive test suite isn't run.
404 (package
405 (name "libltdl")
192c6f96 406 (version "2.4.6")
a101c891
LC
407 (source (origin
408 (method url-fetch)
409 (uri (string-append "mirror://gnu/libtool/libtool-"
410 version ".tar.xz"))
411 (sha256
412 (base32
ef593a10 413 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
3cbb3f9c
LC
414 (build-system gnu-build-system)
415 (arguments
416 '(#:configure-flags '("--enable-ltdl-install") ;really install it
8c88e0ba
EF
417 #:phases (modify-phases %standard-phases
418 (add-before 'configure 'change-directory
419 (lambda _ (chdir "libltdl") #t)))))
3cbb3f9c
LC
420
421 (synopsis "System-independent dlopen wrapper of GNU libtool")
422 (description (package-description libtool))
423 (home-page (package-home-page libtool))
424 (license lgpl2.1+)))
bfe88e0c
ML
425
426(define-public pyconfigure
427 (package
428 (name "pyconfigure")
429 (version "0.2.3")
430 (source (origin
431 (method url-fetch)
432 (uri (string-append "mirror://gnu/pyconfigure/pyconfigure-"
433 version ".tar.gz"))
434 (sha256
435 (base32
436 "0kxi9bg7l6ric39vbz9ykz4a21xlihhh2zcc3297db8amvhqwhrp"))))
437 (build-system gnu-build-system)
438 (arguments
439 `(#:phases
440 (modify-phases %standard-phases
441 (add-before 'configure 'patch-python
442 (lambda _
443 (substitute* "pyconf.in"
444 (("/usr/bin/env python") (which "python3")))
445 #t)))))
446 (inputs
447 `(("python" ,python-3)))
448 (synopsis "@command{configure} interface for Python-based packages")
449 (description
450 "GNU pyconfigure provides template files for easily implementing
451standards-compliant configure scripts and Makefiles for Python-based packages.
452It is designed to work alongside existing Python setup scripts, making it easy
453to integrate into existing projects. Powerful and flexible Autoconf macros
454are available, allowing you to easily make adjustments to the installation
455procedure based on the capabilities of the target computer.")
456 (home-page "https://www.gnu.org/software/pyconfigure/manual/")
457 (license
458 (fsf-free
459 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html"))))