1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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, 2017 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
8 ;;; Copyright © 2017 ng0 <ng0@libertad.pw>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages autotools)
26 #:use-module (guix licenses)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages m4)
30 #:use-module (gnu packages man)
31 #:use-module (gnu packages bash)
32 #:use-module (guix utils)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system trivial)
37 #:use-module (ice-9 match)
38 #:export (autoconf-wrapper))
40 (define-public autoconf
47 (uri (string-append "mirror://gnu/autoconf/autoconf-"
51 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
52 (build-system gnu-build-system)
56 ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
57 ;; should use our own "cpp" instead of "/lib/cpp".
58 (arguments `(#:tests? #f))
60 "http://www.gnu.org/software/autoconf/")
61 (synopsis "Create source code configuration scripts")
63 "Autoconf offers the developer a robust set of M4 macros which expand
64 into shell code to test the features of Unix-like systems and to adapt
65 automatically their software package to these systems. The resulting shell
66 scripts are self-contained and portable, freeing the user from needing to
67 know anything about Autoconf or M4.")
68 (license gpl3+))) ; some files are under GPLv2+
70 (define-public autoconf-2.68
71 (package (inherit autoconf)
76 (uri (string-append "mirror://gnu/autoconf/autoconf-"
80 "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
82 (define-public autoconf-2.64
83 ;; As of GDB 7.8, GDB is still developed using this version of Autoconf.
84 (package (inherit autoconf)
89 (uri (string-append "mirror://gnu/autoconf/autoconf-"
93 "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
95 (define-public autoconf-2.13
96 ;; GNU IceCat 52.x requires autoconf-2.13 to build!
97 (package (inherit autoconf)
102 (uri (string-append "mirror://gnu/autoconf/autoconf-"
106 "07krzl4czczdsgzrrw9fiqx35xcf32naf751khg821g5pqv12qgh"))))
110 ;; The 'configure' script in autoconf-2.13 can't cope with "SHELL=" and
111 ;; "CONFIG_SHELL=" arguments, so we set them as environment variables
112 ;; and pass a simplified set of arguments.
113 (modify-phases %standard-phases
115 (lambda* (#:key build inputs outputs #:allow-other-keys)
116 (let ((bash (which "bash"))
117 (out (assoc-ref outputs "out")))
118 (setenv "CONFIG_SHELL" bash)
119 (setenv "SHELL" bash)
120 (zero? (system* bash "./configure"
121 (string-append "--prefix=" out)
122 (string-append "--build=" build)))))))))))
125 (define* (autoconf-wrapper #:optional (autoconf autoconf))
126 "Return an wrapper around AUTOCONF that generates `configure' scripts that
127 use our own Bash instead of /bin/sh in shebangs. For that reason, it should
128 only be used internally---users should not end up distributing `configure'
129 files with a system-specific shebang."
130 (package (inherit autoconf)
131 (name (string-append (package-name autoconf) "-wrapper"))
132 (build-system trivial-build-system)
134 ;; XXX: Kludge to hide the circular dependency.
135 ,(module-ref (resolve-interface '(gnu packages guile))
137 ("autoconf" ,autoconf)
140 '(#:modules ((guix build utils))
143 (use-modules (guix build utils))
144 (let* ((out (assoc-ref %outputs "out"))
145 (bin (string-append out "/bin"))
146 (autoconf (string-append
147 (assoc-ref %build-inputs "autoconf")
149 (guile (string-append
150 (assoc-ref %build-inputs "guile")
153 (assoc-ref %build-inputs "bash")
155 (modules ((compose dirname dirname dirname)
156 (search-path %load-path
157 "guix/build/utils.scm"))))
160 ;; Symlink all the binaries but `autoconf'.
161 (with-directory-excursion bin
162 (for-each (lambda (file)
163 (unless (string=? (basename file) "autoconf")
164 (symlink file (basename file))))
165 (find-files (dirname autoconf) ".*")))
167 ;; Add an `autoconf' binary that wraps the real one.
168 (call-with-output-file (string-append bin "/autoconf")
170 ;; Shamefully, Guile can be used in shebangs only if a
171 ;; single argument is passed (-ds); otherwise it gets
172 ;; them all as a single argument and fails to parse them.
174 export GUILE_LOAD_PATH=\"~a\"
175 export GUILE_LOAD_COMPILED_PATH=\"~a\"
176 exec ~a --no-auto-compile \"$0\" \"$@\"
178 sh modules modules guile)
181 (use-modules (guix build utils))
182 (let ((result (apply system* ,autoconf
183 (cdr (command-line)))))
184 (when (and (file-exists? "configure")
185 (not (file-exists? "/bin/sh")))
186 ;; Patch regardless of RESULT, because `autoconf
187 ;; -Werror' can both create a `configure' file and
188 ;; return a non-zero exit code.
189 (patch-shebang "configure"))
190 (exit (status:exit-val result))))
192 (chmod (string-append bin "/autoconf") #o555)))))))
194 (define-public autoconf-archive
196 (name "autoconf-archive")
197 (version "2017.03.21")
201 (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
205 "0rfpapadka2023qhy8294ca5awxpb8d4904js6kv7piby5ax8siq"))))
206 (build-system gnu-build-system)
207 (home-page "https://www.gnu.org/software/autoconf-archive/")
208 (synopsis "Collection of freely reusable Autoconf macros")
210 "Autoconf Archive is a collection of over 450 new macros for Autoconf,
211 greatly expanding the domain of its functionality. These macros have been
212 contributed as free software by the community.")
215 (define-public autobuild
221 (uri (string-append "mirror://savannah/autobuild/autobuild-"
225 "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
226 (build-system gnu-build-system)
227 (inputs `(("perl" ,perl)))
228 (synopsis "Process generated build logs")
229 (description "Autobuild is a package that processes build logs generated
230 when building software. Autobuild is primarily focused on packages using
231 Autoconf and Automake, but can be used with other build systems too.
232 Autobuild generates an HTML summary file, containing links to each build log.
233 The summary includes project name, version, build hostname, host type (cross
234 compile aware), date of build, and indication of success or failure. The
235 output is indexed in many ways to simplify browsing.")
236 (home-page "http://josefsson.org/autobuild/")
239 (define-public automake
240 ;; Replace with 'automake/latest' on the next rebuild cycle.
246 (uri (string-append "mirror://gnu/automake/automake-"
250 "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
252 (search-patches "automake-regexp-syntax.patch"
253 "automake-skip-amhello-tests.patch"
254 "automake-test-gzip-warning.patch"))))
255 (build-system gnu-build-system)
257 `(("autoconf" ,(autoconf-wrapper))
260 (list (search-path-specification
261 (variable "ACLOCAL_PATH")
262 (files '("share/aclocal")))))
264 '(#:modules ((guix build gnu-build-system)
269 #:phases (alist-cons-before
270 'patch-source-shebangs 'patch-tests-shebangs
272 (let ((sh (which "sh")))
273 (substitute* (find-files "t" "\\.(sh|tap)$")
274 (("#![[:blank:]]?/bin/sh")
275 (string-append "#!" sh)))
277 ;; Set these variables for all the `configure' runs
278 ;; that occur during the test suite.
280 (setenv "CONFIG_SHELL" sh)))
282 ;; Files like `install-sh', `mdate.sh', etc. must use
283 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
284 ;; in the wild. See <http://bugs.gnu.org/14201> for an
287 'install 'unpatch-shebangs
288 (lambda* (#:key outputs #:allow-other-keys)
289 (let* ((out (assoc-ref outputs "out"))
290 (dir (string-append out "/share")))
291 (define (starts-with-shebang? file)
292 (equal? (call-with-input-file file
294 (list (get-u8 p) (get-u8 p))))
295 (map char->integer '(#\# #\!))))
297 (for-each (lambda (file)
298 (when (and (starts-with-shebang? file)
299 (executable-file? file))
300 (format #t "restoring shebang on `~a'~%"
305 (("^#!.*/bin/env(.*)$" _ args)
306 (string-append "#!/usr/bin/env"
308 (find-files dir ".*"))))
310 (home-page "https://www.gnu.org/software/automake/")
311 (synopsis "Making GNU standards-compliant Makefiles")
313 "Automake the part of the GNU build system for producing
314 standards-compliant Makefiles. Build requirements are entered in an
315 intuitive format and then Automake works with Autoconf to produce a robust
316 Makefile, simplifying the entire process for the developer.")
317 (license gpl2+))) ; some files are under GPLv3+
320 (define-public automake/latest
321 ;; Merge with 'automake' on the next rebuild cycle.
327 (uri (string-append "mirror://gnu/automake/automake-"
331 "1bzd9g32dfm4rsbw93ld9x7b5nc1y6i4m6zp032qf1i28a8s6sxg"))
333 (search-patches "automake-skip-amhello-tests.patch"))))))
335 (define-public libtool
341 (uri (string-append "mirror://gnu/libtool/libtool-"
345 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
346 (patches (search-patches "libtool-skip-tests2.patch"))))
347 (build-system gnu-build-system)
348 (propagated-inputs `(("m4" ,m4)))
349 (native-inputs `(("m4" ,m4)
351 ("help2man" ,help2man) ;because we modify ltmain.sh
352 ("automake" ,automake) ;some tests rely on 'aclocal'
353 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
356 `(;; Libltdl is provided as a separate package, so don't install it here.
357 #:configure-flags '("--disable-ltdl-install")
359 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
360 ;; <http://hydra.gnu.org/build/181662>.
361 #:tests? ,(not (string-prefix? "mips64"
362 (or (%current-target-system)
366 (modify-phases %standard-phases
367 (add-before 'check 'pre-check
368 (lambda* (#:key inputs #:allow-other-keys)
369 ;; Run the test suite in parallel, if possible.
370 (setenv "TESTSUITEFLAGS"
373 (number->string (parallel-job-count))))
374 ;; Patch references to /bin/sh.
375 (let ((bash (assoc-ref inputs "bash")))
376 (substitute* "tests/testsuite"
378 (string-append bash "/bin/sh")))
380 (add-after 'patch-source-shebangs 'restore-ltmain-shebang
381 (lambda* (#:key inputs #:allow-other-keys)
382 (substitute* "build-aux/ltmain.in"
383 (("^#!.*/bin/sh$") "#!/bin/sh"))
386 (synopsis "Generic shared library support tools")
388 "GNU Libtool helps in the creation and use of shared libraries, by
389 presenting a single consistent, portable interface that hides the usual
390 complexity of working with shared libraries across platforms.")
392 (home-page "https://www.gnu.org/software/libtool/")))
394 (define-public libltdl
395 ;; This is a libltdl package separate from the libtool package. This is
396 ;; useful because, unlike libtool, it has zero extra dependencies (making it
397 ;; readily usable during bootstrap), and it builds very quickly since
398 ;; Libtool's extensive test suite isn't run.
404 (uri (string-append "mirror://gnu/libtool/libtool-"
408 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
409 (build-system gnu-build-system)
411 '(#:configure-flags '("--enable-ltdl-install") ;really install it
412 #:phases (alist-cons-before
413 'configure 'change-directory
418 (synopsis "System-independent dlopen wrapper of GNU libtool")
419 (description (package-description libtool))
420 (home-page (package-home-page libtool))