| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 |
|
| 30 | (define-module (gnu packages bash)
|
| 31 | #:use-module ((guix licenses) #:prefix license:)
|
| 32 | #:use-module (gnu packages)
|
| 33 | #:use-module (gnu packages autotools)
|
| 34 | #:use-module (gnu packages base)
|
| 35 | #:use-module (gnu packages bootstrap)
|
| 36 | #:use-module (gnu packages compression)
|
| 37 | #:use-module (gnu packages elf)
|
| 38 | #:use-module (gnu packages ncurses)
|
| 39 | #:use-module (gnu packages readline)
|
| 40 | #:use-module (gnu packages bison)
|
| 41 | #:use-module (gnu packages linux)
|
| 42 | #:use-module (gnu packages libffi)
|
| 43 | #:use-module (gnu packages pkg-config)
|
| 44 | #:use-module (gnu packages guile)
|
| 45 | #:use-module (gnu packages version-control)
|
| 46 | #:use-module (gnu packages less)
|
| 47 | #:use-module (guix packages)
|
| 48 | #:use-module (guix download)
|
| 49 | #:use-module (guix git-download)
|
| 50 | #:use-module (guix utils)
|
| 51 | #:use-module (guix gexp)
|
| 52 | #:use-module (guix monads)
|
| 53 | #:use-module (guix store)
|
| 54 | #:use-module (guix build-system copy)
|
| 55 | #:use-module (guix build-system gnu)
|
| 56 | #:use-module (guix build-system trivial)
|
| 57 | #:autoload (guix gnupg) (gnupg-verify*)
|
| 58 | #:autoload (guix base32) (bytevector->nix-base32-string)
|
| 59 |
|
| 60 | |
| 61 | #:use-module ((gcrypt hash) #:select (port-sha256))
|
| 62 |
|
| 63 | #:use-module (srfi srfi-1)
|
| 64 | #:use-module (srfi srfi-26)
|
| 65 | #:use-module (ice-9 format))
|
| 66 |
|
| 67 | (define (patch-url seqno)
|
| 68 | "Return the URL of Bash patch number SEQNO."
|
| 69 | (format #f "mirror://gnu/bash/bash-5.2-patches/bash52-~3,'0d" seqno))
|
| 70 |
|
| 71 | (define (bash-patch seqno sha256-bv)
|
| 72 | "Return the origin of Bash patch SEQNO, with expected hash SHA256-BV."
|
| 73 | (origin
|
| 74 | (method url-fetch)
|
| 75 | (uri (patch-url seqno))
|
| 76 | (sha256 sha256-bv)))
|
| 77 |
|
| 78 | (define-syntax-rule (patch-series (seqno hash) ...)
|
| 79 | (list (bash-patch seqno (base32 hash))
|
| 80 | ...))
|
| 81 |
|
| 82 | (define %patch-series-5.2
|
| 83 | |
| 84 | |
| 85 | (patch-series
|
| 86 | (1 "02iibpd3jq8p1bhdzgik8ps6gi1145vr463a82gj1hivjbp2ybzl")
|
| 87 | (2 "1f6p1z85qh1lavdp3xikgp0bfv0vqhvgpgwmdzlywl35hwdmxk25")
|
| 88 | (3 "1zxsi869jd90hksx3nyypgyqwrxhw2ws3r6hmk76yc1lsgdhq2ba")
|
| 89 | (4 "04i5liw5cg6dqkdxfgazqc2jrw40bmclx3dx45bwy259pcj7g0iq")
|
| 90 | (5 "0mykflv9qnbx3jz71l4f7isadiw9knm4qimqkwsv9cv88dafpq7c")
|
| 91 | (6 "13265akl8w6zyrg0l7f0x6arjgqjhllcwl6lk46rl53x4mm5dq6i")
|
| 92 | (7 "146lrwkn5wgxzs6vx34wl47g69zsxdy032k40qzi626b47ya6015")
|
| 93 | (8 "1s5i8hcayrv25lc8fxcr431v634yx5sii53b8fmip789s0pxjjvb")
|
| 94 | (9 "1kfk25151ka9wkmk1myf12irgcmvhsd8b0nfifvhrszah9w82npr")
|
| 95 | (10 "1kf1jrwm30js0v3d1r2rk4x09s1pyjp70wnd1qqhf9bmkw15ww67")
|
| 96 | (11 "1x5nkvbj6hci7gx42q7qa72hg2a9wwxh85dk79gn521ypwjmy6w3")
|
| 97 | (12 "0b6lcwzm7v5bzjiwaz2c8n5aj77w8ckhp2vwk4v3zsdq3z70gc9g")
|
| 98 | (13 "1rkwpibd6j2ghppfhqsva2jm4kdni6b7jpdsxdps52643gc4yjq9")
|
| 99 | (14 "09766vqqw4ffnmysm725v35qkhp1g9j4qgqag941xvq655pj9y9y")
|
| 100 | (15 "12im449abnq5gaqjmdxr5i38kmp02fa8l8wffad3jryvd58r0wzg")
|
| 101 | (16 "05arb0hzmng03cr357lf6p8af0x2a1pznsd3psll03nibfy56n0m")
|
| 102 | (17 "129cvx4gfz8n23iw1lhbknbw86fyw6vh60jqj1wj3d5pr75wwj0w")
|
| 103 | (18 "105am94qxjc27gga4a8asvsi01090xwjfim3s16lafwjvm4xsha6")
|
| 104 | (19 "10njgv5mrc5rhsp5lvxcbm0pnzn59a8spi2nhdasifyl1a32cp1j")
|
| 105 | (20 "07f0wlmqjdfarp44w3gj9gdqbqm5x20rvlhpn34ngklmxcm2bz5n")
|
| 106 | (21 "1kahfqqalcwi4m73pg3ssz6lh0kcqsqax09myac7a15d2y0vhd43")
|
| 107 | (22 "0w74aym0g1fh48864a3qxh89f26iaq7wsbg7244c6kjr94527dbq")
|
| 108 | (23 "1lywjqbc36j5pdzfcvnz1zy30j76aqmsm190p888av0hw815b45g")
|
| 109 | (24 "1hq23djqbr7s9y2324jq9mxr5bwdkmgizn3zgpchbsqp054k85cp")
|
| 110 | (25 "0x9hc4silzl4d3zw4p43i5dm7w86k50j47f87lracwfgwy3z8f2i")
|
| 111 | (26 "1b1fhm1dsi67r8ip17s0xvx2qq31fsxc1g9n3r931dd0k9a1zvln")
|
| 112 | (27 "0fdbhvs9dkf4knncifh98a76q4gylhyvfrffq5p9q3ag5q58jap1")
|
| 113 | (28 "1hdacd6sssjshmry1sscdnxxfb2r51bvdyghlfjaqgc9l85phhk0")
|
| 114 | (29 "11wrlb20w6v89b96krg0gwxipwhvrda6rq1y9f972m32gsrsqp0j")
|
| 115 | (30 "13v9fqgim082dmvkslsr0hs793yzhsij2s91mjswsfhj1qip7zy3")
|
| 116 | (31 "15d7rddj6spwc1fy997lxx6zvzq0zbxgf2h20mhi4wgp5nzbglf2")
|
| 117 | (32 "05ia6yf32hjprmyyxqawhgckxs3684ikfx8xg08zfgx9xkd7g73v")
|
| 118 | (33 "1qm2aad9mf2xah6xwchga7s5pk3v308mrv9lgh50d65d236ccgh1")
|
| 119 | (34 "0bi38dhkkwpm2qrzp8zpykglq6gibvv2n9f8m59gwj406cxvp7w9")
|
| 120 | (35 "1r8k34y82v02yfkgws17j7i53ybb74dqnwl2jjiv0av9z93hl6l2")
|
| 121 | (36 "0mwhr9hfbh2czf8klbxg6nbd2g9xl9kygvgk061vird56r4kzj8m")
|
| 122 | (37 "156sbi3srzkyxajkmhb7iigq0j4nvwnpsbw88xdsxn95a4xiqb4a")))
|
| 123 |
|
| 124 | (define (download-patches store count)
|
| 125 | "Download COUNT Bash patches into store. Return a list of
|
| 126 | number/base32-hash tuples, directly usable in the 'patch-series' form."
|
| 127 | (unfold (cut > <> count)
|
| 128 | (lambda (number)
|
| 129 | (let* ((patch (download-to-store store (patch-url number)))
|
| 130 | (sig (download-to-store store
|
| 131 | (string-append (patch-url number)
|
| 132 | ".sig"))))
|
| 133 | (unless (eq? 'valid-signature (gnupg-verify* sig patch))
|
| 134 | (error "failed to verify signature" patch))
|
| 135 |
|
| 136 | (list number
|
| 137 | (bytevector->nix-base32-string
|
| 138 | (call-with-input-file patch port-sha256)))))
|
| 139 | 1+
|
| 140 | 1))
|
| 141 |
|
| 142 | (define-public bash
|
| 143 | (let* ((cppflags (string-join '("-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
|
| 144 | "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
|
| 145 | "-DNON_INTERACTIVE_LOGIN_SHELLS"
|
| 146 | "-DSSH_SOURCE_BASHRC"
|
| 147 | "-DSYS_BASHRC='\"/etc/bashrc\"'")
|
| 148 | " "))
|
| 149 | (configure-flags
|
| 150 | ``("--without-bash-malloc"
|
| 151 | "--with-installed-readline"
|
| 152 | ,,(string-append "CPPFLAGS=" cppflags)
|
| 153 | ,(string-append
|
| 154 | "LDFLAGS=-Wl,-rpath -Wl,"
|
| 155 | (assoc-ref %build-inputs "readline")
|
| 156 | "/lib"
|
| 157 | " -Wl,-rpath -Wl,"
|
| 158 | (assoc-ref %build-inputs "ncurses")
|
| 159 | "/lib")))
|
| 160 | (version "5.2"))
|
| 161 | (package
|
| 162 | (name "bash")
|
| 163 | (source (origin
|
| 164 | (method url-fetch)
|
| 165 | (uri (string-append
|
| 166 | "mirror://gnu/bash/bash-" version ".tar.gz"))
|
| 167 | (sha256
|
| 168 | (base32
|
| 169 | "1yrjmf0mqg2q8pqphjlark0mcmgf88b0acq7bqf4gx3zvxkc2fd1"))
|
| 170 | (patch-flags '("-p0"))
|
| 171 | (patches (cons (search-patch "bash-linux-pgrp-pipe.patch")
|
| 172 | %patch-series-5.2))))
|
| 173 | (version (string-append version "." (number->string (length %patch-series-5.2))))
|
| 174 | (build-system gnu-build-system)
|
| 175 |
|
| 176 | (outputs '("out"
|
| 177 | "doc" |
| 178 | "include")) |
| 179 | (native-inputs (if (target-loongarch64?)
|
| 180 | (list config)
|
| 181 | '()))
|
| 182 | (inputs (list readline ncurses)) |
| 183 | (arguments
|
| 184 | `( |
| 185 | |
| 186 | #:configure-flags ,(if (%current-target-system)
|
| 187 | `(cons* "bash_cv_job_control_missing=no"
|
| 188 | ,configure-flags)
|
| 189 | configure-flags)
|
| 190 |
|
| 191 | |
| 192 | |
| 193 | |
| 194 | #:parallel-build? #f
|
| 195 | #:parallel-tests? #f
|
| 196 |
|
| 197 | |
| 198 | |
| 199 | #:tests? #f
|
| 200 |
|
| 201 | #:modules ((srfi srfi-26)
|
| 202 | (guix build utils)
|
| 203 | (guix build gnu-build-system))
|
| 204 |
|
| 205 | #:phases
|
| 206 | (modify-phases %standard-phases
|
| 207 | ,@(if (and (target-hurd?) (not (system-hurd?)))
|
| 208 | `((add-after 'configure 'create-pipesize.h
|
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | (lambda _
|
| 214 | (with-directory-excursion "builtins"
|
| 215 | (with-output-to-file "psize.aux"
|
| 216 | (lambda _ (display "dummy to pacify make\n")))
|
| 217 | (with-output-to-file "pipesize.h"
|
| 218 | (lambda _ (display "#define PIPESIZE 16384\n")))))))
|
| 219 | '())
|
| 220 |
|
| 221 | (add-after 'install 'install-sh-symlink
|
| 222 | (lambda* (#:key outputs #:allow-other-keys)
|
| 223 | |
| 224 | (let ((out (assoc-ref outputs "out")))
|
| 225 | (with-directory-excursion (string-append out "/bin")
|
| 226 | (symlink "bash" "sh")
|
| 227 | #t))))
|
| 228 |
|
| 229 | (add-after 'install 'move-development-files
|
| 230 | (lambda* (#:key outputs #:allow-other-keys)
|
| 231 | |
| 232 | |
| 233 | (let ((out (assoc-ref outputs "out"))
|
| 234 | (include (assoc-ref outputs "include"))
|
| 235 | (lib (cut string-append <> "/lib/bash")))
|
| 236 | (mkdir-p (lib include))
|
| 237 | (rename-file (string-append (lib out)
|
| 238 | "/Makefile.inc")
|
| 239 | (string-append (lib include)
|
| 240 | "/Makefile.inc"))
|
| 241 | (rename-file (string-append out "/lib/pkgconfig")
|
| 242 | (string-append include
|
| 243 | "/lib/pkgconfig"))
|
| 244 |
|
| 245 | |
| 246 | |
| 247 | (substitute* (string-append (lib include)
|
| 248 | "/Makefile.inc")
|
| 249 | (("^INSTALL =.*")
|
| 250 | "INSTALL = install -c\n"))
|
| 251 | #t)))
|
| 252 | ,@(if (target-loongarch64?)
|
| 253 | `((add-after 'unpack 'update-config-scripts
|
| 254 | (lambda* (#:key inputs native-inputs #:allow-other-keys)
|
| 255 | |
| 256 | (for-each (lambda (file)
|
| 257 | (install-file
|
| 258 | (search-input-file
|
| 259 | (or native-inputs inputs)
|
| 260 | (string-append "/bin/" file)) "./support"))
|
| 261 | '("config.guess" "config.sub")))))
|
| 262 | '()))))
|
| 263 |
|
| 264 | (native-search-paths
|
| 265 | (list (search-path-specification |
| 266 | (variable "BASH_LOADABLES_PATH")
|
| 267 | (files '("lib/bash")))))
|
| 268 |
|
| 269 | (synopsis "The GNU Bourne-Again SHell")
|
| 270 | (description
|
| 271 | "Bash is the shell, or command-line interpreter, of the GNU system. It
|
| 272 | is compatible with the Bourne Shell, but it also integrates useful features
|
| 273 | from the Korn Shell and the C Shell and new improvements of its own. It
|
| 274 | allows command-line editing, unlimited command history, shell functions and
|
| 275 | aliases, and job control while still allowing most sh scripts to be run
|
| 276 | without modification.")
|
| 277 | (license license:gpl3+)
|
| 278 | (home-page "https://www.gnu.org/software/bash/"))))
|
| 279 |
|
| 280 | (define-public bash-minimal
|
| 281 | |
| 282 | (package/inherit bash
|
| 283 | (name "bash-minimal")
|
| 284 | (inputs '()) |
| 285 |
|
| 286 | |
| 287 | (outputs (delete "include" (package-outputs bash)))
|
| 288 |
|
| 289 | (arguments
|
| 290 | (substitute-keyword-arguments (package-arguments bash)
|
| 291 | ((#:modules _ '())
|
| 292 | '((guix build gnu-build-system)
|
| 293 | (guix build utils)
|
| 294 | (srfi srfi-1)
|
| 295 | (srfi srfi-26)))
|
| 296 | ((#:configure-flags flags '())
|
| 297 | `(list "CFLAGS=-g -O2 -Wno-error=implicit-function-declaration"
|
| 298 | "--without-bash-malloc"
|
| 299 | "--disable-readline"
|
| 300 | "--disable-history"
|
| 301 | "--disable-help-builtin"
|
| 302 | "--disable-progcomp"
|
| 303 | "--disable-net-redirections"
|
| 304 | "--disable-nls"
|
| 305 |
|
| 306 | |
| 307 | |
| 308 | "ac_cv_func_dlopen=no"
|
| 309 |
|
| 310 | ,@(if (%current-target-system)
|
| 311 | '("bash_cv_job_control_missing=no"
|
| 312 | "bash_cv_getcwd_malloc=yes")
|
| 313 | '())))
|
| 314 | ((#:phases phases)
|
| 315 | `(modify-phases ,phases
|
| 316 | |
| 317 | (delete 'move-development-files)))))
|
| 318 | (synopsis "The GNU Bourne-Again SHell, stripped down for non-interactive use")))
|
| 319 |
|
| 320 | (define-public static-bash
|
| 321 | |
| 322 | |
| 323 | (let ((bash (static-package bash-minimal)))
|
| 324 | (package/inherit bash
|
| 325 | (name "bash-static")
|
| 326 | (arguments
|
| 327 | (substitute-keyword-arguments
|
| 328 | `(#:allowed-references ("out") ,@(package-arguments bash))
|
| 329 | ((#:configure-flags flags '())
|
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | (if (%current-target-system)
|
| 335 | `(cons
|
| 336 | "bash_cv_getenv_redef=no"
|
| 337 | ,flags)
|
| 338 | flags))
|
| 339 | ((#:phases phases)
|
| 340 | #~(modify-phases #$phases
|
| 341 | (add-after 'strip 'remove-everything-but-the-binary
|
| 342 | (lambda* (#:key outputs #:allow-other-keys)
|
| 343 | (let* ((out (assoc-ref outputs "out"))
|
| 344 | (bin (string-append out "/bin")))
|
| 345 | (remove-store-references (string-append bin "/bash"))
|
| 346 | (delete-file (string-append bin "/bashbug"))
|
| 347 | (delete-file-recursively (string-append out "/share"))
|
| 348 | #t))))))))))
|
| 349 |
|
| 350 | (define-public bash-with-syslog
|
| 351 | (package/inherit bash
|
| 352 | (name "bash-with-syslog")
|
| 353 | (arguments
|
| 354 | (substitute-keyword-arguments (package-arguments bash)
|
| 355 | ((#:phases phases '%standard-phases)
|
| 356 | `(modify-phases ,phases
|
| 357 | (add-after 'unpack 'enable-syslogging
|
| 358 | (lambda _
|
| 359 | (substitute* "config-top.h"
|
| 360 | (("/\\* #define SYSLOG_HISTORY \\*/")
|
| 361 | "#define SYSLOG_HISTORY"))))))))
|
| 362 | (description
|
| 363 | "Bash is the shell, or command-line interpreter, of the GNU system. This
|
| 364 | variant logs the history to syslog.")))
|
| 365 |
|
| 366 | (define-public bash-completion
|
| 367 | (package
|
| 368 | (name "bash-completion")
|
| 369 | (version "2.11")
|
| 370 | (source (origin
|
| 371 | (method url-fetch)
|
| 372 | (uri (string-append
|
| 373 | "https://github.com/scop/" name "/releases/download/"
|
| 374 | version "/" name "-" version ".tar.xz"))
|
| 375 | (sha256
|
| 376 | (base32
|
| 377 | "1b0iz7da1sgifx1a5wdyx1kxbzys53v0kyk8nhxfipllmm5qka3k"))
|
| 378 | (patches
|
| 379 | (search-patches "bash-completion-directories.patch"))))
|
| 380 | (build-system gnu-build-system)
|
| 381 | (arguments
|
| 382 | `(#:tests? #f)) |
| 383 | (synopsis "Bash completions for common commands")
|
| 384 | (description
|
| 385 | "This package provides extensions that allow Bash to provide adapted
|
| 386 | completion for many common commands.")
|
| 387 | (home-page "https://github.com/scop/bash-completion")
|
| 388 | (license license:gpl2+)))
|
| 389 |
|
| 390 | (define-public bash-tap
|
| 391 | (package
|
| 392 | (name "bash-tap")
|
| 393 | (version "1.0.2")
|
| 394 | (source
|
| 395 | (origin
|
| 396 | (method git-fetch)
|
| 397 | (uri (git-reference
|
| 398 | (url "https://github.com/illusori/bash-tap")
|
| 399 | (commit version)))
|
| 400 | (file-name (git-file-name name version))
|
| 401 | (sha256
|
| 402 | (base32 "13zz9h6bhhnk3hiwhlpafrnf2isws249h3fz785dcgymk02arz9c"))))
|
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | (build-system gnu-build-system)
|
| 408 | (arguments
|
| 409 | `(#:tests? #f |
| 410 | #:phases
|
| 411 | (modify-phases %standard-phases
|
| 412 | |
| 413 | |
| 414 | (delete 'configure)
|
| 415 | (delete 'build)
|
| 416 | |
| 417 | |
| 418 | |
| 419 | (replace 'install
|
| 420 | (lambda* (#:key outputs #:allow-other-keys)
|
| 421 | (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
|
| 422 | (install-file "bash-tap" bin)
|
| 423 | (install-file "bash-tap-bootstrap" bin)
|
| 424 | (install-file "bash-tap-mock" bin)))))))
|
| 425 | (home-page "https://www.illusori.co.uk/projects/bash-tap/")
|
| 426 | (synopsis "Bash port of a Test::More/Test::Builder-style TAP-compliant
|
| 427 | test library")
|
| 428 | (description "Bash TAP is a TAP-compliant Test::More-style testing library
|
| 429 | for Bash shell scripts and functions. Along with the Test::More-style testing
|
| 430 | helpers it provides helper functions for mocking commands and in-process output
|
| 431 | capturing.")
|
| 432 | (license license:expat)))
|
| 433 |
|
| 434 | (define-public bats
|
| 435 | (package
|
| 436 | (name "bats")
|
| 437 | (version "1.11.0")
|
| 438 | (source (origin
|
| 439 | (method git-fetch)
|
| 440 | (uri (git-reference
|
| 441 | (url "https://github.com/bats-core/bats-core")
|
| 442 | (commit (string-append "v" version))))
|
| 443 | (file-name (git-file-name name version))
|
| 444 | (sha256
|
| 445 | (base32
|
| 446 | "1dmgxcqq87vs1l23hb7ghx319w2nvn0w8z2kdxggs2b8n22wi0c2"))))
|
| 447 | (inputs
|
| 448 | (list bash coreutils guile-3.0 |
| 449 | grep))
|
| 450 | (arguments
|
| 451 | `(#:modules ((guix build utils))
|
| 452 | #:builder
|
| 453 | (begin
|
| 454 | (use-modules (guix build utils))
|
| 455 | (copy-recursively (assoc-ref %build-inputs "source") ".")
|
| 456 | (setenv "PATH"
|
| 457 | (string-append (assoc-ref %build-inputs "bash") "/bin"
|
| 458 | ":" (assoc-ref %build-inputs "coreutils") "/bin"
|
| 459 | ":" (assoc-ref %build-inputs "grep") "/bin"
|
| 460 | ":" (assoc-ref %build-inputs "guile") "/bin"
|
| 461 | ":" (getenv "PATH")))
|
| 462 | (for-each patch-shebang
|
| 463 | (find-files "."
|
| 464 | (lambda (file stat)
|
| 465 | |
| 466 | (eq? 'regular (stat:type stat)))
|
| 467 | #:stat lstat))
|
| 468 | (substitute* "bin/bats"
|
| 469 | (("export BATS_ROOT" line)
|
| 470 | (string-append "BATS_ROOT=\"${BATS_ROOT:-" %output "/libexec/bats-core}\"\n"
|
| 471 | line)))
|
| 472 | |
| 473 | (invoke "./install.sh" %output)
|
| 474 | (wrap-script (string-append %output "/bin/bats")
|
| 475 | #:guile (search-input-file %build-inputs "bin/guile")
|
| 476 | (list "PATH" 'prefix (string-split (getenv "PATH")
|
| 477 | #\:))))))
|
| 478 | (build-system trivial-build-system)
|
| 479 | (home-page "https://github.com/bats-core/bats-core/")
|
| 480 | (synopsis "Bash Automated Testing System")
|
| 481 | (description
|
| 482 | "Bats is a @acronym{TAP, Test Anything Protocol}-compliant testing
|
| 483 | framework for Bash. It provides a simple way to verify that the UNIX programs
|
| 484 | you write behave as expected. Bats is most useful when testing software written
|
| 485 | in Bash, but you can use it to test any UNIX program.")
|
| 486 | (license license:expat)))
|
| 487 |
|
| 488 | (define-public bash-ctypes
|
| 489 | (package
|
| 490 | (name "bash-ctypes")
|
| 491 | (version "1.2")
|
| 492 | (source
|
| 493 | (origin
|
| 494 | (method url-fetch)
|
| 495 | (uri (string-append "https://github.com/taviso/ctypes.sh/releases/download/v"
|
| 496 | version "/ctypes-sh-" version ".tar.gz"))
|
| 497 | (sha256
|
| 498 | (base32 "0s1sifqzqmr0dnciv06yqrpzgj11d7n0gy5zaxh6b3x8bx7k75l8"))))
|
| 499 | (build-system gnu-build-system)
|
| 500 | (inputs
|
| 501 | (list elfutils
|
| 502 | libelf
|
| 503 | libffi
|
| 504 | zlib
|
| 505 | |
| 506 | bash))
|
| 507 | (native-inputs
|
| 508 | (list pkg-config))
|
| 509 | (home-page "https://github.com/taviso/ctypes.sh")
|
| 510 | (synopsis "Foreign function interface for Bash")
|
| 511 | (description "Bash-ctypes is a Bash plugin that provides a foreign
|
| 512 | function interface (FFI) directly in your shell. In other words, it allows
|
| 513 | you to call routines in shared libraries from within Bash.")
|
| 514 | (license license:expat)))
|
| 515 |
|
| 516 | (define-public blesh
|
| 517 | (package
|
| 518 | (name "blesh")
|
| 519 | (version "0.4.0-devel3")
|
| 520 | (source (origin
|
| 521 | (method git-fetch)
|
| 522 | (uri (git-reference
|
| 523 | (url "https://github.com/akinomyoga/ble.sh")
|
| 524 | (commit (string-append "v" version))
|
| 525 | (recursive? #t)))
|
| 526 | (file-name (git-file-name name version))
|
| 527 | (sha256
|
| 528 | (base32
|
| 529 | "19y9rmj9srl7akx33gl34l5qgz2ww0vlmi4j2r11029p8sn4s418"))))
|
| 530 | (arguments
|
| 531 | (list #:make-flags #~(list (string-append "PREFIX="
|
| 532 | #$output))
|
| 533 | #:phases #~(modify-phases %standard-phases
|
| 534 | (add-after 'unpack 'pretend-.git-exists
|
| 535 | (lambda _
|
| 536 | (substitute* "ble.pp"
|
| 537 | (("#%\\[commit_hash =.*")
|
| 538 | (string-append "#%[commit_hash = " #$version "]\n")))
|
| 539 | (mkdir-p ".git")))
|
| 540 | (delete 'configure) |
| 541 | (add-before 'check 'use-LANG-for-tests
|
| 542 | (lambda _
|
| 543 | (setenv "LANG"
|
| 544 | (getenv "LC_ALL"))
|
| 545 | (unsetenv "LC_ALL"))))))
|
| 546 | (build-system gnu-build-system)
|
| 547 | (native-inputs (list git less))
|
| 548 | (home-page "https://github.com/akinomyoga/ble.sh")
|
| 549 | (synopsis "Bash Line Editor")
|
| 550 | (description
|
| 551 | "Bash Line Editor (ble.sh) is a command line editor written in pure Bash
|
| 552 | which replaces the default GNU Readline. It adds syntax highlighting, auto
|
| 553 | suggestions, vim modes, and more to Bash interactive sessions.")
|
| 554 | (license license:bsd-3)))
|
| 555 |
|
| 556 | (define-public bash-unit
|
| 557 | (package
|
| 558 | (name "bash-unit")
|
| 559 | (version "2.3.2")
|
| 560 | (home-page "https://github.com/pgrange/bash_unit")
|
| 561 | (source
|
| 562 | (origin
|
| 563 | (method git-fetch)
|
| 564 | (uri (git-reference
|
| 565 | (url home-page)
|
| 566 | (commit (string-append "v" version))))
|
| 567 | (file-name (git-file-name name version))
|
| 568 | (sha256
|
| 569 | (base32 "1gb6vfr5m84bn1gbv7w3jr06fspylj1i3yqkvgxq0n3bncvs35wz"))))
|
| 570 | (build-system copy-build-system)
|
| 571 | (arguments
|
| 572 | `(#:install-plan '(("bash_unit" "bin/"))
|
| 573 | #:phases (modify-phases %standard-phases
|
| 574 | (add-before 'install 'check
|
| 575 | (lambda* (#:key tests? #:allow-other-keys)
|
| 576 | (when tests?
|
| 577 | (invoke "./bash_unit" "tests/test_core.sh")))))))
|
| 578 | (inputs (list bash-minimal))
|
| 579 | (synopsis "Bash unit testing framework")
|
| 580 | (description
|
| 581 | "@command{bash_unit} allows you to write unit tests, run them and, in case
|
| 582 | of failure, display the stack trace with source file and line number indications
|
| 583 | to locate the problem.")
|
| 584 | (license license:gpl3+)))
|