1{
2 lib,
3 toPythonModule,
4 stdenv,
5 fetchFromGitHub,
6 cmake,
7 gtest,
8 xtensor,
9 pybind11,
10 numpy,
11}:
12
13toPythonModule (
14 stdenv.mkDerivation (finalAttrs: {
15 pname = "xtensor-python";
16 version = "0.27.0";
17
18 src = fetchFromGitHub {
19 owner = "xtensor-stack";
20 repo = "xtensor-python";
21 rev = finalAttrs.version;
22 hash = "sha256-Cy/aXuiriE/qxSd4Apipzak30DjgE7jX8ai1ThJ/VnE=";
23 };
24
25 nativeBuildInputs = [ cmake ];
26 buildInputs = [ pybind11 ];
27 nativeCheckInputs = [ gtest ];
28 doCheck = true;
29 cmakeFlags = [
30 # Always build the tests, even if not running them, because testing whether
31 # they can be built is a test in itself.
32 "-DBUILD_TESTS=ON"
33 ];
34
35 propagatedBuildInputs = [
36 xtensor
37 numpy
38 ];
39
40 checkTarget = "xtest";
41
42 meta = with lib; {
43 homepage = "https://github.com/xtensor-stack/xtensor-python";
44 description = "Python bindings for the xtensor C++ multi-dimensional array library";
45 license = licenses.bsd3;
46 maintainers = with maintainers; [ lsix ];
47 };
48 })
49)