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, 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
8 ;;; Copyright © 2017 ng0 <ng0@n0.is>
9 ;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages autotools)
29 #:use-module (guix licenses)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages python)
33 #:use-module (gnu packages m4)
34 #:use-module (gnu packages man)
35 #:use-module (gnu packages bash)
36 #:use-module (guix utils)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system trivial)
41 #:use-module (ice-9 match)
42 #:export (autoconf-wrapper))
44 (define-public autoconf
51 (uri (string-append "mirror://gnu/autoconf/autoconf-"
55 "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
56 (build-system gnu-build-system)
60 ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
61 ;; should use our own "cpp" instead of "/lib/cpp".
62 (arguments `(#:tests? #f))
64 "http://www.gnu.org/software/autoconf/")
65 (synopsis "Create source code configuration scripts")
67 "Autoconf offers the developer a robust set of M4 macros which expand
68 into shell code to test the features of Unix-like systems and to adapt
69 automatically their software package to these systems. The resulting shell
70 scripts are self-contained and portable, freeing the user from needing to
71 know anything about Autoconf or M4.")
72 (license gpl3+))) ; some files are under GPLv2+
74 (define-public autoconf-2.68
75 (package (inherit autoconf)
80 (uri (string-append "mirror://gnu/autoconf/autoconf-"
84 "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
86 (define-public autoconf-2.64
87 ;; As of GDB 7.8, GDB is still developed using this version of Autoconf.
88 (package (inherit autoconf)
93 (uri (string-append "mirror://gnu/autoconf/autoconf-"
97 "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
99 (define-public autoconf-2.13
100 ;; GNU IceCat 52.x requires autoconf-2.13 to build!
101 (package (inherit autoconf)
106 (uri (string-append "mirror://gnu/autoconf/autoconf-"
110 "07krzl4czczdsgzrrw9fiqx35xcf32naf751khg821g5pqv12qgh"))))
114 ;; The 'configure' script in autoconf-2.13 can't cope with "SHELL=" and
115 ;; "CONFIG_SHELL=" arguments, so we set them as environment variables
116 ;; and pass a simplified set of arguments.
117 (modify-phases %standard-phases
119 (lambda* (#:key build inputs outputs #:allow-other-keys)
120 (let ((bash (which "bash"))
121 (out (assoc-ref outputs "out")))
122 (setenv "CONFIG_SHELL" bash)
123 (setenv "SHELL" bash)
124 (invoke bash "./configure"
125 (string-append "--prefix=" out)
126 (string-append "--build=" build))))))))))
129 (define (make-autoconf-wrapper autoconf)
130 "Return a wrapper around AUTOCONF that generates `configure' scripts that
131 use our own Bash instead of /bin/sh in shebangs. For that reason, it should
132 only be used internally---users should not end up distributing `configure'
133 files with a system-specific shebang."
134 (package (inherit autoconf)
135 (name (string-append (package-name autoconf) "-wrapper"))
136 (build-system trivial-build-system)
138 ;; XXX: Kludge to hide the circular dependency.
139 ,(module-ref (resolve-interface '(gnu packages guile))
141 ("autoconf" ,autoconf)
144 '(#:modules ((guix build utils))
147 (use-modules (guix build utils))
148 (let* ((out (assoc-ref %outputs "out"))
149 (bin (string-append out "/bin"))
150 (autoconf (string-append
151 (assoc-ref %build-inputs "autoconf")
153 (guile (string-append
154 (assoc-ref %build-inputs "guile")
157 (assoc-ref %build-inputs "bash")
159 (modules ((compose dirname dirname dirname)
160 (search-path %load-path
161 "guix/build/utils.scm"))))
164 ;; Symlink all the binaries but `autoconf'.
165 (with-directory-excursion bin
166 (for-each (lambda (file)
167 (unless (string=? (basename file) "autoconf")
168 (symlink file (basename file))))
169 (find-files (dirname autoconf) ".*")))
171 ;; Add an `autoconf' binary that wraps the real one.
172 (call-with-output-file (string-append bin "/autoconf")
174 ;; Shamefully, Guile can be used in shebangs only if a
175 ;; single argument is passed (-ds); otherwise it gets
176 ;; them all as a single argument and fails to parse them.
178 export GUILE_LOAD_PATH=\"~a\"
179 export GUILE_LOAD_COMPILED_PATH=\"~a\"
180 exec ~a --no-auto-compile \"$0\" \"$@\"
182 sh modules modules guile)
185 (use-modules (guix build utils))
186 (let ((result (apply system* ,autoconf
187 (cdr (command-line)))))
188 (when (and (file-exists? "configure")
189 (not (file-exists? "/bin/sh")))
190 ;; Patch regardless of RESULT, because `autoconf
191 ;; -Werror' can both create a `configure' file and
192 ;; return a non-zero exit code.
193 (patch-shebang "configure"))
194 (exit (status:exit-val result))))
196 (chmod (string-append bin "/autoconf") #o555)
199 ;; Do not show it in the UI since it's meant for internal use.
200 (properties '((hidden? . #t)))))
202 (define-public autoconf-wrapper
203 (make-autoconf-wrapper autoconf))
205 (define-public autoconf-archive
207 (name "autoconf-archive")
208 (version "2019.01.06")
212 (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
216 "0gqya7nf4j5k98dkky0c3bnr0paciya91vkqazg7knlq621mq68p"))))
217 (build-system gnu-build-system)
218 (home-page "https://www.gnu.org/software/autoconf-archive/")
219 (synopsis "Collection of freely reusable Autoconf macros")
221 "Autoconf Archive is a collection of over 450 new macros for Autoconf,
222 greatly expanding the domain of its functionality. These macros have been
223 contributed as free software by the community.")
226 (define-public autobuild
232 (uri (string-append "mirror://savannah/autobuild/autobuild-"
236 "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
237 (build-system gnu-build-system)
238 (inputs `(("perl" ,perl)))
239 (synopsis "Process generated build logs")
240 (description "Autobuild is a package that processes build logs generated
241 when building software. Autobuild is primarily focused on packages using
242 Autoconf and Automake, but can be used with other build systems too.
243 Autobuild generates an HTML summary file, containing links to each build log.
244 The summary includes project name, version, build hostname, host type (cross
245 compile aware), date of build, and indication of success or failure. The
246 output is indexed in many ways to simplify browsing.")
247 (home-page "http://josefsson.org/autobuild/")
250 (define-public automake
256 (uri (string-append "mirror://gnu/automake/automake-"
260 "08g979ficj18i1w6w5219bgmns7czr03iadf20mk3lrzl8wbn1ax"))
262 (search-patches "automake-skip-amhello-tests.patch"))))
263 (build-system gnu-build-system)
265 `(("autoconf" ,autoconf-wrapper)
268 (list (search-path-specification
269 (variable "ACLOCAL_PATH")
270 (files '("share/aclocal")))))
272 '(#:modules ((guix build gnu-build-system)
278 (modify-phases %standard-phases
279 (add-before 'patch-source-shebangs 'patch-tests-shebangs
281 (let ((sh (which "sh")))
282 (substitute* (find-files "t" "\\.(sh|tap)$")
283 (("#![[:blank:]]?/bin/sh")
284 (string-append "#!" sh)))
286 ;; Set these variables for all the `configure' runs
287 ;; that occur during the test suite.
289 (setenv "CONFIG_SHELL" sh)
292 ;; Files like `install-sh', `mdate.sh', etc. must use
293 ;; #!/bin/sh, otherwise users could leak erroneous shebangs
294 ;; in the wild. See <http://bugs.gnu.org/14201> for an
296 (add-after 'install 'unpatch-shebangs
297 (lambda* (#:key outputs #:allow-other-keys)
298 (let* ((out (assoc-ref outputs "out"))
299 (dir (string-append out "/share")))
300 (define (starts-with-shebang? file)
301 (equal? (call-with-input-file file
303 (list (get-u8 p) (get-u8 p))))
304 (map char->integer '(#\# #\!))))
306 (for-each (lambda (file)
307 (when (and (starts-with-shebang? file)
308 (executable-file? file))
309 (format #t "restoring shebang on `~a'~%"
314 (("^#!.*/bin/env(.*)$" _ args)
315 (string-append "#!/usr/bin/env"
317 (find-files dir ".*"))
319 (home-page "https://www.gnu.org/software/automake/")
320 (synopsis "Making GNU standards-compliant Makefiles")
322 "Automake the part of the GNU build system for producing
323 standards-compliant Makefiles. Build requirements are entered in an
324 intuitive format and then Automake works with Autoconf to produce a robust
325 Makefile, simplifying the entire process for the developer.")
326 (license gpl2+))) ; some files are under GPLv3+
328 (define-public libtool
334 (uri (string-append "mirror://gnu/libtool/libtool-"
338 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
339 (patches (search-patches "libtool-skip-tests2.patch"))))
340 (build-system gnu-build-system)
341 (propagated-inputs `(("m4" ,m4)))
342 (native-inputs `(("m4" ,m4)
344 ;; XXX: this shouldn't be necessary, but without it test
345 ;; 102 fails because it cannot find ltdl/libltdl.la.
347 ("help2man" ,help2man) ;because we modify ltmain.sh
348 ("automake" ,automake) ;some tests rely on 'aclocal'
349 ("autoconf" ,autoconf-wrapper))) ;others on 'autom4te'
352 `(;; Libltdl is provided as a separate package, so don't install it here.
353 #:configure-flags '("--disable-ltdl-install")
355 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
356 ;; <http://hydra.gnu.org/build/181662>.
357 #:tests? ,(not (string-prefix? "mips64"
358 (or (%current-target-system)
362 (modify-phases %standard-phases
363 (add-before 'check 'pre-check
364 (lambda* (#:key inputs #:allow-other-keys)
365 ;; Run the test suite in parallel, if possible.
366 (setenv "TESTSUITEFLAGS"
369 (number->string (parallel-job-count))))
370 ;; Patch references to /bin/sh.
371 (let ((bash (assoc-ref inputs "bash")))
372 (substitute* "tests/testsuite"
374 (string-append bash "/bin/sh")))
376 (add-after 'patch-source-shebangs 'restore-ltmain-shebang
377 (lambda* (#:key inputs #:allow-other-keys)
378 (substitute* "build-aux/ltmain.in"
379 (("^#!.*/bin/sh$") "#!/bin/sh"))
382 (synopsis "Generic shared library support tools")
384 "GNU Libtool helps in the creation and use of shared libraries, by
385 presenting a single consistent, portable interface that hides the usual
386 complexity of working with shared libraries across platforms.")
388 (home-page "https://www.gnu.org/software/libtool/")))
390 (define-public libltdl
391 ;; This is a libltdl package separate from the libtool package. This is
392 ;; useful because, unlike libtool, it has zero extra dependencies (making it
393 ;; readily usable during bootstrap), and it builds very quickly since
394 ;; Libtool's extensive test suite isn't run.
400 (uri (string-append "mirror://gnu/libtool/libtool-"
404 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
405 (build-system gnu-build-system)
407 '(#:configure-flags '("--enable-ltdl-install") ;really install it
408 #:phases (modify-phases %standard-phases
409 (add-before 'configure 'change-directory
410 (lambda _ (chdir "libltdl") #t)))))
412 (synopsis "System-independent dlopen wrapper of GNU libtool")
413 (description (package-description libtool))
414 (home-page (package-home-page libtool))
417 (define-public pyconfigure
423 (uri (string-append "mirror://gnu/pyconfigure/pyconfigure-"
427 "0kxi9bg7l6ric39vbz9ykz4a21xlihhh2zcc3297db8amvhqwhrp"))))
428 (build-system gnu-build-system)
431 (modify-phases %standard-phases
432 (add-before 'configure 'patch-python
434 (substitute* "pyconf.in"
435 (("/usr/bin/env python") (which "python3")))
438 `(("python" ,python-3)))
439 (synopsis "@command{configure} interface for Python-based packages")
441 "GNU pyconfigure provides template files for easily implementing
442 standards-compliant configure scripts and Makefiles for Python-based packages.
443 It is designed to work alongside existing Python setup scripts, making it easy
444 to integrate into existing projects. Powerful and flexible Autoconf macros
445 are available, allowing you to easily make adjustments to the installation
446 procedure based on the capabilities of the target computer.")
447 (home-page "https://www.gnu.org/software/pyconfigure/manual/")
450 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html"))))