ps3-disc-dumper: 3.2.3 -> 4.2.5, .NET 6 -> 9 (#361506)
[NixPkgs.git] / pkgs / development / libraries / catch2 / 3.nix
blobc9b8058542001cda30c7a1855f19f5e0974232ab
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   python3,
7 }:
9 stdenv.mkDerivation rec {
10   pname = "catch2";
11   version = "3.7.1";
13   src = fetchFromGitHub {
14     owner = "catchorg";
15     repo = "Catch2";
16     rev = "v${version}";
17     hash = "sha256-Zt53Qtry99RAheeh7V24Csg/aMW25DT/3CN/h+BaeoM=";
18   };
20   nativeBuildInputs = [
21     cmake
22   ];
24   hardeningDisable = [ "trivialautovarinit" ];
26   cmakeFlags =
27     [
28       "-DCATCH_DEVELOPMENT_BUILD=ON"
29       "-DCATCH_BUILD_TESTING=${if doCheck then "ON" else "OFF"}"
30     ]
31     ++ lib.optionals (stdenv.hostPlatform.isDarwin && doCheck) [
32       # test has a faulty path normalization technique that won't work in
33       # our darwin build environment https://github.com/catchorg/Catch2/issues/1691
34       "-DCMAKE_CTEST_ARGUMENTS=-E;ApprovalTests"
35     ];
37   env =
38     lib.optionalAttrs stdenv.hostPlatform.isx86_32 {
39       # Tests fail on x86_32 if compiled with x87 floats: https://github.com/catchorg/Catch2/issues/2796
40       NIX_CFLAGS_COMPILE = "-msse2 -mfpmath=sse";
41     }
42     // lib.optionalAttrs (stdenv.hostPlatform.isRiscV || stdenv.hostPlatform.isAarch32) {
43       # Build failure caused by -Werror: https://github.com/catchorg/Catch2/issues/2808
44       NIX_CFLAGS_COMPILE = "-Wno-error=cast-align";
45     };
47   doCheck = true;
49   nativeCheckInputs = [
50     python3
51   ];
53   meta = {
54     description = "Modern, C++-native, test framework for unit-tests";
55     homepage = "https://github.com/catchorg/Catch2";
56     changelog = "https://github.com/catchorg/Catch2/blob/${src.rev}/docs/release-notes.md";
57     license = lib.licenses.boost;
58     maintainers = with lib.maintainers; [ dotlambda ];
59     platforms = with lib.platforms; unix ++ windows;
60   };