diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/catch2')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/catch2/3.nix | 46 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/catch2/default.nix | 25 |
2 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/catch2/3.nix b/nixpkgs/pkgs/development/libraries/catch2/3.nix new file mode 100644 index 000000000000..72dd4552bf97 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/catch2/3.nix @@ -0,0 +1,46 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, python3 +}: + +stdenv.mkDerivation rec { + pname = "catch2"; + version = "3.3.2"; + + src = fetchFromGitHub { + owner = "catchorg"; + repo = "Catch2"; + rev = "v${version}"; + hash = "sha256-t/4iCrzPeDZNNlgibVqx5rhe+d3lXwm1GmBMDDId0VQ="; + }; + + nativeBuildInputs = [ + cmake + ]; + + cmakeFlags = [ + "-DCATCH_DEVELOPMENT_BUILD=ON" + "-DCATCH_BUILD_TESTING=${if doCheck then "ON" else "OFF"}" + ] ++ lib.optionals (stdenv.isDarwin && doCheck) [ + # test has a faulty path normalization technique that won't work in + # our darwin build environment https://github.com/catchorg/Catch2/issues/1691 + "-DCMAKE_CTEST_ARGUMENTS=-E;ApprovalTests" + ]; + + doCheck = true; + + nativeCheckInputs = [ + python3 + ]; + + meta = { + description = "Modern, C++-native, test framework for unit-tests"; + homepage = "https://github.com/catchorg/Catch2"; + changelog = "https://github.com/catchorg/Catch2/blob/${src.rev}/docs/release-notes.md"; + license = lib.licenses.boost; + maintainers = with lib.maintainers; [ dotlambda ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/catch2/default.nix b/nixpkgs/pkgs/development/libraries/catch2/default.nix new file mode 100644 index 000000000000..3c51fa9371d9 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/catch2/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "catch2"; + version = "2.13.10"; + + src = fetchFromGitHub { + owner = "catchorg"; + repo = "Catch2"; + rev = "v${version}"; + sha256="sha256-XnT2ziES94Y4uzWmaxSw7nWegJFQjAqFUG8PkwK5nLU="; + }; + + nativeBuildInputs = [ cmake ]; + + cmakeFlags = [ "-H.." ]; + + meta = with lib; { + description = "A multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C)"; + homepage = "http://catch-lib.net"; + license = licenses.boost; + maintainers = with maintainers; [ edwtjo knedlsepp ]; + platforms = platforms.unix ++ [ "x86_64-windows" ]; + }; +} |