summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-18 21:19:01 +0100
committerGitHub <noreply@github.com>2021-01-18 21:19:01 +0100
commit2a28c3a986ca39e164040ed177c4d79180683364 (patch)
tree5bb2af0222ec7e1e7b5bfdf4cd5c4a790c02410a
parentd9b21406182d1c41fcb8a89fa506032667c18ba9 (diff)
parent90438281efbb174d118c87386fd196883d7033b4 (diff)
downloadnixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.tar
nixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.tar.gz
nixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.tar.bz2
nixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.tar.lz
nixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.tar.xz
nixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.tar.zst
nixpkgs-2a28c3a986ca39e164040ed177c4d79180683364.zip
Merge pull request #109069 from abathur/update/bats-1.2.1
bats: 1.2.0 -> 1.2.1
-rw-r--r--pkgs/development/interpreters/bats/default.nix30
1 files changed, 19 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix
index bbc38e51542..aa3abc65534 100644
--- a/pkgs/development/interpreters/bats/default.nix
+++ b/pkgs/development/interpreters/bats/default.nix
@@ -1,29 +1,37 @@
-{ stdenv, fetchzip, coreutils, gnugrep }:
+{ stdenv, lib, fetchzip, bash, makeWrapper, coreutils, gnugrep, doCheck ? true }:
 
 stdenv.mkDerivation rec {
   pname = "bats";
-  version = "1.2.0";
+  version = "1.2.1";
 
   src = fetchzip {
     url = "https://github.com/bats-core/bats-core/archive/v${version}.tar.gz";
-    sha256 = "0f59zh4d4pa1a7ybs5zl6h0csbqqv11lbnq0jl1dgwm1s6p49bsq";
+    hash = "sha256-grB/rJaDU0fuw4Hm3/9nI2px8KZnSWqRjTJPd7Mmb7s=";
   };
 
+  nativeBuildInputs = [ makeWrapper ];
+
   patchPhase = ''
-    patchShebangs ./install.sh
+    patchShebangs .
+  '';
 
-    substituteInPlace ./libexec/bats-core/bats \
-        --replace 'type -p greadlink readlink' 'type -p ${coreutils}/bin/readlink'
-    substituteInPlace ./libexec/bats-core/bats-format-tap-stream \
-        --replace grep ${gnugrep}/bin/grep
+  installPhase = ''
+    ./install.sh $out
+    wrapProgram $out/bin/bats --suffix PATH : "${lib.makeBinPath [ bash coreutils gnugrep ]}"
   '';
 
-  installPhase = "./install.sh $out";
+  inherit doCheck;
+  checkPhase = ''
+    # test generates file with absolute shebang dynamically
+    substituteInPlace test/install.bats --replace \
+      "/usr/bin/env bash" "${bash}/bin/bash"
+    bin/bats test
+  '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/bats-core/bats-core";
     description = "Bash Automated Testing System";
-    maintainers = [ maintainers.lnl7 ];
+    maintainers = with maintainers; [ abathur ];
     license = licenses.mit;
     platforms = platforms.unix;
   };