gnu: Add FIL plugins.
[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>
89b48232 3;;; Copyright © 2012, 2013, 2014, 2015, 2016 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>
192c6f96 6;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
80ffc708 7;;;
233e7676 8;;; This file is part of GNU Guix.
80ffc708 9;;;
233e7676 10;;; GNU Guix is free software; you can redistribute it and/or modify it
80ffc708
NK
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
233e7676 15;;; GNU Guix is distributed in the hope that it will be useful, but
80ffc708
NK
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
233e7676 21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
80ffc708 22
1ffa7090 23(define-module (gnu packages autotools)
4a44e743 24 #:use-module (guix licenses)
59a43334 25 #:use-module (gnu packages)
1ffa7090
LC
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages m4)
7cd1d7bd
LC
28 #:use-module (gnu packages bash)
29 #:use-module (guix utils)
80ffc708
NK
30 #:use-module (guix packages)
31 #:use-module (guix download)
7cd1d7bd 32 #:use-module (guix build-system gnu)
c6e96280
MR
33 #:use-module (guix build-system trivial)
34 #:use-module (ice-9 match)
35 #:export (autoconf-wrapper))
80ffc708
NK
36
37(define-public autoconf
38 (package
39 (name "autoconf")
40 (version "2.69")
41 (source
42 (origin
43 (method url-fetch)
44 (uri (string-append "mirror://gnu/autoconf/autoconf-"
45 version ".tar.xz"))
46 (sha256
47 (base32
48 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
49 (build-system gnu-build-system)
a6abac9f 50 (native-inputs
80ffc708
NK
51 `(("perl" ,perl)
52 ("m4" ,m4)))
53 ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
54 ;; should use our own "cpp" instead of "/lib/cpp".
55 (arguments `(#:tests? #f))
56 (home-page
57 "http://www.gnu.org/software/autoconf/")
f50d2669 58 (synopsis "Create source code configuration scripts")
80ffc708 59 (description
a22dc0c4
LC
60 "Autoconf offers the developer a robust set of M4 macros which expand
61into shell code to test the features of Unix-like systems and to adapt
62automatically their software package to these systems. The resulting shell
63scripts are self-contained and portable, freeing the user from needing to
64know anything about Autoconf or M4.")
4a44e743 65 (license gpl3+))) ; some files are under GPLv2+
80ffc708 66
c6e96280
MR
67(define-public autoconf-2.68
68 (package (inherit autoconf)
69 (version "2.68")
70 (source
71 (origin
72 (method url-fetch)
73 (uri (string-append "mirror://gnu/autoconf/autoconf-"
74 version ".tar.xz"))
75 (sha256
76 (base32
77 "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
78
2a7050ab
LC
79(define-public autoconf-2.64
80 ;; As of GDB 7.8, GDB is still developed using this version of Autoconf.
81 (package (inherit autoconf)
82 (version "2.64")
83 (source
84 (origin
85 (method url-fetch)
86 (uri (string-append "mirror://gnu/autoconf/autoconf-"
87 version ".tar.xz"))
88 (sha256
89 (base32
90 "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
91
92
c6e96280
MR
93(define* (autoconf-wrapper #:optional (autoconf autoconf))
94 "Return an wrapper around AUTOCONF that generates `configure' scripts that
95use our own Bash instead of /bin/sh in shebangs. For that reason, it should
96only be used internally---users should not end up distributing `configure'
97files with a system-specific shebang."
7cd1d7bd 98 (package (inherit autoconf)
7cd1d7bd
LC
99 (name (string-append (package-name autoconf) "-wrapper"))
100 (build-system trivial-build-system)
101 (inputs `(("guile"
168030ea
LC
102 ;; XXX: Kludge to hide the circular dependency.
103 ,(module-ref (resolve-interface '(gnu packages guile))
104 'guile-2.0))
7cd1d7bd
LC
105 ("autoconf" ,autoconf)
106 ("bash" ,bash)))
107 (arguments
108 '(#:modules ((guix build utils))
109 #:builder
110 (begin
111 (use-modules (guix build utils))
112 (let* ((out (assoc-ref %outputs "out"))
113 (bin (string-append out "/bin"))
114 (autoconf (string-append
115 (assoc-ref %build-inputs "autoconf")
116 "/bin/autoconf"))
117 (guile (string-append
118 (assoc-ref %build-inputs "guile")
119 "/bin/guile"))
120 (sh (string-append
121 (assoc-ref %build-inputs "bash")
122 "/bin/sh"))
123 (modules ((compose dirname dirname dirname)
124 (search-path %load-path
125 "guix/build/utils.scm"))))
126 (mkdir-p bin)
127
128 ;; Symlink all the binaries but `autoconf'.
129 (with-directory-excursion bin
130 (for-each (lambda (file)
131 (unless (string=? (basename file) "autoconf")
132 (symlink file (basename file))))
133 (find-files (dirname autoconf) ".*")))
134
135 ;; Add an `autoconf' binary that wraps the real one.
136 (call-with-output-file (string-append bin "/autoconf")
137 (lambda (port)
138 ;; Shamefully, Guile can be used in shebangs only if a
139 ;; single argument is passed (-ds); otherwise it gets
140 ;; them all as a single argument and fails to parse them.
141 (format port "#!~a
142export GUILE_LOAD_PATH=\"~a\"
143export GUILE_LOAD_COMPILED_PATH=\"~a\"
144exec ~a --no-auto-compile \"$0\" \"$@\"
145!#~%"
146 sh modules modules guile)
147 (write
148 `(begin
149 (use-modules (guix build utils))
150 (let ((result (apply system* ,autoconf
151 (cdr (command-line)))))
f11617d8
LC
152 (when (and (file-exists? "configure")
153 (not (file-exists? "/bin/sh")))
154 ;; Patch regardless of RESULT, because `autoconf
155 ;; -Werror' can both create a `configure' file and
156 ;; return a non-zero exit code.
157 (patch-shebang "configure"))
158 (exit (status:exit-val result))))
7cd1d7bd
LC
159 port)))
160 (chmod (string-append bin "/autoconf") #o555)))))))
161
2b00a550
ML
162(define-public autobuild
163 (package
164 (name "autobuild")
165 (version "5.3")
166 (source (origin
167 (method url-fetch)
168 (uri (string-append "mirror://savannah/autobuild/autobuild-"
169 version ".tar.gz"))
170 (sha256
171 (base32
172 "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
173 (build-system gnu-build-system)
174 (inputs `(("perl" ,perl)))
175 (synopsis "Process generated build logs")
176 (description "Autobuild is a package that processes build logs generated
177when building software. Autobuild is primarily focused on packages using
178Autoconf and Automake, but can be used with other build systems too.
179Autobuild generates an HTML summary file, containing links to each build log.
180The summary includes project name, version, build hostname, host type (cross
181compile aware), date of build, and indication of success or failure. The
182output is indexed in many ways to simplify browsing.")
183 (home-page "http://josefsson.org/autobuild/")
184 (license gpl3+)))
185
80ffc708
NK
186(define-public automake
187 (package
188 (name "automake")
aebb05b0 189 (version "1.15")
7cd1d7bd
LC
190 (source (origin
191 (method url-fetch)
192 (uri (string-append "mirror://gnu/automake/automake-"
193 version ".tar.xz"))
194 (sha256
195 (base32
aebb05b0 196 "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
01eafd38 197 (patches
89b48232
LC
198 (map search-patch
199 '("automake-regexp-syntax.patch"
200 "automake-skip-amhello-tests.patch")))))
80ffc708 201 (build-system gnu-build-system)
a6abac9f 202 (native-inputs
c6e96280 203 `(("autoconf" ,(autoconf-wrapper))
01eafd38 204 ("perl" ,perl)))
a9db7d10
LC
205 (native-search-paths
206 (list (search-path-specification
207 (variable "ACLOCAL_PATH")
af070955 208 (files '("share/aclocal")))))
7cd1d7bd 209 (arguments
01eafd38 210 '(#:modules ((guix build gnu-build-system)
63b7c6c1
LC
211 (guix build utils)
212 (srfi srfi-1)
213 (srfi srfi-26)
214 (rnrs io ports))
7cd1d7bd
LC
215 #:phases (alist-cons-before
216 'patch-source-shebangs 'patch-tests-shebangs
217 (lambda _
218 (let ((sh (which "sh")))
219 (substitute* (find-files "t" "\\.(sh|tap)$")
220 (("#![[:blank:]]?/bin/sh")
221 (string-append "#!" sh)))
222
223 ;; Set these variables for all the `configure' runs
224 ;; that occur during the test suite.
225 (setenv "SHELL" sh)
226 (setenv "CONFIG_SHELL" sh)))
9be8d7c8 227
63b7c6c1
LC
228 ;; Files like `install-sh', `mdate.sh', etc. must use
229 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
230 ;; in the wild. See <http://bugs.gnu.org/14201> for an
231 ;; example.
232 (alist-cons-after
233 'install 'unpatch-shebangs
234 (lambda* (#:key outputs #:allow-other-keys)
235 (let* ((out (assoc-ref outputs "out"))
236 (dir (string-append out "/share")))
237 (define (starts-with-shebang? file)
238 (equal? (call-with-input-file file
239 (lambda (p)
240 (list (get-u8 p) (get-u8 p))))
241 (map char->integer '(#\# #\!))))
242
243 (for-each (lambda (file)
244 (when (and (starts-with-shebang? file)
245 (executable-file? file))
246 (format #t "restoring shebang on `~a'~%"
247 file)
248 (substitute* file
249 (("^#!.*/bin/sh")
250 "#!/bin/sh")
251 (("^#!.*/bin/env(.*)$" _ args)
252 (string-append "#!/usr/bin/env"
253 args)))))
254 (find-files dir ".*"))))
255 %standard-phases))))
7cd1d7bd 256 (home-page "http://www.gnu.org/software/automake/")
f50d2669 257 (synopsis "Making GNU standards-compliant Makefiles")
80ffc708 258 (description
79c311b8
LC
259 "Automake the part of the GNU build system for producing
260standards-compliant Makefiles. Build requirements are entered in an
261intuitive format and then Automake works with Autoconf to produce a robust
262Makefile, simplifying the entire process for the developer.")
7cd1d7bd 263 (license gpl2+))) ; some files are under GPLv3+
36d4d49e
NK
264
265(define-public libtool
266 (package
267 (name "libtool")
192c6f96 268 (version "2.4.6")
36d4d49e 269 (source (origin
c154e1ea
LC
270 (method url-fetch)
271 (uri (string-append "mirror://gnu/libtool/libtool-"
272 version ".tar.xz"))
273 (sha256
274 (base32
192c6f96 275 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
c154e1ea 276 (patches
3314f8a7 277 (list (search-patch "libtool-skip-tests2.patch")))))
36d4d49e 278 (build-system gnu-build-system)
62c155c0 279 (propagated-inputs `(("m4" ,m4)))
36d4d49e 280 (native-inputs `(("m4" ,m4)
c154e1ea
LC
281 ("perl" ,perl)
282 ("automake" ,automake) ;some tests rely on 'aclocal'
283 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
2f8a123e 284
36d4d49e 285 (arguments
3246cc91
LC
286 `(;; Libltdl is provided as a separate package, so don't install it here.
287 #:configure-flags '("--disable-ltdl-install")
288
289 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
290 ;; <http://hydra.gnu.org/build/181662>.
291 #:tests? ,(not (string-prefix? "mips64"
292 (or (%current-target-system)
293 (%current-system))))
c154e1ea 294
3246cc91
LC
295 #:phases (alist-cons-before
296 'check 'pre-check
297 (lambda* (#:key inputs #:allow-other-keys)
298 ;; Run the test suite in parallel, if possible.
299 (setenv "TESTSUITEFLAGS"
300 (string-append
301 "-j"
302 (number->string (parallel-job-count))))
42ff70e2 303
3246cc91
LC
304 ;; Path references to /bin/sh.
305 (let ((bash (assoc-ref inputs "bash")))
306 (substitute* "tests/testsuite"
307 (("/bin/sh")
308 (string-append bash "/bin/bash")))))
309 %standard-phases)))
f50d2669 310 (synopsis "Generic shared library support tools")
36d4d49e 311 (description
79c311b8
LC
312 "GNU Libtool helps in the creation and use of shared libraries, by
313presenting a single consistent, portable interface that hides the usual
314complexity of working with shared libraries across platforms.")
4a44e743 315 (license gpl3+)
36d4d49e 316 (home-page "http://www.gnu.org/software/libtool/")))
e13f715b 317
3cbb3f9c
LC
318(define-public libltdl
319 ;; This is a libltdl package separate from the libtool package. This is
320 ;; useful because, unlike libtool, it has zero extra dependencies (making it
321 ;; readily usable during bootstrap), and it builds very quickly since
322 ;; Libtool's extensive test suite isn't run.
323 (package
324 (name "libltdl")
192c6f96 325 (version "2.4.6")
a101c891
LC
326 (source (origin
327 (method url-fetch)
328 (uri (string-append "mirror://gnu/libtool/libtool-"
329 version ".tar.xz"))
330 (sha256
331 (base32
ef593a10 332 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
3cbb3f9c
LC
333 (build-system gnu-build-system)
334 (arguments
335 '(#:configure-flags '("--enable-ltdl-install") ;really install it
336 #:phases (alist-cons-before
337 'configure 'change-directory
338 (lambda _
339 (chdir "libltdl"))
340 %standard-phases)))
341
342 (synopsis "System-independent dlopen wrapper of GNU libtool")
343 (description (package-description libtool))
344 (home-page (package-home-page libtool))
345 (license lgpl2.1+)))