gnu: libical: Correct zoneinfo search path.
[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 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 Mark H Weaver <mhw@netris.org>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages autotools)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages m4)
28 #:use-module (gnu packages bash)
29 #:use-module (guix utils)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system trivial)
34 #:use-module (ice-9 match)
35 #:export (autoconf-wrapper))
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)
50 (native-inputs
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/")
58 (synopsis "Create source code configuration scripts")
59 (description
60 "Autoconf offers the developer a robust set of M4 macros which expand
61 into shell code to test the features of Unix-like systems and to adapt
62 automatically their software package to these systems. The resulting shell
63 scripts are self-contained and portable, freeing the user from needing to
64 know anything about Autoconf or M4.")
65 (license gpl3+))) ; some files are under GPLv2+
66
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
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
93 (define* (autoconf-wrapper #:optional (autoconf autoconf))
94 "Return an wrapper around AUTOCONF that generates `configure' scripts that
95 use our own Bash instead of /bin/sh in shebangs. For that reason, it should
96 only be used internally---users should not end up distributing `configure'
97 files with a system-specific shebang."
98 (package (inherit autoconf)
99 (name (string-append (package-name autoconf) "-wrapper"))
100 (build-system trivial-build-system)
101 (inputs `(("guile"
102 ;; XXX: Kludge to hide the circular dependency.
103 ,(module-ref (resolve-interface '(gnu packages guile))
104 'guile-2.0))
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
142 export GUILE_LOAD_PATH=\"~a\"
143 export GUILE_LOAD_COMPILED_PATH=\"~a\"
144 exec ~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)))))
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))))
159 port)))
160 (chmod (string-append bin "/autoconf") #o555)))))))
161
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
177 when building software. Autobuild is primarily focused on packages using
178 Autoconf and Automake, but can be used with other build systems too.
179 Autobuild generates an HTML summary file, containing links to each build log.
180 The summary includes project name, version, build hostname, host type (cross
181 compile aware), date of build, and indication of success or failure. The
182 output is indexed in many ways to simplify browsing.")
183 (home-page "http://josefsson.org/autobuild/")
184 (license gpl3+)))
185
186 (define-public automake
187 (package
188 (name "automake")
189 (version "1.15")
190 (source (origin
191 (method url-fetch)
192 (uri (string-append "mirror://gnu/automake/automake-"
193 version ".tar.xz"))
194 (sha256
195 (base32
196 "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
197 (patches
198 (search-patches "automake-regexp-syntax.patch"
199 "automake-skip-amhello-tests.patch"))))
200 (build-system gnu-build-system)
201 (native-inputs
202 `(("autoconf" ,(autoconf-wrapper))
203 ("perl" ,perl)))
204 (native-search-paths
205 (list (search-path-specification
206 (variable "ACLOCAL_PATH")
207 (files '("share/aclocal")))))
208 (arguments
209 '(#:modules ((guix build gnu-build-system)
210 (guix build utils)
211 (srfi srfi-1)
212 (srfi srfi-26)
213 (rnrs io ports))
214 #:phases (alist-cons-before
215 'patch-source-shebangs 'patch-tests-shebangs
216 (lambda _
217 (let ((sh (which "sh")))
218 (substitute* (find-files "t" "\\.(sh|tap)$")
219 (("#![[:blank:]]?/bin/sh")
220 (string-append "#!" sh)))
221
222 ;; Set these variables for all the `configure' runs
223 ;; that occur during the test suite.
224 (setenv "SHELL" sh)
225 (setenv "CONFIG_SHELL" sh)))
226
227 ;; Files like `install-sh', `mdate.sh', etc. must use
228 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
229 ;; in the wild. See <http://bugs.gnu.org/14201> for an
230 ;; example.
231 (alist-cons-after
232 'install 'unpatch-shebangs
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let* ((out (assoc-ref outputs "out"))
235 (dir (string-append out "/share")))
236 (define (starts-with-shebang? file)
237 (equal? (call-with-input-file file
238 (lambda (p)
239 (list (get-u8 p) (get-u8 p))))
240 (map char->integer '(#\# #\!))))
241
242 (for-each (lambda (file)
243 (when (and (starts-with-shebang? file)
244 (executable-file? file))
245 (format #t "restoring shebang on `~a'~%"
246 file)
247 (substitute* file
248 (("^#!.*/bin/sh")
249 "#!/bin/sh")
250 (("^#!.*/bin/env(.*)$" _ args)
251 (string-append "#!/usr/bin/env"
252 args)))))
253 (find-files dir ".*"))))
254 %standard-phases))))
255 (home-page "http://www.gnu.org/software/automake/")
256 (synopsis "Making GNU standards-compliant Makefiles")
257 (description
258 "Automake the part of the GNU build system for producing
259 standards-compliant Makefiles. Build requirements are entered in an
260 intuitive format and then Automake works with Autoconf to produce a robust
261 Makefile, simplifying the entire process for the developer.")
262 (license gpl2+))) ; some files are under GPLv3+
263
264 (define-public libtool
265 (package
266 (name "libtool")
267 (version "2.4.6")
268 (source (origin
269 (method url-fetch)
270 (uri (string-append "mirror://gnu/libtool/libtool-"
271 version ".tar.xz"))
272 (sha256
273 (base32
274 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
275 (patches (search-patches "libtool-skip-tests2.patch"))))
276 (build-system gnu-build-system)
277 (propagated-inputs `(("m4" ,m4)))
278 (native-inputs `(("m4" ,m4)
279 ("perl" ,perl)
280 ("automake" ,automake) ;some tests rely on 'aclocal'
281 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
282
283 (arguments
284 `(;; Libltdl is provided as a separate package, so don't install it here.
285 #:configure-flags '("--disable-ltdl-install")
286
287 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
288 ;; <http://hydra.gnu.org/build/181662>.
289 #:tests? ,(not (string-prefix? "mips64"
290 (or (%current-target-system)
291 (%current-system))))
292
293 #:phases (alist-cons-before
294 'check 'pre-check
295 (lambda* (#:key inputs #:allow-other-keys)
296 ;; Run the test suite in parallel, if possible.
297 (setenv "TESTSUITEFLAGS"
298 (string-append
299 "-j"
300 (number->string (parallel-job-count))))
301
302 ;; Path references to /bin/sh.
303 (let ((bash (assoc-ref inputs "bash")))
304 (substitute* "tests/testsuite"
305 (("/bin/sh")
306 (string-append bash "/bin/bash")))))
307 %standard-phases)))
308 (synopsis "Generic shared library support tools")
309 (description
310 "GNU Libtool helps in the creation and use of shared libraries, by
311 presenting a single consistent, portable interface that hides the usual
312 complexity of working with shared libraries across platforms.")
313 (license gpl3+)
314 (home-page "http://www.gnu.org/software/libtool/")))
315
316 (define-public libltdl
317 ;; This is a libltdl package separate from the libtool package. This is
318 ;; useful because, unlike libtool, it has zero extra dependencies (making it
319 ;; readily usable during bootstrap), and it builds very quickly since
320 ;; Libtool's extensive test suite isn't run.
321 (package
322 (name "libltdl")
323 (version "2.4.6")
324 (source (origin
325 (method url-fetch)
326 (uri (string-append "mirror://gnu/libtool/libtool-"
327 version ".tar.xz"))
328 (sha256
329 (base32
330 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
331 (build-system gnu-build-system)
332 (arguments
333 '(#:configure-flags '("--enable-ltdl-install") ;really install it
334 #:phases (alist-cons-before
335 'configure 'change-directory
336 (lambda _
337 (chdir "libltdl"))
338 %standard-phases)))
339
340 (synopsis "System-independent dlopen wrapper of GNU libtool")
341 (description (package-description libtool))
342 (home-page (package-home-page libtool))
343 (license lgpl2.1+)))