Commit d760b57d authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

python3Packages.pybind11: catch -> catch2

Upstream use catch2. When we provide catch,
https://hydra.nixos.org/build/302959038/nixlog/1 says:
```
-- Catch not detected. Interpreter tests will be skipped.
Install Catch headers manually or use `cmake -DDOWNLOAD_CATCH=ON` to fetch them automatically.
```

With this, we correctly get:
```
-- Building interpreter tests using Catch v2.13.10
```

And
```
All tests passed (1559 assertions in 17 test cases)
```
parent 7b71e8ad
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
  boost,
  eigen,
  python,
  catch,
  catch2,
  numpy,
  pytestCheckHook,
  libxcrypt,
@@ -59,6 +59,7 @@ buildPythonPackage rec {

  cmakeFlags = [
    "-DBoost_INCLUDE_DIR=${lib.getDev boost}/include"
    "-DCATCH_INCLUDE_DIR=${lib.getDev catch2}/include/catch2"
    "-DEIGEN3_INCLUDE_DIR=${lib.getDev eigen}/include/eigen3"
  ]
  ++ lib.optionals (python.isPy3k && !stdenv.cc.isClang) [ "-DPYBIND11_CXX_STANDARD=-std=c++17" ];
@@ -76,7 +77,7 @@ buildPythonPackage rec {
  '';

  nativeCheckInputs = [
    catch
    catch2
    numpy
    pytestCheckHook
  ];
@@ -99,6 +100,10 @@ buildPythonPackage rec {
    "test_cross_module_exception_translator"
  ];

  postInstallCheck = ''
    make cpptest
  '';

  hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "fortify";

  meta = with lib; {