diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix index ef1a110f8e74..cc57d72e8058 100644 --- a/pkgs/development/interpreters/bats/default.nix +++ b/pkgs/development/interpreters/bats/default.nix @@ -13,6 +13,7 @@ , ps , bats , lsof +, callPackages , doInstallCheck ? true }: @@ -105,6 +106,8 @@ resholve.mkDerivation rec { }; }; + passthru.libraries = callPackages ./libraries.nix {}; + passthru.tests.upstream = bats.unresholved.overrideAttrs (old: { name = "${bats.name}-tests"; dontInstall = true; # just need the build directory diff --git a/pkgs/development/interpreters/bats/libraries.nix b/pkgs/development/interpreters/bats/libraries.nix new file mode 100644 index 000000000000..74324b03e6ad --- /dev/null +++ b/pkgs/development/interpreters/bats/libraries.nix @@ -0,0 +1,70 @@ +{ lib, stdenv, fetchFromGitHub }: { + bats-assert = stdenv.mkDerivation { + pname = "bats-assert"; + version = "2.0.0"; + src = fetchFromGitHub { + owner = "bats-core"; + repo = "bats-assert"; + rev = "v2.0.0"; + sha256 = "sha256-whSbAj8Xmnqclf78dYcjf1oq099ePtn4XX9TUJ9AlyQ="; + }; + dontBuild = true; + installPhase = '' + mkdir -p "$out/share/bats" + cp -r . "$out/share/bats/bats-assert" + ''; + meta = { + description = "Common assertions for Bats"; + platforms = lib.platforms.all; + homepage = "https://github.com/bats-core/bats-assert"; + license = lib.licenses.cc0; + maintainers = with lib.maintainers; [ infinisil ]; + }; + }; + + bats-file = stdenv.mkDerivation { + pname = "bats-file"; + version = "0.3.0"; + src = fetchFromGitHub { + owner = "bats-core"; + repo = "bats-file"; + rev = "v0.3.0"; + sha256 = "sha256-3xevy0QpwNZrEe+2IJq58tKyxQzYx8cz6dD2nz7fYUM="; + }; + dontBuild = true; + installPhase = '' + mkdir -p "$out/share/bats" + cp -r . "$out/share/bats/bats-file" + ''; + meta = { + description = "Common filesystem assertions for Bats"; + platforms = lib.platforms.all; + homepage = "https://github.com/bats-core/bats-file"; + license = lib.licenses.cc0; + maintainers = with lib.maintainers; [ infinisil ]; + }; + }; + + bats-support = stdenv.mkDerivation { + pname = "bats-support"; + version = "0.3.0"; + src = fetchFromGitHub { + owner = "bats-core"; + repo = "bats-support"; + rev = "v0.3.0"; + sha256 = "sha256-4N7XJS5XOKxMCXNC7ef9halhRpg79kUqDuRnKcrxoeo="; + }; + dontBuild = true; + installPhase = '' + mkdir -p "$out/share/bats" + cp -r . "$out/share/bats/bats-support" + ''; + meta = { + description = "Supporting library for Bats test helpers"; + platforms = lib.platforms.all; + homepage = "https://github.com/bats-core/bats-support"; + license = lib.licenses.cc0; + maintainers = with lib.maintainers; [ infinisil ]; + }; + }; +}