Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / catch2 / 3.nix
blobf064eb7a4fdb53cb30b3c116abb751bab06ecbfd
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , python3
6 }:
8 stdenv.mkDerivation rec {
9   pname = "catch2";
10   version = "3.4.0";
12   src = fetchFromGitHub {
13     owner = "catchorg";
14     repo = "Catch2";
15     rev = "v${version}";
16     hash = "sha256-DqGGfNjKPW9HFJrX9arFHyNYjB61uoL6NabZatTWrr0=";
17   };
19   nativeBuildInputs = [
20     cmake
21   ];
23   cmakeFlags = [
24     "-DCATCH_DEVELOPMENT_BUILD=ON"
25     "-DCATCH_BUILD_TESTING=${if doCheck then "ON" else "OFF"}"
26   ] ++ lib.optionals (stdenv.isDarwin && doCheck) [
27     # test has a faulty path normalization technique that won't work in
28     # our darwin build environment https://github.com/catchorg/Catch2/issues/1691
29     "-DCMAKE_CTEST_ARGUMENTS=-E;ApprovalTests"
30   ];
32   doCheck = true;
34   nativeCheckInputs = [
35     python3
36   ];
38   meta = {
39     description = "Modern, C++-native, test framework for unit-tests";
40     homepage = "https://github.com/catchorg/Catch2";
41     changelog = "https://github.com/catchorg/Catch2/blob/${src.rev}/docs/release-notes.md";
42     license = lib.licenses.boost;
43     maintainers = with lib.maintainers; [ dotlambda ];
44     platforms = lib.platforms.unix;
45   };