gnu: Add enet.
[jackhill/guix/guix.git] / gnu / packages / bash.scm
index 15909c7..bddb830 100644 (file)
@@ -275,46 +275,89 @@ without modification.")
 (define-public bash-completion
   (package
     (name "bash-completion")
-    (version "2.1")
+    (version "2.3")
     (source (origin
               (method url-fetch)
               (uri (string-append
-                    "http://bash-completion.alioth.debian.org/files/"
-                    "bash-completion-" version ".tar.bz2"))
+                    "https://github.com/scop/" name "/releases/download/"
+                    version "/" name "-" version ".tar.xz"))
               (sha256
                (base32
-                "0kxf8s5bw7y50x0ksb77d3kv0dwadixhybl818w27y6mlw26hq1b"))
+                "1sg82nmsr00ig37skln2qvmi8mgbxgdvycm3ygzs8gbz66pq3q5j"))
               (patches
-               (list (search-patch "bash-completion-directories.patch")))))
+               (search-patches "bash-completion-directories.patch"))))
     (build-system gnu-build-system)
     (native-inputs `(("util-linux" ,util-linux)))
     (arguments
-     `(#:phases (alist-cons-after
-                 'install 'remove-redundant-completions
-                 (lambda* (#:key inputs outputs #:allow-other-keys)
-                   ;; Util-linux comes with a bunch of completion files for
-                   ;; its own commands which are more sophisticated and
-                   ;; up-to-date than those of bash-completion.  Remove those
-                   ;; from bash-completion.
-                   (let* ((out         (assoc-ref outputs "out"))
-                          (util-linux  (assoc-ref inputs "util-linux"))
-                          (completions (string-append out
-                                                      "/share/bash-completion"
-                                                      "/completions"))
-                          (already     (find-files
-                                        (string-append
-                                         util-linux
-                                         "/etc/bash_completion.d"))))
-                     (with-directory-excursion completions
-                       (for-each (lambda (file)
-                                   (when (file-exists? file)
-                                     (delete-file file)))
-                                 (map basename already)))
-                     #t))
-                 %standard-phases)))
+     `(#:phases (modify-phases %standard-phases
+                  (add-after
+                   'install 'remove-redundant-completions
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     ;; Util-linux comes with a bunch of completion files for
+                     ;; its own commands which are more sophisticated and
+                     ;; up-to-date than those of bash-completion.  Remove those
+                     ;; from bash-completion.
+                     (let* ((out         (assoc-ref outputs "out"))
+                            (util-linux  (assoc-ref inputs "util-linux"))
+                            (completions (string-append out
+                                                        "/share/bash-completion"
+                                                        "/completions"))
+                            (already     (find-files
+                                          (string-append
+                                           util-linux
+                                           "/etc/bash_completion.d"))))
+                       (with-directory-excursion completions
+                         (for-each (lambda (file)
+                                     (when (file-exists? file)
+                                       (delete-file file)))
+                                   (map basename already)))
+                       #t))))))
     (synopsis "Bash completions for common commands")
     (description
      "This package provides extensions that allow Bash to provide adapted
 completion for many common commands.")
     (home-page "http://bash-completion.alioth.debian.org/")
     (license gpl2+)))
+
+(define-public bash-tap
+  (package
+    (name "bash-tap")
+    (version "1.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/illusori/bash-tap/"
+                                  "archive/" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0qs1qi38bl3ns4mpagcawv618dsk2q1lgrbddgvs0wl3ia12cyz5"))))
+    ;; There is no compilation process to use this package, however, the bash
+    ;; scripts installed by this package start with "#!/bin/bash".  To fix
+    ;; these lines, we use the patch-shebangs of the GNU build system.  The
+    ;; project does not use a Makefile.
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; There is no test suite.
+       #:phases
+       (modify-phases %standard-phases
+         ;; Because there are no configure scripts or Makefile, we can
+         ;; remove these phases.
+         (delete 'configure)
+         (delete 'build)
+         ;; The installation involves manually copying the files to a location.
+         ;; To make them easily accessible by setting PATH, we add the scripts
+         ;; to the "bin" folder.
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+               (install-file "bash-tap" bin)
+               (install-file "bash-tap-bootstrap" bin)
+               (install-file "bash-tap-mock" bin)))))))
+    (home-page "http://www.illusori.co.uk/projects/bash-tap/")
+    (synopsis "Bash port of a Test::More/Test::Builder-style TAP-compliant
+test library")
+    (description "Bash TAP is a TAP-compliant Test::More-style testing library
+for Bash shell scripts and functions.  Along with the Test::More-style testing
+helpers it provides helper functions for mocking commands and in-process output
+capturing.")
+    (license expat)))