1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 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@infotropique.org>
9 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages autotools)
27 #:use-module (guix licenses)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages m4)
32 #:use-module (gnu packages man)
33 #:use-module (gnu packages bash)
34 #:use-module (guix utils)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system trivial)
39 #:use-module (ice-9 match)
40 #:export (autoconf-wrapper))
42 (define-public autoconf
49 (uri (string-append "mirror://gnu/autoconf/autoconf-"
53 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
54 (build-system gnu-build-system)
58 ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
59 ;; should use our own "cpp" instead of "/lib/cpp".
60 (arguments `(#:tests? #f))
62 "http://www.gnu.org/software/autoconf/")
63 (synopsis "Create source code configuration scripts")
65 "Autoconf offers the developer a robust set of M4 macros which expand
66 into shell code to test the features of Unix-like systems and to adapt
67 automatically their software package to these systems. The resulting shell
68 scripts are self-contained and portable, freeing the user from needing to
69 know anything about Autoconf or M4.")
70 (license gpl3+))) ; some files are under GPLv2+
72 (define-public autoconf-2.68
73 (package (inherit autoconf)
78 (uri (string-append "mirror://gnu/autoconf/autoconf-"
82 "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
84 (define-public autoconf-2.64
85 ;; As of GDB 7.8, GDB is still developed using this version of Autoconf.
86 (package (inherit autoconf)
91 (uri (string-append "mirror://gnu/autoconf/autoconf-"
95 "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
97 (define-public autoconf-2.13
98 ;; GNU IceCat 52.x requires autoconf-2.13 to build!
99 (package (inherit autoconf)
104 (uri (string-append "mirror://gnu/autoconf/autoconf-"
108 "07krzl4czczdsgzrrw9fiqx35xcf32naf751khg821g5pqv12qgh"))))
112 ;; The 'configure' script in autoconf-2.13 can't cope with "SHELL=" and
113 ;; "CONFIG_SHELL=" arguments, so we set them as environment variables
114 ;; and pass a simplified set of arguments.
115 (modify-phases %standard-phases
117 (lambda* (#:key build inputs outputs #:allow-other-keys)
118 (let ((bash (which "bash"))
119 (out (assoc-ref outputs "out")))
120 (setenv "CONFIG_SHELL" bash)
121 (setenv "SHELL" bash)
122 (zero? (system* bash "./configure"
123 (string-append "--prefix=" out)
124 (string-append "--build=" build)))))))))))
127 (define* (autoconf-wrapper #:optional (autoconf autoconf))
128 "Return an wrapper around AUTOCONF that generates `configure' scripts that
129 use our own Bash instead of /bin/sh in shebangs. For that reason, it should
130 only be used internally---users should not end up distributing `configure'
131 files with a system-specific shebang."
132 (package (inherit autoconf)
133 (name (string-append (package-name autoconf) "-wrapper"))
134 (build-system trivial-build-system)
136 ;; XXX: Kludge to hide the circular dependency.
137 ,(module-ref (resolve-interface '(gnu packages guile))
139 ("autoconf" ,autoconf)
142 '(#:modules ((guix build utils))
145 (use-modules (guix build utils))
146 (let* ((out (assoc-ref %outputs "out"))
147 (bin (string-append out "/bin"))
148 (autoconf (string-append
149 (assoc-ref %build-inputs "autoconf")
151 (guile (string-append
152 (assoc-ref %build-inputs "guile")
155 (assoc-ref %build-inputs "bash")
157 (modules ((compose dirname dirname dirname)
158 (search-path %load-path
159 "guix/build/utils.scm"))))
162 ;; Symlink all the binaries but `autoconf'.
163 (with-directory-excursion bin
164 (for-each (lambda (file)
165 (unless (string=? (basename file) "autoconf")
166 (symlink file (basename file))))
167 (find-files (dirname autoconf) ".*")))
169 ;; Add an `autoconf' binary that wraps the real one.
170 (call-with-output-file (string-append bin "/autoconf")
172 ;; Shamefully, Guile can be used in shebangs only if a
173 ;; single argument is passed (-ds); otherwise it gets
174 ;; them all as a single argument and fails to parse them.
176 export GUILE_LOAD_PATH=\"~a\"
177 export GUILE_LOAD_COMPILED_PATH=\"~a\"
178 exec ~a --no-auto-compile \"$0\" \"$@\"
180 sh modules modules guile)
183 (use-modules (guix build utils))
184 (let ((result (apply system* ,autoconf
185 (cdr (command-line)))))
186 (when (and (file-exists? "configure")
187 (not (file-exists? "/bin/sh")))
188 ;; Patch regardless of RESULT, because `autoconf
189 ;; -Werror' can both create a `configure' file and
190 ;; return a non-zero exit code.
191 (patch-shebang "configure"))
192 (exit (status:exit-val result))))
194 (chmod (string-append bin "/autoconf") #o555)))))))
196 (define-public autoconf-archive
198 (name "autoconf-archive")
199 (version "2017.09.28")
203 (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
207 "00gsh9hkrgg291my98plkrwlcpxkfrpq64pglf18kciqbf2bb7sw"))))
208 (build-system gnu-build-system)
209 (home-page "https://www.gnu.org/software/autoconf-archive/")
210 (synopsis "Collection of freely reusable Autoconf macros")
212 "Autoconf Archive is a collection of over 450 new macros for Autoconf,
213 greatly expanding the domain of its functionality. These macros have been
214 contributed as free software by the community.")
217 (define-public autobuild
223 (uri (string-append "mirror://savannah/autobuild/autobuild-"
227 "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
228 (build-system gnu-build-system)
229 (inputs `(("perl" ,perl)))
230 (synopsis "Process generated build logs")
231 (description "Autobuild is a package that processes build logs generated
232 when building software. Autobuild is primarily focused on packages using
233 Autoconf and Automake, but can be used with other build systems too.
234 Autobuild generates an HTML summary file, containing links to each build log.
235 The summary includes project name, version, build hostname, host type (cross
236 compile aware), date of build, and indication of success or failure. The
237 output is indexed in many ways to simplify browsing.")
238 (home-page "http://josefsson.org/autobuild/")
241 (define-public automake
247 (uri (string-append "mirror://gnu/automake/automake-"
251 "1bzd9g32dfm4rsbw93ld9x7b5nc1y6i4m6zp032qf1i28a8s6sxg"))
253 (search-patches "automake-skip-amhello-tests.patch"))))
254 (build-system gnu-build-system)
256 `(("autoconf" ,(autoconf-wrapper))
259 (list (search-path-specification
260 (variable "ACLOCAL_PATH")
261 (files '("share/aclocal")))))
263 '(#:modules ((guix build gnu-build-system)
269 (modify-phases %standard-phases
270 (add-before '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)
283 ;; Files like `install-sh', `mdate.sh', etc. must use
284 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
285 ;; in the wild. See <http://bugs.gnu.org/14201> for an
287 (add-after '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 ".*"))))))))
309 (home-page "https://www.gnu.org/software/automake/")
310 (synopsis "Making GNU standards-compliant Makefiles")
312 "Automake the part of the GNU build system for producing
313 standards-compliant Makefiles. Build requirements are entered in an
314 intuitive format and then Automake works with Autoconf to produce a robust
315 Makefile, simplifying the entire process for the developer.")
316 (license gpl2+))) ; some files are under GPLv3+
318 (define-public automake-1.16
319 ;; Make this the default on the next rebuild cycle.
325 (uri (string-append "mirror://gnu/automake/automake-"
329 "12jvcmkcmd5p14b41w9f7ixd3sca97pymd6lqbkwnl8qn6bjv3zr"))
331 (search-patches "automake-skip-amhello-tests.patch"))))))
333 (define-public libtool
339 (uri (string-append "mirror://gnu/libtool/libtool-"
343 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
344 (patches (search-patches "libtool-skip-tests2.patch"))))
345 (build-system gnu-build-system)
346 (propagated-inputs `(("m4" ,m4)))
347 (native-inputs `(("m4" ,m4)
349 ("help2man" ,help2man) ;because we modify ltmain.sh
350 ("automake" ,automake) ;some tests rely on 'aclocal'
351 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
354 `(;; Libltdl is provided as a separate package, so don't install it here.
355 #:configure-flags '("--disable-ltdl-install")
357 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
358 ;; <http://hydra.gnu.org/build/181662>.
359 #:tests? ,(not (string-prefix? "mips64"
360 (or (%current-target-system)
364 (modify-phases %standard-phases
365 (add-before 'check 'pre-check
366 (lambda* (#:key inputs #:allow-other-keys)
367 ;; Run the test suite in parallel, if possible.
368 (setenv "TESTSUITEFLAGS"
371 (number->string (parallel-job-count))))
372 ;; Patch references to /bin/sh.
373 (let ((bash (assoc-ref inputs "bash")))
374 (substitute* "tests/testsuite"
376 (string-append bash "/bin/sh")))
378 (add-after 'patch-source-shebangs 'restore-ltmain-shebang
379 (lambda* (#:key inputs #:allow-other-keys)
380 (substitute* "build-aux/ltmain.in"
381 (("^#!.*/bin/sh$") "#!/bin/sh"))
384 (synopsis "Generic shared library support tools")
386 "GNU Libtool helps in the creation and use of shared libraries, by
387 presenting a single consistent, portable interface that hides the usual
388 complexity of working with shared libraries across platforms.")
390 (home-page "https://www.gnu.org/software/libtool/")))
392 (define-public libltdl
393 ;; This is a libltdl package separate from the libtool package. This is
394 ;; useful because, unlike libtool, it has zero extra dependencies (making it
395 ;; readily usable during bootstrap), and it builds very quickly since
396 ;; Libtool's extensive test suite isn't run.
402 (uri (string-append "mirror://gnu/libtool/libtool-"
406 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
407 (build-system gnu-build-system)
409 '(#:configure-flags '("--enable-ltdl-install") ;really install it
410 #:phases (modify-phases %standard-phases
411 (add-before 'configure 'change-directory
412 (lambda _ (chdir "libltdl") #t)))))
414 (synopsis "System-independent dlopen wrapper of GNU libtool")
415 (description (package-description libtool))
416 (home-page (package-home-page libtool))
419 (define-public pyconfigure
425 (uri (string-append "mirror://gnu/pyconfigure/pyconfigure-"
429 "0kxi9bg7l6ric39vbz9ykz4a21xlihhh2zcc3297db8amvhqwhrp"))))
430 (build-system gnu-build-system)
433 (modify-phases %standard-phases
434 (add-before 'configure 'patch-python
436 (substitute* "pyconf.in"
437 (("/usr/bin/env python") (which "python3")))
440 `(("python" ,python-3)))
441 (synopsis "@command{configure} interface for Python-based packages")
443 "GNU pyconfigure provides template files for easily implementing
444 standards-compliant configure scripts and Makefiles for Python-based packages.
445 It is designed to work alongside existing Python setup scripts, making it easy
446 to integrate into existing projects. Powerful and flexible Autoconf macros
447 are available, allowing you to easily make adjustments to the installation
448 procedure based on the capabilities of the target computer.")
449 (home-page "https://www.gnu.org/software/pyconfigure/manual/")
452 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html"))))