1{ stdenv, fetchFromGitHub, cmake, catch, python, eigen }:
2
3stdenv.mkDerivation rec {
4 name = "pybind-${version}";
5 version = "2.2.4";
6
7 src = fetchFromGitHub {
8 owner = "pybind";
9 repo = "pybind11";
10 rev = "v${version}";
11 sha256 = "0pa79ymcasv8br5ifbx7878id5py2jpjac3i20cqxr6gs9l6ivlv";
12 };
13
14 nativeBuildInputs = [ cmake ];
15 checkInputs = with python.pkgs; [ catch eigen pytest numpy scipy ];
16
17 # Disable test_cmake_build test, as it fails in sandbox
18 # https://github.com/pybind/pybind11/issues/1355
19 patches = [ ./no_test_cmake_build.patch ];
20
21 doCheck = true;
22
23 cmakeFlags = [
24 "-DPYTHON_EXECUTABLE=${python.interpreter}"
25 "-DPYBIND11_TEST=${if doCheck then "ON" else "OFF"}"
26 ];
27
28 meta = {
29 homepage = https://github.com/pybind/pybind11;
30 description = "Seamless operability between C++11 and Python";
31 longDescription = ''
32 Pybind11 is a lightweight header-only library that exposes
33 C++ types in Python and vice versa, mainly to create Python
34 bindings of existing C++ code.
35 '';
36 platforms = with stdenv.lib.platforms; unix;
37 license = stdenv.lib.licenses.bsd3;
38 maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
39 };
40}