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