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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
38 (define-public autoconf
45 (uri (string-append "mirror://gnu/autoconf/autoconf-"
49 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
50 (build-system gnu-build-system)
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))
58 "http://www.gnu.org/software/autoconf/")
59 (synopsis "Create source code configuration scripts")
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+
68 (define-public autoconf-2.68
69 (package (inherit autoconf)
74 (uri (string-append "mirror://gnu/autoconf/autoconf-"
78 "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
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)
87 (uri (string-append "mirror://gnu/autoconf/autoconf-"
91 "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
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)
103 ;; XXX: Kludge to hide the circular dependency.
104 ,(module-ref (resolve-interface '(gnu packages guile))
106 ("autoconf" ,autoconf)
109 '(#:modules ((guix build utils))
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")
118 (guile (string-append
119 (assoc-ref %build-inputs "guile")
122 (assoc-ref %build-inputs "bash")
124 (modules ((compose dirname dirname dirname)
125 (search-path %load-path
126 "guix/build/utils.scm"))))
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) ".*")))
136 ;; Add an `autoconf' binary that wraps the real one.
137 (call-with-output-file (string-append bin "/autoconf")
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.
143 export GUILE_LOAD_PATH=\"~a\"
144 export GUILE_LOAD_COMPILED_PATH=\"~a\"
145 exec ~a --no-auto-compile \"$0\" \"$@\"
147 sh modules modules guile)
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))))
161 (chmod (string-append bin "/autoconf") #o555)))))))
163 (define-public autoconf-archive
165 (name "autoconf-archive")
166 (version "2017.03.21")
170 (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
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")
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.")
184 (define-public autobuild
190 (uri (string-append "mirror://savannah/autobuild/autobuild-"
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/")
208 (define-public automake
214 (uri (string-append "mirror://gnu/automake/automake-"
218 "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
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)
225 `(("autoconf" ,(autoconf-wrapper))
228 (list (search-path-specification
229 (variable "ACLOCAL_PATH")
230 (files '("share/aclocal")))))
232 '(#:modules ((guix build gnu-build-system)
237 #:phases (alist-cons-before
238 'patch-source-shebangs 'patch-tests-shebangs
240 (let ((sh (which "sh")))
241 (substitute* (find-files "t" "\\.(sh|tap)$")
242 (("#![[:blank:]]?/bin/sh")
243 (string-append "#!" sh)))
245 ;; Set these variables for all the `configure' runs
246 ;; that occur during the test suite.
248 (setenv "CONFIG_SHELL" sh)))
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
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
262 (list (get-u8 p) (get-u8 p))))
263 (map char->integer '(#\# #\!))))
265 (for-each (lambda (file)
266 (when (and (starts-with-shebang? file)
267 (executable-file? file))
268 (format #t "restoring shebang on `~a'~%"
273 (("^#!.*/bin/env(.*)$" _ args)
274 (string-append "#!/usr/bin/env"
276 (find-files dir ".*"))))
278 (home-page "https://www.gnu.org/software/automake/")
279 (synopsis "Making GNU standards-compliant Makefiles")
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+
287 (define-public libtool
293 (uri (string-append "mirror://gnu/libtool/libtool-"
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)
303 ("automake" ,automake) ;some tests rely on 'aclocal'
304 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
307 `(;; Libltdl is provided as a separate package, so don't install it here.
308 #:configure-flags '("--disable-ltdl-install")
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)
316 #:phases (alist-cons-before
318 (lambda* (#:key inputs #:allow-other-keys)
319 ;; Run the test suite in parallel, if possible.
320 (setenv "TESTSUITEFLAGS"
323 (number->string (parallel-job-count))))
325 ;; Path references to /bin/sh.
326 (let ((bash (assoc-ref inputs "bash")))
327 (substitute* "tests/testsuite"
329 (string-append bash "/bin/bash")))))
331 (synopsis "Generic shared library support tools")
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.")
337 (home-page "https://www.gnu.org/software/libtool/")))
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.
349 (uri (string-append "mirror://gnu/libtool/libtool-"
353 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
354 (build-system gnu-build-system)
356 '(#:configure-flags '("--enable-ltdl-install") ;really install it
357 #:phases (alist-cons-before
358 'configure 'change-directory
363 (synopsis "System-independent dlopen wrapper of GNU libtool")
364 (description (package-description libtool))
365 (home-page (package-home-page libtool))