guix/gnu/packages/bash.scm

417 lines
18 KiB
Scheme
Raw Normal View History

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages bash)
#:use-module (guix licenses)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages bootstrap)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages readline)
#:use-module (gnu packages bison)
#:use-module (gnu packages linux)
#:use-module (gnu packages guile)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix gexp)
#:use-module (guix monads)
#:use-module (guix store)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:autoload (guix gnupg) (gnupg-verify*)
#:autoload (guix base32) (bytevector->nix-base32-string)
;; See <https://bugs.gnu.org/41457> for why not #:autoload here.
#:use-module ((gcrypt hash) #:select (port-sha256))
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 format))
(define (patch-url seqno)
"Return the URL of Bash patch number SEQNO."
(format #f "mirror://gnu/bash/bash-5.0-patches/bash50-~3,'0d" seqno))
(define (bash-patch seqno sha256-bv)
"Return the origin of Bash patch SEQNO, with expected hash SHA256-BV."
(origin
(method url-fetch)
(uri (patch-url seqno))
(sha256 sha256-bv)))
(define-syntax-rule (patch-series (seqno hash) ...)
(list (bash-patch seqno (base32 hash))
...))
(define %patch-series-5.0
;; This is the current patches series for 5.0, generated using
;; 'download-patches' below.
(patch-series
(1 "12bjfdy6bg8nhyw27bdgxn7h4paylx8d927skfmi9pxd1wgrxzpj")
(2 "01w7yrzmz10mw06ys0546vhl7isv2v402ziyvfd7k67588spvs47")
(3 "0ny81ridp5n0j69hb8ixrc7dmxybby54jbsz5hikly8kgg1wvssf")
(4 "021gqqvgydixkrmqss64b6srfdlkvnx88lyfzpxfrn5d6bc7li0l")
(5 "0xl2kyzm84nlyklrqzkn73ixabhzfhn9x91lzcmis89cppclvxav")
(6 "0844749ixk1z60437nkznzms1f0nzh9an62kj7sny6r0zyk2k1fn")
(7 "16xg37gp1b8zlj5969w8mcrparwqlcbj9695vn3qhgb7wdz1xd0p")
(8 "1qyp19krjh8zxvb0jgwmyjz40djslwcf4xi7kc1ab0iaca44bipf")
(9 "00yrjjqd95s81b21qq3ba1y7h879q8jaajlkjggc6grhcwbs4g7d")
(10 "04ca5bjv456v538mkspzvn4xb2zdphh31r4fpvfm9p5my0jw7yyn")
(11 "1sklyixvsv8993kxzs0jigacpdchjrq7jv5xpdx7kbqyp4rf6k9c")
(12 "0cz21qg2gbr40lfgza7g02bqi2qknwqgxnq459pjj640d0cywhr9")
(13 "16h9nwz3yzwj7fnxvlidjymdc4yr30h818433gh9j1x3in6igmzm")
(14 "12gm5bvv2pd3m72z2ilj26pa08c61az253dsgfl24vpf2ijywvjx")
(15 "0pm0px758w4i23s55wajcv6lqfiym7zgxvq0pxf6vclkv8nxy5x5")
(16 "0vdha332km2iwx8g2ld15jy7d24cbplzgr1531dpzylr9ajxglgz")))
(define (download-patches store count)
"Download COUNT Bash patches into store. Return a list of
number/base32-hash tuples, directly usable in the 'patch-series' form."
(unfold (cut > <> count)
(lambda (number)
(let* ((patch (download-to-store store (patch-url number)))
(sig (download-to-store store
(string-append (patch-url number)
".sig"))))
(unless (eq? 'valid-signature (gnupg-verify* sig patch))
(error "failed to verify signature" patch))
(list number
(bytevector->nix-base32-string
(call-with-input-file patch port-sha256)))))
1+
1))
(define-public bash
(let* ((cppflags (string-join '("-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
"-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
"-DNON_INTERACTIVE_LOGIN_SHELLS"
"-DSSH_SOURCE_BASHRC")
" "))
(configure-flags
``("--with-installed-readline"
,,(string-append "CPPFLAGS=" cppflags)
,(string-append
"LDFLAGS=-Wl,-rpath -Wl,"
(assoc-ref %build-inputs "readline")
"/lib"
" -Wl,-rpath -Wl,"
(assoc-ref %build-inputs "ncurses")
"/lib")))
(version "5.0"))
(package
(name "bash")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://gnu/bash/bash-" version ".tar.gz"))
(sha256
(base32
"0kgvfwqdcd90waczf4gx39xnrxzijhjrzyzv7s8v4w31qqm0za5l"))
(patch-flags '("-p0"))
(patches (cons (search-patch "bash-linux-pgrp-pipe.patch")
%patch-series-5.0))))
(version (string-append version "." (number->string (length %patch-series-5.0))))
(build-system gnu-build-system)
(outputs '("out"
"doc" ;1.7 MiB of HTML and extra files
"include")) ;headers used by extensions
(inputs `(("readline" ,readline)
("ncurses" ,ncurses))) ;TODO: add texinfo
(arguments
`(;; When cross-compiling, `configure' incorrectly guesses that job
;; control is missing.
#:configure-flags ,(if (%current-target-system)
`(cons* "bash_cv_job_control_missing=no"
,configure-flags)
configure-flags)
;; Bash is reportedly not parallel-safe. See, for instance,
;; <http://patches.openembedded.org/patch/32745/> and
;; <http://git.buildroot.net/buildroot/commit/?h=79e2d802a>.
#:parallel-build? #f
#:parallel-tests? #f
;; XXX: The tests have a lot of hard-coded paths, so disable them
;; for now.
#:tests? #f
#:modules ((srfi srfi-26)
(guix build utils)
(guix build gnu-build-system))
#:phases
(modify-phases %standard-phases
(add-after 'install 'install-sh-symlink
(lambda* (#:key outputs #:allow-other-keys)
;; Add a `sh' -> `bash' link.
(let ((out (assoc-ref outputs "out")))
(with-directory-excursion (string-append out "/bin")
(symlink "bash" "sh")
#t))))
(add-after 'install 'move-development-files
(lambda* (#:key outputs #:allow-other-keys)
;; Move 'Makefile.inc' and 'bash.pc' to "include" to avoid
;; circular references among the outputs.
(let ((out (assoc-ref outputs "out"))
(include (assoc-ref outputs "include"))
(lib (cut string-append <> "/lib/bash")))
(mkdir-p (lib include))
(rename-file (string-append (lib out)
"/Makefile.inc")
(string-append (lib include)
"/Makefile.inc"))
(rename-file (string-append out "/lib/pkgconfig")
(string-append include
"/lib/pkgconfig"))
;; Don't capture the absolute file name of 'install' to avoid
;; retaining a dependency on Coreutils.
(substitute* (string-append (lib include)
"/Makefile.inc")
(("^INSTALL =.*")
"INSTALL = install -c\n"))
#t))))))
(native-search-paths
(list (search-path-specification ;new in 4.4
(variable "BASH_LOADABLES_PATH")
(files '("lib/bash")))))
gnu: Use synopses from the Womb. * gnu/packages/algebra.scm, gnu/packages/aspell.scm, gnu/packages/autotools.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/bison.scm, gnu/packages/cdrom.scm, gnu/packages/cflow.scm, gnu/packages/compression.scm, gnu/packages/cpio.scm, gnu/packages/cppi.scm, gnu/packages/ddrescue.scm, gnu/packages/dejagnu.scm, gnu/packages/ed.scm, gnu/packages/emacs.scm, gnu/packages/fdisk.scm, gnu/packages/gawk.scm, gnu/packages/gcc.scm, packages/gcc.scm, b/gnu/packages/gcc.scm, 4b982 100644 s/gcc.scm, s/gcc.scm, @@ %standard-phases))))) `((gcc-libc . ,(assoc-ref inputs "libc")))) The GNU Compiler Collection") GNU Compiler Collection") n ompiler Collection includes compiler front ends for C, C++, tran, OpenMP for C/C++/Fortran, Java, and Ada, as well as gnu/packages/gdb.scm, gnu/packages/gettext.scm, gnu/packages/ghostscript.scm, gnu/packages/glib.scm, gnu/packages/global.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gperf.scm, gnu/packages/gprolog.scm, gnu/packages/groff.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/guile.scm, gnu/packages/help2man.scm, gnu/packages/idutils.scm, gnu/packages/indent.scm, gnu/packages/less.scm, gnu/packages/libidn.scm, gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm, gnu/packages/linux.scm, gnu/packages/lsh.scm, gnu/packages/m4.scm, gnu/packages/mailutils.scm, gnu/packages/multiprecision.scm, gnu/packages/nano.scm, gnu/packages/ncurses.scm, gnu/packages/nettle.scm, gnu/packages/oggvorbis.scm, gnu/packages/parted.scm, gnu/packages/pth.scm, gnu/packages/readline.scm, gnu/packages/recutils.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/shishi.scm, gnu/packages/smalltalk.scm, gnu/packages/system.scm, gnu/packages/texinfo.scm, gnu/packages/time.scm, gnu/packages/wdiff.scm, gnu/packages/wget.scm, gnu/packages/which.scm: Use synopses from the Womb.
2013-04-17 16:04:25 +00:00
(synopsis "The GNU Bourne-Again SHell")
(description
"Bash is the shell, or command-line interpreter, of the GNU system. It
Synchronize package descriptions with the Womb. * gnu/packages/algebra.scm, gnu/packages/aspell.scm, gnu/packages/autotools.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/bison.scm, gnu/packages/cdrom.scm, gnu/packages/cflow.scm, gnu/packages/compression.scm, gnu/packages/cpio.scm, gnu/packages/cppi.scm, gnu/packages/ddrescue.scm, gnu/packages/dejagnu.scm, gnu/packages/ed.scm, gnu/packages/emacs.scm, gnu/packages/fdisk.scm, gnu/packages/freeipmi.scm, gnu/packages/gawk.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/gdb.scm, gnu/packages/gdbm.scm, gnu/packages/gettext.scm, gnu/packages/ghostscript.scm, gnu/packages/global.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gperf.scm, gnu/packages/gprolog.scm, gnu/packages/groff.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/guile.scm, gnu/packages/gv.scm, gnu/packages/help2man.scm, gnu/packages/idutils.scm, gnu/packages/indent.scm, gnu/packages/less.scm, gnu/packages/libidn.scm, gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm, gnu/packages/lightning.scm, gnu/packages/linux.scm, gnu/packages/lsh.scm, gnu/packages/m4.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/multiprecision.scm, gnu/packages/nano.scm, gnu/packages/ncurses.scm, gnu/packages/nettle.scm, gnu/packages/ocrad.scm, gnu/packages/oggvorbis.scm, gnu/packages/parted.scm, gnu/packages/plotutils.scm, gnu/packages/pth.scm, gnu/packages/readline.scm, gnu/packages/recutils.scm, gnu/packages/rush.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/shishi.scm, gnu/packages/smalltalk.scm, gnu/packages/system.scm, gnu/packages/texinfo.scm, gnu/packages/time.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/wdiff.scm, gnu/packages/wget.scm, gnu/packages/which.scm, gnu/packages/xnee.scm, gnu/packages/zile.scm: Change value of the 'description' field to that of the Womb.
2013-10-09 14:14:23 +00:00
is compatible with the Bourne Shell, but it also integrates useful features
from the Korn Shell and the C Shell and new improvements of its own. It
allows command-line editing, unlimited command history, shell functions and
Synchronize package descriptions with the Womb. * gnu/packages/algebra.scm, gnu/packages/aspell.scm, gnu/packages/autotools.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/bison.scm, gnu/packages/cdrom.scm, gnu/packages/cflow.scm, gnu/packages/compression.scm, gnu/packages/cpio.scm, gnu/packages/cppi.scm, gnu/packages/ddrescue.scm, gnu/packages/dejagnu.scm, gnu/packages/ed.scm, gnu/packages/emacs.scm, gnu/packages/fdisk.scm, gnu/packages/freeipmi.scm, gnu/packages/gawk.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/gdb.scm, gnu/packages/gdbm.scm, gnu/packages/gettext.scm, gnu/packages/ghostscript.scm, gnu/packages/global.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gperf.scm, gnu/packages/gprolog.scm, gnu/packages/groff.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/guile.scm, gnu/packages/gv.scm, gnu/packages/help2man.scm, gnu/packages/idutils.scm, gnu/packages/indent.scm, gnu/packages/less.scm, gnu/packages/libidn.scm, gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm, gnu/packages/lightning.scm, gnu/packages/linux.scm, gnu/packages/lsh.scm, gnu/packages/m4.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/multiprecision.scm, gnu/packages/nano.scm, gnu/packages/ncurses.scm, gnu/packages/nettle.scm, gnu/packages/ocrad.scm, gnu/packages/oggvorbis.scm, gnu/packages/parted.scm, gnu/packages/plotutils.scm, gnu/packages/pth.scm, gnu/packages/readline.scm, gnu/packages/recutils.scm, gnu/packages/rush.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/shishi.scm, gnu/packages/smalltalk.scm, gnu/packages/system.scm, gnu/packages/texinfo.scm, gnu/packages/time.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/wdiff.scm, gnu/packages/wget.scm, gnu/packages/which.scm, gnu/packages/xnee.scm, gnu/packages/zile.scm: Change value of the 'description' field to that of the Womb.
2013-10-09 14:14:23 +00:00
aliases, and job control while still allowing most sh scripts to be run
without modification.")
(license gpl3+)
(home-page "https://www.gnu.org/software/bash/"))))
(define-public bash-minimal
;; A stripped-down Bash for non-interactive use.
(package (inherit bash)
(name "bash-minimal")
(inputs '()) ; no readline, no curses
;; No "include" output because there's no support for loadable modules.
(outputs (delete "include" (package-outputs bash)))
(arguments
(substitute-keyword-arguments (package-arguments bash)
((#:modules _ '())
'((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(srfi srfi-26)))
((#:configure-flags flags '())
`(list "--without-bash-malloc"
"--disable-readline"
"--disable-history"
"--disable-help-builtin"
"--disable-progcomp"
"--disable-net-redirections"
"--disable-nls"
;; Pretend 'dlopen' is missing so we don't build loadable
;; modules and related code.
"ac_cv_func_dlopen=no"
,@(if (%current-target-system)
'("bash_cv_job_control_missing=no"
"bash_cv_getcwd_malloc=yes")
'())))
((#:phases phases)
`(modify-phases ,phases
;; No loadable modules.
(delete 'move-development-files)))))))
(define-public static-bash
;; Statically-linked Bash that contains nothing but the 'bash' binary and
;; 'sh' symlink, without any reference.
(let ((bash (static-package bash-minimal)))
(package
(inherit bash)
(name "bash-static")
(arguments
(substitute-keyword-arguments
`(#:allowed-references ("out") ,@(package-arguments bash))
((#:phases phases)
`(modify-phases ,phases
(add-after 'strip 'remove-everything-but-the-binary
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(remove-store-references (string-append bin "/bash"))
(delete-file (string-append bin "/bashbug"))
(delete-file-recursively (string-append out "/share"))
#t))))))))))
(define-public bash-completion
(package
(name "bash-completion")
(version "2.8")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/scop/" name "/releases/download/"
version "/" name "-" version ".tar.xz"))
(sha256
(base32
"0kgmflrr1ga9wfk770vmakna3nj46ylb5ky9ipd0v2k9ymq5a7y0"))
(patches
gnu: packages: Use 'search-patches' everywhere. * gnu/packages/abiword.scm: Use 'search-patches' for 'patches' field. * gnu/packages/acl.scm: Likewise. * gnu/packages/admin.scm: Likewise. * gnu/packages/algebra.scm: Likewise. * gnu/packages/animation.scm: Likewise. * gnu/packages/apr.scm: Likewise. * gnu/packages/audacity.scm: Likewise. * gnu/packages/audio.scm: Likewise. * gnu/packages/autotools.scm: Likewise. * gnu/packages/avahi.scm: Likewise. * gnu/packages/backup.scm: Likewise. * gnu/packages/base.scm: Likewise. * gnu/packages/bash.scm: Likewise. * gnu/packages/bioinformatics.scm: Likewise. * gnu/packages/cdrom.scm: Likewise. * gnu/packages/ci.scm: Likewise. * gnu/packages/cmake.scm: Likewise. * gnu/packages/cpio.scm: Likewise. * gnu/packages/cross-base.scm: Likewise. * gnu/packages/dico.scm: Likewise. * gnu/packages/doxygen.scm: Likewise. * gnu/packages/ebook.scm: Likewise. * gnu/packages/elf.scm: Likewise. * gnu/packages/emacs.scm: Likewise. * gnu/packages/engineering.scm: Likewise. * gnu/packages/firmware.scm: Likewise. * gnu/packages/flashing-tools.scm: Likewise. * gnu/packages/fltk.scm: Likewise. * gnu/packages/ftp.scm: Likewise. * gnu/packages/games.scm: Likewise. * gnu/packages/gawk.scm: Likewise. * gnu/packages/gcc.scm: Likewise. * gnu/packages/gd.scm: Likewise. * gnu/packages/ghostscript.scm: Likewise. * gnu/packages/glib.scm: Likewise. * gnu/packages/gnome.scm: Likewise. * gnu/packages/gnucash.scm: Likewise. * gnu/packages/gnunet.scm: Likewise. * gnu/packages/gnupg.scm: Likewise. * gnu/packages/gnuzilla.scm: Likewise. * gnu/packages/graphics.scm: Likewise. * gnu/packages/grub.scm: Likewise. * gnu/packages/gtk.scm: Likewise. * gnu/packages/guile.scm: Likewise. * gnu/packages/icu4c.scm: Likewise. * gnu/packages/idutils.scm: Likewise. * gnu/packages/image.scm: Likewise. * gnu/packages/imagemagick.scm: Likewise. * gnu/packages/irc.scm: Likewise. * gnu/packages/ldc.scm: Likewise. * gnu/packages/libcanberra.scm: Likewise. * gnu/packages/libevent.scm: Likewise. * gnu/packages/libreoffice.scm: Likewise. * gnu/packages/libunwind.scm: Likewise. * gnu/packages/libusb.scm: Likewise. * gnu/packages/linux.scm: Likewise. * gnu/packages/lirc.scm: Likewise. * gnu/packages/llvm.scm: Likewise. * gnu/packages/lsh.scm: Likewise. * gnu/packages/lua.scm: Likewise. * gnu/packages/lxqt.scm: Likewise. * gnu/packages/mail.scm: Likewise. * gnu/packages/maths.scm: Likewise. * gnu/packages/mcrypt.scm: Likewise. * gnu/packages/messaging.scm: Likewise. * gnu/packages/mit-krb5.scm: Likewise. * gnu/packages/mp3.scm: Likewise. * gnu/packages/multiprecision.scm: Likewise. * gnu/packages/music.scm: Likewise. * gnu/packages/ninja.scm: Likewise. * gnu/packages/nvi.scm: Likewise. * gnu/packages/ocaml.scm: Likewise. * gnu/packages/orpheus.scm: Likewise. * gnu/packages/ots.scm: Likewise. * gnu/packages/parallel.scm: Likewise. * gnu/packages/patchutils.scm: Likewise. * gnu/packages/pcre.scm: Likewise. * gnu/packages/pdf.scm: Likewise. * gnu/packages/perl.scm: Likewise. * gnu/packages/plotutils.scm: Likewise. * gnu/packages/polkit.scm: Likewise. * gnu/packages/pulseaudio.scm: Likewise. * gnu/packages/python.scm: Likewise. * gnu/packages/qemu.scm: Likewise. * gnu/packages/qt.scm: Likewise. * gnu/packages/ratpoison.scm: Likewise. * gnu/packages/rdf.scm: Likewise. * gnu/packages/readline.scm: Likewise. * gnu/packages/rush.scm: Likewise. * gnu/packages/scheme.scm: Likewise. * gnu/packages/screen.scm: Likewise. * gnu/packages/sdl.scm: Likewise. * gnu/packages/slim.scm: Likewise. * gnu/packages/ssh.scm: Likewise. * gnu/packages/tcl.scm: Likewise. * gnu/packages/tcsh.scm: Likewise. * gnu/packages/texinfo.scm: Likewise. * gnu/packages/tls.scm: Likewise. * gnu/packages/tor.scm: Likewise. * gnu/packages/tv.scm: Likewise. * gnu/packages/valgrind.scm: Likewise. * gnu/packages/version-control.scm: Likewise. * gnu/packages/video.scm: Likewise. * gnu/packages/vpn.scm: Likewise. * gnu/packages/vtk.scm: Likewise. * gnu/packages/w3m.scm: Likewise. * gnu/packages/web.scm: Likewise. * gnu/packages/wicd.scm: Likewise. * gnu/packages/wm.scm: Likewise. * gnu/packages/xdisorg.scm: Likewise. * gnu/packages/xfce.scm: Likewise. * gnu/packages/xiph.scm: Likewise. * gnu/packages/xml.scm: Likewise. * gnu/packages/xorg.scm: Likewise. * gnu/packages/zip.scm: Likewise.
2016-04-08 12:18:13 +00:00
(search-patches "bash-completion-directories.patch"))))
(build-system gnu-build-system)
(native-inputs `(("util-linux" ,util-linux)))
(arguments
`(#:phases (modify-phases %standard-phases
(add-after
'install 'remove-redundant-completions
(lambda* (#:key
inputs native-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 (or native-inputs 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 "https://github.com/scop/bash-completion")
(license gpl2+)))
(define-public bash-tap
(package
(name "bash-tap")
(version "1.0.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/illusori/bash-tap.git")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "13zz9h6bhhnk3hiwhlpafrnf2isws249h3fz785dcgymk02arz9c"))))
;; 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 "https://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)))
(define-public bats
(package
(name "bats")
(version "1.2.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/bats-core/bats-core.git")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0f59zh4d4pa1a7ybs5zl6h0csbqqv11lbnq0jl1dgwm1s6p49bsq"))))
(inputs
`(("bash" ,bash)
("coreutils" ,coreutils)
("guile" ,guile-3.0) ;for wrap-script
("grep" ,grep)))
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(copy-recursively (assoc-ref %build-inputs "source") ".")
(setenv "PATH"
(string-append (assoc-ref %build-inputs "bash") "/bin"
":" (assoc-ref %build-inputs "coreutils") "/bin"
":" (assoc-ref %build-inputs "grep") "/bin"
":" (assoc-ref %build-inputs "guile") "/bin"
":" (getenv "PATH")))
(for-each (lambda (file) (patch-shebang file)) (find-files "."))
(substitute* "bin/bats"
(("export BATS_ROOT" line)
(string-append "BATS_ROOT=\"${BATS_ROOT:-" %output "/libexec/bats-core}\"\n"
line)))
;; Install phase
(invoke "./install.sh" %output)
(wrap-script (string-append %output "/bin/bats")
(list "PATH" 'prefix (string-split (getenv "PATH")
#\:))))))
(build-system trivial-build-system)
(home-page "https://github.com/bats-core/bats-core/")
(synopsis "Bash Automated Testing System")
(description "Bats is a TAP-compliant testing framework for Bash. It
provides a simple way to verify that the UNIX programs you write behave as
expected. Bats is most useful when testing software written in Bash, but you
can use it to test any UNIX program.")
(license expat)))