gnu: python-pandas: Fix build on 32-bit.
[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>
6b0686fa 7;;; Copyright © 2016 David Thompson <davet@gnu.org>
80ffc708 8;;;
233e7676 9;;; This file is part of GNU Guix.
80ffc708 10;;;
233e7676 11;;; GNU Guix is free software; you can redistribute it and/or modify it
80ffc708
NK
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;;;
233e7676 16;;; GNU Guix is distributed in the hope that it will be useful, but
80ffc708
NK
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
233e7676 22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
80ffc708 23
1ffa7090 24(define-module (gnu packages autotools)
4a44e743 25 #:use-module (guix licenses)
59a43334 26 #:use-module (gnu packages)
1ffa7090
LC
27 #:use-module (gnu packages perl)
28 #:use-module (gnu packages m4)
7cd1d7bd
LC
29 #:use-module (gnu packages bash)
30 #:use-module (guix utils)
80ffc708
NK
31 #:use-module (guix packages)
32 #:use-module (guix download)
7cd1d7bd 33 #:use-module (guix build-system gnu)
c6e96280
MR
34 #:use-module (guix build-system trivial)
35 #:use-module (ice-9 match)
36 #:export (autoconf-wrapper))
80ffc708
NK
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)
a6abac9f 51 (native-inputs
80ffc708
NK
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/")
f50d2669 59 (synopsis "Create source code configuration scripts")
80ffc708 60 (description
a22dc0c4
LC
61 "Autoconf offers the developer a robust set of M4 macros which expand
62into shell code to test the features of Unix-like systems and to adapt
63automatically their software package to these systems. The resulting shell
64scripts are self-contained and portable, freeing the user from needing to
65know anything about Autoconf or M4.")
4a44e743 66 (license gpl3+))) ; some files are under GPLv2+
80ffc708 67
c6e96280
MR
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
2a7050ab
LC
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
c6e96280
MR
94(define* (autoconf-wrapper #:optional (autoconf autoconf))
95 "Return an wrapper around AUTOCONF that generates `configure' scripts that
96use our own Bash instead of /bin/sh in shebangs. For that reason, it should
97only be used internally---users should not end up distributing `configure'
98files with a system-specific shebang."
7cd1d7bd 99 (package (inherit autoconf)
7cd1d7bd
LC
100 (name (string-append (package-name autoconf) "-wrapper"))
101 (build-system trivial-build-system)
102 (inputs `(("guile"
168030ea
LC
103 ;; XXX: Kludge to hide the circular dependency.
104 ,(module-ref (resolve-interface '(gnu packages guile))
105 'guile-2.0))
7cd1d7bd
LC
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
143export GUILE_LOAD_PATH=\"~a\"
144export GUILE_LOAD_COMPILED_PATH=\"~a\"
145exec ~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)))))
f11617d8
LC
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))))
7cd1d7bd
LC
160 port)))
161 (chmod (string-append bin "/autoconf") #o555)))))))
162
6b0686fa
DT
163(define-public autoconf-archive
164 (package
165 (name "autoconf-archive")
0bb94615 166 (version "2016.09.16")
6b0686fa
DT
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
0bb94615 174 "10mxz9hfnfz66m1l9s28sbyfb9a04akz92wkyv9blhpq6p9fzwp8"))))
6b0686fa
DT
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,
180greatly expanding the domain of its functionality. These macros have been
181contributed as free software by the community.")
182 (license gpl3+)))
183
2b00a550
ML
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
199when building software. Autobuild is primarily focused on packages using
200Autoconf and Automake, but can be used with other build systems too.
201Autobuild generates an HTML summary file, containing links to each build log.
202The summary includes project name, version, build hostname, host type (cross
203compile aware), date of build, and indication of success or failure. The
204output is indexed in many ways to simplify browsing.")
205 (home-page "http://josefsson.org/autobuild/")
206 (license gpl3+)))
207
80ffc708
NK
208(define-public automake
209 (package
210 (name "automake")
aebb05b0 211 (version "1.15")
7cd1d7bd
LC
212 (source (origin
213 (method url-fetch)
214 (uri (string-append "mirror://gnu/automake/automake-"
215 version ".tar.xz"))
216 (sha256
217 (base32
aebb05b0 218 "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
01eafd38 219 (patches
fc1adab1 220 (search-patches "automake-regexp-syntax.patch"
28206a8e
LC
221 "automake-skip-amhello-tests.patch"
222 "automake-test-gzip-warning.patch"))))
80ffc708 223 (build-system gnu-build-system)
a6abac9f 224 (native-inputs
c6e96280 225 `(("autoconf" ,(autoconf-wrapper))
01eafd38 226 ("perl" ,perl)))
a9db7d10
LC
227 (native-search-paths
228 (list (search-path-specification
229 (variable "ACLOCAL_PATH")
af070955 230 (files '("share/aclocal")))))
7cd1d7bd 231 (arguments
01eafd38 232 '(#:modules ((guix build gnu-build-system)
63b7c6c1
LC
233 (guix build utils)
234 (srfi srfi-1)
235 (srfi srfi-26)
236 (rnrs io ports))
7cd1d7bd
LC
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)))
9be8d7c8 249
63b7c6c1
LC
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))))
7cd1d7bd 278 (home-page "http://www.gnu.org/software/automake/")
f50d2669 279 (synopsis "Making GNU standards-compliant Makefiles")
80ffc708 280 (description
79c311b8
LC
281 "Automake the part of the GNU build system for producing
282standards-compliant Makefiles. Build requirements are entered in an
283intuitive format and then Automake works with Autoconf to produce a robust
284Makefile, simplifying the entire process for the developer.")
7cd1d7bd 285 (license gpl2+))) ; some files are under GPLv3+
36d4d49e
NK
286
287(define-public libtool
288 (package
289 (name "libtool")
192c6f96 290 (version "2.4.6")
36d4d49e 291 (source (origin
c154e1ea
LC
292 (method url-fetch)
293 (uri (string-append "mirror://gnu/libtool/libtool-"
294 version ".tar.xz"))
295 (sha256
296 (base32
192c6f96 297 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
fc1adab1 298 (patches (search-patches "libtool-skip-tests2.patch"))))
36d4d49e 299 (build-system gnu-build-system)
62c155c0 300 (propagated-inputs `(("m4" ,m4)))
36d4d49e 301 (native-inputs `(("m4" ,m4)
c154e1ea
LC
302 ("perl" ,perl)
303 ("automake" ,automake) ;some tests rely on 'aclocal'
304 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
2f8a123e 305
36d4d49e 306 (arguments
3246cc91
LC
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))))
c154e1ea 315
3246cc91
LC
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))))
42ff70e2 324
3246cc91
LC
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)))
f50d2669 331 (synopsis "Generic shared library support tools")
36d4d49e 332 (description
79c311b8
LC
333 "GNU Libtool helps in the creation and use of shared libraries, by
334presenting a single consistent, portable interface that hides the usual
335complexity of working with shared libraries across platforms.")
4a44e743 336 (license gpl3+)
36d4d49e 337 (home-page "http://www.gnu.org/software/libtool/")))
e13f715b 338
3cbb3f9c
LC
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")
192c6f96 346 (version "2.4.6")
a101c891
LC
347 (source (origin
348 (method url-fetch)
349 (uri (string-append "mirror://gnu/libtool/libtool-"
350 version ".tar.xz"))
351 (sha256
352 (base32
ef593a10 353 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
3cbb3f9c
LC
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+)))