@@ -5,9 +5,10 @@
8−, numpy ? null
9+, numpy
9−, eigen ? null
10+, eigen
10−, scipy ? null
11+, scipy
13buildPythonPackage rec {
14buildPythonPackage rec {
@@ -21,23 +22,42 @@ buildPythonPackage rec {
21 sha256 = "0k89w4bsfbpzw963ykg1cyszi3h3nk393qd31m6y46pcfxkqh4rd";
22 sha256 = "0k89w4bsfbpzw963ykg1cyszi3h3nk393qd31m6y46pcfxkqh4rd";
24− dontUseCmakeConfigure = true;
26 nativeBuildInputs = [ cmake ];
25 nativeBuildInputs = [ cmake ];
27− checkInputs = [ pytest ]
28− ++ (lib.optional (numpy != null) numpy)
29− ++ (lib.optional (eigen != null) eigen)
30− ++ (lib.optional (scipy != null) scipy);
32− cmake ${if eigen != null then "-DEIGEN3_INCLUDE_DIR=${eigen}/include/eigen3" else ""}
33− make -j $NIX_BUILD_CORES pytest
36− # re-expose the headers to other packages
27+ buildInputs = [ catch ];
30+ "-DEIGEN3_INCLUDE_DIR=${eigen}/include/eigen3"
31+ ] ++ lib.optionals (!python.isPy2) [
32+ # Enable some tests only on Python 3. The "test_string_view" test
33+ # 'testTypeError: string_view16_chars(): incompatible function arguments'
35+ "-DPYBIND11_CPP_STANDARD=-std=c++17"
38+ dontUseSetuptoolsBuild = true;
39+ dontUsePipInstall = true;
40+ dontUseSetuptoolsCheck = true;
44+ export PYBIND11_USE_CMAKE=1
47+ # Symlink the CMake-installed headers to the location expected by setuptools
48+ mkdir -p $out/include/${python.libPrefix}
38− ln -s $out/include/python${python.pythonVersion}m/pybind11/ $out/include/pybind11
49+ ln -sf $out/include/pybind11 $out/include/${python.libPrefix}/pybind11
53+ installCheckTarget = "pytest";
54+ doInstallCheck = true;
42 homepage = https://github.com/pybind/pybind11;
62 homepage = https://github.com/pybind/pybind11;
43 description = "Seamless operability between C++11 and Python";
63 description = "Seamless operability between C++11 and Python";