+ (license 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")
+ (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 @acronym{TAP, Test Anything Protocol}-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 license:expat)))
+
+(define-public bash-ctypes
+ (package
+ (name "bash-ctypes")
+ (version "1.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/taviso/ctypes.sh/releases/download/v"
+ version "/ctypes-sh-" version ".tar.gz"))
+ (sha256
+ (base32 "0s1sifqzqmr0dnciv06yqrpzgj11d7n0gy5zaxh6b3x8bx7k75l8"))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("elfutils" ,elfutils)
+ ("libelf" ,libelf)
+ ("libffi" ,libffi)
+ ("zlib" ,zlib)
+ ;; Require a bash with C plugin support to build.
+ ("bash" ,bash)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (home-page "https://github.com/taviso/ctypes.sh")
+ (synopsis "Foreign function interface for Bash")
+ (description "Bash-ctypes is a Bash plugin that provides a foreign
+function interface (FFI) directly in your shell. In other words, it allows
+you to call routines in shared libraries from within Bash.")
+ (license license:expat)))