diff options
Diffstat (limited to 'pkgs/development/interpreters/bats/default.nix')
-rw-r--r-- | pkgs/development/interpreters/bats/default.nix | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix index 1412985a247e1..9cdde90c41d3f 100644 --- a/pkgs/development/interpreters/bats/default.nix +++ b/pkgs/development/interpreters/bats/default.nix @@ -1,28 +1,52 @@ -{ stdenv, lib, fetchzip, bash, makeWrapper, coreutils, gnugrep, ncurses, doCheck ? true }: +{ resholvePackage +, lib +, fetchFromGitHub +, bash +, coreutils +, gnugrep +, ncurses +, doInstallCheck ? true +}: -stdenv.mkDerivation rec { +resholvePackage rec { pname = "bats"; version = "1.5.0"; - src = fetchzip { - url = "https://github.com/bats-core/bats-core/archive/v${version}.tar.gz"; - hash = "sha256-MEkMi2w8G9FZhE3JvzzbqObcErQ9WFXy5mtKwQOoxbk="; + src = fetchFromGitHub { + owner = "bats-core"; + repo = "bats-core"; + rev = "v${version}"; + sha256 = "sha256-MEkMi2w8G9FZhE3JvzzbqObcErQ9WFXy5mtKwQOoxbk="; }; - nativeBuildInputs = [ makeWrapper ]; - patchPhase = '' patchShebangs . ''; installPhase = '' ./install.sh $out - wrapProgram $out/bin/bats --suffix PATH : "${lib.makeBinPath [ bash coreutils gnugrep ]}" ''; - inherit doCheck; - checkInputs = [ ncurses ]; - checkPhase = '' + solutions = { + bats = { + scripts = [ "bin/bats" ]; + interpreter = "${bash}/bin/bash"; + inputs = [ bash coreutils gnugrep ]; + fake = { + external = [ "greadlink" ]; + }; + fix = { + "$BATS_ROOT" = [ "${placeholder "out"}" ]; + }; + keep = { + "${placeholder "out"}/libexec/bats-core/bats" = true; + }; + }; + }; + + inherit doInstallCheck; + installCheckInputs = [ ncurses ]; + installCheckPhase = '' # TODO: cut if https://github.com/bats-core/bats-core/issues/418 allows sed -i '/test works even if PATH is reset/a skip' test/bats.bats |