gnu: r-fields: Update to 11.4.
[jackhill/guix/guix.git] / gnu / packages / autotools.scm
index 355e66f..775576f 100644 (file)
@@ -1,12 +1,16 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
 ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015, 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
-;;; Copyright © 2017 ng0 <ng0@infotropique.org>
-;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Nikita <nikita@n0.is>
+;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
        (base32
         "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
     (build-system gnu-build-system)
+    (inputs
+     ;; TODO: remove `if' in the next rebuild cycle.
+     (if (%current-target-system)
+         `(("bash" ,bash-minimal)
+           ("perl" ,perl)
+           ("m4" ,m4))
+         '()))
     (native-inputs
      `(("perl" ,perl)
        ("m4" ,m4)))
-    ;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
-    ;; should use our own "cpp" instead of "/lib/cpp".
-    (arguments `(#:tests? #f))
-    (home-page
-     "http://www.gnu.org/software/autoconf/")
+    (arguments
+     `(;; XXX: testsuite: 209 and 279 failed.  The latter is an impurity.  It
+       ;; should use our own "cpp" instead of "/lib/cpp".
+       #:tests? #f
+       ,@(if (%current-target-system)
+             `(#:phases
+               (modify-phases %standard-phases
+                 (add-after 'install 'patch-non-shebang-references
+                   (lambda* (#:key build inputs outputs #:allow-other-keys)
+                     ;; `patch-shebangs' patches shebangs only, and the Perl
+                     ;; scripts use a re-exec feature that references the
+                     ;; build hosts' perl.  Also, BASH and M4 store references
+                     ;; hide in the scripts.
+                     (let ((bash (assoc-ref inputs "bash"))
+                           (m4 (assoc-ref inputs "m4"))
+                           (perl (assoc-ref inputs "perl"))
+                           (out  (assoc-ref outputs "out"))
+                           (store-directory (%store-directory)))
+                      (substitute* (find-files (string-append out "/bin"))
+                        (((string-append store-directory "/[^/]*-bash-[^/]*"))
+                         bash)
+                        (((string-append store-directory "/[^/]*-m4-[^/]*"))
+                         m4)
+                        (((string-append store-directory "/[^/]*-perl-[^/]*"))
+                         perl))
+                      #t)))))
+             '())))
+    (home-page "https://www.gnu.org/software/autoconf/")
     (synopsis "Create source code configuration scripts")
     (description
      "Autoconf offers the developer a robust set of M4 macros which expand
@@ -119,13 +153,13 @@ know anything about Autoconf or M4.")
                    (out  (assoc-ref outputs "out")))
                (setenv "CONFIG_SHELL" bash)
                (setenv "SHELL" bash)
-               (zero? (system* bash "./configure"
-                               (string-append "--prefix=" out)
-                               (string-append "--build=" build)))))))))))
+               (invoke bash "./configure"
+                       (string-append "--prefix=" out)
+                       (string-append "--build=" build))))))))))
 
 
-(define* (autoconf-wrapper #:optional (autoconf autoconf))
-  "Return an wrapper around AUTOCONF that generates `configure' scripts that
+(define (make-autoconf-wrapper autoconf)
+  "Return a wrapper around AUTOCONF that generates `configure' scripts that
 use our own Bash instead of /bin/sh in shebangs.  For that reason, it should
 only be used internally---users should not end up distributing `configure'
 files with a system-specific shebang."
@@ -191,12 +225,19 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
                        (patch-shebang "configure"))
                      (exit (status:exit-val result))))
                 port)))
-           (chmod (string-append bin "/autoconf") #o555)))))))
+           (chmod (string-append bin "/autoconf") #o555)
+           #t))))
+
+    ;; Do not show it in the UI since it's meant for internal use.
+    (properties '((hidden? . #t)))))
+
+(define-public autoconf-wrapper
+  (make-autoconf-wrapper autoconf))
 
 (define-public autoconf-archive
   (package
     (name "autoconf-archive")
-    (version "2017.09.28")
+    (version "2019.01.06")
     (source
      (origin
       (method url-fetch)
@@ -204,7 +245,7 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
                           version ".tar.xz"))
       (sha256
        (base32
-        "00gsh9hkrgg291my98plkrwlcpxkfrpq64pglf18kciqbf2bb7sw"))))
+        "0gqya7nf4j5k98dkky0c3bnr0paciya91vkqazg7knlq621mq68p"))))
     (build-system gnu-build-system)
     (home-page "https://www.gnu.org/software/autoconf-archive/")
     (synopsis "Collection of freely reusable Autoconf macros")
@@ -235,32 +276,39 @@ Autobuild generates an HTML summary file, containing links to each build log.
 The summary includes project name, version, build hostname, host type (cross
 compile aware), date of build, and indication of success or failure.  The
 output is indexed in many ways to simplify browsing.")
-    (home-page "http://josefsson.org/autobuild/")
+    (home-page "https://josefsson.org/autobuild/")
     (license gpl3+)))
 
 (define-public automake
   (package
     (name "automake")
-    (version "1.15.1")
+    (version "1.16.2")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/automake/automake-"
                                  version ".tar.xz"))
              (sha256
               (base32
-               "1bzd9g32dfm4rsbw93ld9x7b5nc1y6i4m6zp032qf1i28a8s6sxg"))
+                "1l7dkqbsmbf94ax29jj1jf6a0r6ikc8jybg1p5m0c3ki7pg5ki6c"))
              (patches
               (search-patches "automake-skip-amhello-tests.patch"))))
     (build-system gnu-build-system)
+    (inputs
+     ;; TODO: remove `if' in the next rebuild cycle.
+     (if (%current-target-system)
+         `(("autoconf" ,autoconf-wrapper)
+           ("bash" ,bash-minimal)
+           ("perl" ,perl))
+         '()))
     (native-inputs
-     `(("autoconf" ,(autoconf-wrapper))
+     `(("autoconf" ,autoconf-wrapper)
        ("perl" ,perl)))
     (native-search-paths
      (list (search-path-specification
             (variable "ACLOCAL_PATH")
             (files '("share/aclocal")))))
     (arguments
-     '(#:modules ((guix build gnu-build-system)
+     `(#:modules ((guix build gnu-build-system)
                   (guix build utils)
                   (srfi srfi-1)
                   (srfi srfi-26)
@@ -280,32 +328,64 @@ output is indexed in many ways to simplify browsing.")
                (setenv "CONFIG_SHELL" sh)
                #t)))
 
-           ;; Files like `install-sh', `mdate.sh', etc. must use
-           ;; #!/bin/sh, otherwise users could leak erroneous shebangs
-           ;; in the wild.  See <http://bugs.gnu.org/14201> for an
-           ;; example.
-           (add-after 'install 'unpatch-shebangs
-             (lambda* (#:key outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (dir (string-append out "/share")))
-                 (define (starts-with-shebang? file)
-                   (equal? (call-with-input-file file
-                             (lambda (p)
-                               (list (get-u8 p) (get-u8 p))))
-                           (map char->integer '(#\# #\!))))
+           (add-before 'check 'skip-test
+             (lambda _
+               ;; This test requires 'etags' and fails if it's missing.
+               ;; Skip it.
+               (substitute* "t/tags-lisp-space.sh"
+                 (("^required.*" all)
+                  (string-append "exit 77\n" all "\n")))
+               #t))
+
+           ,@(if (%current-target-system)
+                 `((add-after 'install 'patch-non-shebang-references
+                     (lambda* (#:key build inputs outputs #:allow-other-keys)
+                     ;; `patch-shebangs' patches shebangs only, and the Perl
+                     ;; scripts use a re-exec feature that references the
+                     ;; build hosts' perl.  Also, AUTOCONF and BASH store
+                     ;; references hide in the scripts.
+                       (let ((autoconf (assoc-ref inputs "autoconf"))
+                             (bash (assoc-ref inputs "bash"))
+                             (perl (assoc-ref inputs "perl"))
+                             (out  (assoc-ref outputs "out"))
+                             (store-directory (%store-directory)))
+                         (substitute* (find-files (string-append out "/bin"))
+                           (((string-append store-directory "/[^/]*-autoconf-[^/]*"))
+                            autoconf)
+                           (((string-append store-directory "/[^/]*-bash-[^/]*"))
+                            bash)
+                           (((string-append store-directory "/[^/]*-perl-[^/]*"))
+                            perl))
+                         #t))))
+                 '())
 
-                 (for-each (lambda (file)
-                             (when (and (starts-with-shebang? file)
-                                        (executable-file? file))
-                               (format #t "restoring shebang on `~a'~%"
-                                       file)
-                               (substitute* file
-                                 (("^#!.*/bin/sh")
-                                  "#!/bin/sh")
-                                 (("^#!.*/bin/env(.*)$" _ args)
-                                  (string-append "#!/usr/bin/env"
-                                                 args)))))
-                           (find-files dir ".*"))))))))
+         ;; Files like `install-sh', `mdate.sh', etc. must use
+         ;; #!/bin/sh, otherwise users could leak erroneous shebangs
+         ;; in the wild.  See <http://bugs.gnu.org/14201> for an
+         ;; example.
+         (add-after 'install 'unpatch-shebangs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (dir (string-append out "/share")))
+               (define (starts-with-shebang? file)
+                 (equal? (call-with-input-file file
+                           (lambda (p)
+                             (list (get-u8 p) (get-u8 p))))
+                         (map char->integer '(#\# #\!))))
+
+               (for-each (lambda (file)
+                           (when (and (starts-with-shebang? file)
+                                      (executable-file? file))
+                             (format #t "restoring shebang on `~a'~%"
+                                     file)
+                             (substitute* file
+                               (("^#!.*/bin/sh")
+                                "#!/bin/sh")
+                               (("^#!.*/bin/env(.*)$" _ args)
+                                (string-append "#!/usr/bin/env"
+                                               args)))))
+                         (find-files dir ".*"))
+               #t))))))
     (home-page "https://www.gnu.org/software/automake/")
     (synopsis "Making GNU standards-compliant Makefiles")
     (description
@@ -331,9 +411,12 @@ Makefile, simplifying the entire process for the developer.")
     (propagated-inputs `(("m4" ,m4)))
     (native-inputs `(("m4" ,m4)
                      ("perl" ,perl)
+                     ;; XXX: this shouldn't be necessary, but without it test
+                     ;; 102 fails because it cannot find ltdl/libltdl.la.
+                     ("libltdl" ,libltdl)
                      ("help2man" ,help2man) ;because we modify ltmain.sh
                      ("automake" ,automake)      ;some tests rely on 'aclocal'
-                     ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
+                     ("autoconf" ,autoconf-wrapper))) ;others on 'autom4te'
 
     (arguments
      `(;; Libltdl is provided as a separate package, so don't install it here.
@@ -341,21 +424,22 @@ Makefile, simplifying the entire process for the developer.")
 
        ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
        ;; <http://hydra.gnu.org/build/181662>.
-       #:tests? ,(not (string-prefix? "mips64"
-                                      (or (%current-target-system)
+       ;; Also, do not run tests when cross compiling
+       #:tests? ,(not (or (%current-target-system)
+                          (string-prefix? "mips64"
                                           (%current-system))))
 
        #:phases
        (modify-phases %standard-phases
          (add-before 'check 'pre-check
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key inputs native-inputs #:allow-other-keys)
              ;; Run the test suite in parallel, if possible.
              (setenv "TESTSUITEFLAGS"
                      (string-append
                       "-j"
                       (number->string (parallel-job-count))))
            ;; Patch references to /bin/sh.
-           (let ((bash (assoc-ref inputs "bash")))
+           (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
              (substitute* "tests/testsuite"
                (("/bin/sh")
                 (string-append bash "/bin/sh")))