gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / autotools.scm
index 7998dea..33e1905 100644 (file)
@@ -1,14 +1,17 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
 ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2015, 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
-;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
-;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Nikita <nikita@n0.is>
+;;; Copyright © 2017, 2019, 2021 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>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (ice-9 match)
   #:export (autoconf-wrapper))
 
-(define-public autoconf
+(define-public autoconf-2.69
   (package
     (name "autoconf")
     (version "2.69")
        (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
@@ -71,6 +105,40 @@ scripts are self-contained and portable, freeing the user from needing to
 know anything about Autoconf or M4.")
     (license gpl3+))) ; some files are under GPLv2+
 
+;; This is the renaissance version, which is not widely supported yet.
+(define-public autoconf-2.71
+  (package
+    (inherit autoconf-2.69)
+    (version "2.71")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://gnu/autoconf/autoconf-"
+                           version ".tar.xz"))
+       (sha256
+        (base32
+         "197sl23irn6s9pd54rxj5vcp5y8dv65jb9yfqgr2g56cxg7q6k7i"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments autoconf-2.69)
+       ((#:tests? _ #f)
+        ;; FIXME: To run the test suite, fix all the instances where scripts
+        ;; generates "#! /bin/sh" shebangs.
+        #f)
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (add-before 'check 'prepare-tests
+             (lambda _
+               (for-each patch-shebang
+                         (append (find-files "tests"
+                                             (lambda (file stat)
+                                               (executable-file? file)))
+                                 (find-files "bin"
+                                             (lambda (file stat)
+                                               (executable-file? file)))))
+               #t))))))))
+
+(define-public autoconf autoconf-2.69)
+
 (define-public autoconf-2.68
   (package (inherit autoconf)
     (version "2.68")
@@ -199,13 +267,15 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
     ;; Do not show it in the UI since it's meant for internal use.
     (properties '((hidden? . #t)))))
 
+;; Only use this package when autoconf is not usable,
+;; see <https://issues.guix.gnu.org/46564#1>.
 (define-public autoconf-wrapper
   (make-autoconf-wrapper autoconf))
 
 (define-public autoconf-archive
   (package
     (name "autoconf-archive")
-    (version "2018.03.13")
+    (version "2021.02.19")
     (source
      (origin
       (method url-fetch)
@@ -213,7 +283,7 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
                           version ".tar.xz"))
       (sha256
        (base32
-        "0ng1lvpijf3kv7w7nb1shqs23vp0398yicyvkf9lsk56kw6zjxb1"))))
+        "1gcwqspcxiygnyk02smsk8ivzs9r69ji38izxzzsijyx52fyp9p8"))))
     (build-system gnu-build-system)
     (home-page "https://www.gnu.org/software/autoconf-archive/")
     (synopsis "Collection of freely reusable Autoconf macros")
@@ -244,23 +314,30 @@ 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.16.1")
+    (version "1.16.2")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/automake/automake-"
                                  version ".tar.xz"))
              (sha256
               (base32
-                "08g979ficj18i1w6w5219bgmns7czr03iadf20mk3lrzl8wbn1ax"))
+                "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)
        ("perl" ,perl)))
@@ -269,7 +346,7 @@ output is indexed in many ways to simplify browsing.")
             (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)
@@ -289,6 +366,37 @@ output is indexed in many ways to simplify browsing.")
                (setenv "CONFIG_SHELL" sh)
                #t)))
 
+           (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))))
+                 '())
+
          ;; 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
@@ -354,21 +462,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")))
@@ -387,6 +496,53 @@ complexity of working with shared libraries across platforms.")
     (license gpl3+)
     (home-page "https://www.gnu.org/software/libtool/")))
 
+(define-public config
+  (let ((revision "1")
+        (commit "c8ddc8472f8efcadafc1ef53ca1d863415fddd5f"))
+    (package
+      (name "config")
+      (version (git-version "0.0.0" revision commit)) ;no release tag
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.savannah.gnu.org/git/config.git/")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0x6ycvkmmhhhag97wsf0pw8n5fvh12rjvrck90rz17my4ys16qwv"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (add-after 'unpack 'patch-/bin/sh
+                      (lambda _
+                        (substitute* "testsuite/config-guess.sh"
+                          (("#!/bin/sh")
+                           (string-append "#!" (which "sh"))))
+                        #t))
+                    (replace 'build
+                      (lambda _
+                        (invoke "make" "manpages")))
+                    (delete 'configure)
+                    (replace 'install
+                      (lambda* (#:key outputs #:allow-other-keys)
+                        (let* ((out (assoc-ref outputs "out"))
+                               (bin (string-append out "/bin"))
+                               (man1 (string-append out "/share/man/man1")))
+                          (install-file "config.guess" bin)
+                          (install-file "config.sub" bin)
+                          (install-file "doc/config.guess.1" man1)
+                          (install-file "doc/config.sub.1" man1)
+                          #t))))))
+      (native-inputs
+       `(("help2man" ,help2man)))
+      (home-page "https://savannah.gnu.org/projects/config")
+      (synopsis "Ubiquitous config.guess and config.sub scripts")
+      (description "The `config.guess' script tries to guess a canonical system triple,
+and `config.sub' validates and canonicalizes.  These are used as part of
+configuration in nearly all GNU packages (and many others).")
+      (license gpl2+))))
+
 (define-public libltdl
   ;; This is a libltdl package separate from the libtool package.  This is
   ;; useful because, unlike libtool, it has zero extra dependencies (making it