GNU bug report logs - #41751
[PATCH] gnu: Add bats.

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Sun, 7 Jun 2020 18:25:02 UTC

Severity: normal

Tags: patch

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41751 in the body.
You can then email your comments to 41751 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41751; Package guix-patches. (Sun, 07 Jun 2020 18:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 07 Jun 2020 18:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH] gnu: Add bats.
Date: Sun,  7 Jun 2020 21:23:50 +0300
* gnu/packages/bash.scm (bats): New variable.
---
 gnu/packages/bash.scm | 52 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 3ba8a13e40..dff3fcb594 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe <at> gmail.com>
+;;; Copyright © 2020 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
 (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)
@@ -37,6 +39,7 @@
   #: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)
 
@@ -362,3 +365,52 @@ 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)
+       ("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"
+                                ":" (getenv "PATH")))
+         ;; Patch phase
+         (substitute* "install.sh"
+           (("/usr/bin/env bash") (which "bash")))
+         (substitute* "libexec/bats-core/bats"
+           (("type -p greadlink readlink")
+            (string-append "type -p " (which "readlink"))))
+         (substitute* "libexec/bats-core/bats"
+           (("grep") (which "grep")))
+         ;; Install phase
+         (invoke "./install.sh" %output))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "BATS_ROOT")
+            (separator #f) ;single entry
+            (files '("libexec/bats-core")))))
+    (build-system trivial-build-system)
+    (home-page "https://github.com/bats-core/bats-core/")
+    (synopsis "Bash Automated Testing System")
+    (description "This package provides a Bash Automated Testing System.")
+    (license expat)))
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41751; Package guix-patches. (Sun, 14 Jun 2020 10:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 41751 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 41751 <at> debbugs.gnu.org
Subject: Re: [bug#41751] [PATCH] gnu: Add bats.
Date: Sun, 14 Jun 2020 12:15:44 +0200
Hello Oleg,

> +    (native-search-paths
> +     (list (search-path-specification
> +            (variable "BATS_ROOT")
> +            (separator #f) ;single entry
> +            (files '("libexec/bats-core")))))

Why not patching "bats" script directly? This way we wouldn't need an
extra environment variable to run "bats".

> +    (description "This package provides a Bash Automated Testing System.")

It would be good to elaborate a bit on that, what can be tested exactly,
how to use it.

Otherwise, this looks fine.

Thanks,

Mathieu




Reply sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
You have taken responsibility. (Sat, 25 Jul 2020 19:15:01 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Sat, 25 Jul 2020 19:15:02 GMT) Full text and rfc822 format available.

Message #13 received at 41751-done <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 41751-done <at> debbugs.gnu.org
Subject: Re: [bug#41751] [PATCH] gnu: Add bats.
Date: Sat, 25 Jul 2020 22:14:25 +0300
[Message part 1 (text/plain, inline)]
All suggestions were applied and pushed in master in
5a88d3dfcb382a9256e5b6d18f1487b597260944.

Closing.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Aug 2020 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.