2019-06-02 09:58:27 +01:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub, cmake, catch, python, eigen }:
|
2018-08-01 20:14:51 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pybind";
|
2019-02-14 14:04:32 +00:00
|
|
|
version = "2.2.4";
|
|
|
|
|
2018-08-01 20:14:51 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pybind";
|
|
|
|
repo = "pybind11";
|
|
|
|
rev = "v${version}";
|
2019-02-14 14:04:32 +00:00
|
|
|
sha256 = "0pa79ymcasv8br5ifbx7878id5py2jpjac3i20cqxr6gs9l6ivlv";
|
2018-08-01 20:14:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2019-02-14 14:04:32 +00:00
|
|
|
checkInputs = with python.pkgs; [ catch eigen pytest numpy scipy ];
|
|
|
|
|
|
|
|
# Disable test_cmake_build test, as it fails in sandbox
|
|
|
|
# https://github.com/pybind/pybind11/issues/1355
|
2019-06-02 09:58:27 +01:00
|
|
|
patches = [
|
|
|
|
./no_test_cmake_build.patch
|
|
|
|
(fetchurl { # Remove on bump to v2.2.5
|
|
|
|
name = "pytest_namespace_to_configure.patch";
|
|
|
|
url = "https://github.com/pybind/pybind11/commit/e7ef34f23f194cfa40bdbf967c6d34712261a4ee.patch";
|
|
|
|
sha256 = "1dhv6p0b5fxzxc8j3sfy8kvfmdshczk22xfxh6bk0cfnfdy9iqrq";
|
|
|
|
})
|
|
|
|
];
|
2018-08-01 20:14:51 +01:00
|
|
|
|
2019-02-14 14:04:32 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DPYTHON_EXECUTABLE=${python.interpreter}"
|
|
|
|
"-DPYBIND11_TEST=${if doCheck then "ON" else "OFF"}"
|
2018-08-01 20:14:51 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://github.com/pybind/pybind11;
|
|
|
|
description = "Seamless operability between C++11 and Python";
|
|
|
|
longDescription = ''
|
|
|
|
Pybind11 is a lightweight header-only library that exposes
|
|
|
|
C++ types in Python and vice versa, mainly to create Python
|
|
|
|
bindings of existing C++ code.
|
|
|
|
'';
|
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
|
|
|
|
};
|
|
|
|
}
|