1{ lib
2, toPythonModule
3, stdenv
4, fetchFromGitHub
5, cmake
6, gtest
7, xtensor
8, pybind11
9, numpy
10}:
11
12toPythonModule (stdenv.mkDerivation(finalAttrs: {
13 pname = "xtensor-python";
14 version = "0.26.1";
15
16 src = fetchFromGitHub {
17 owner = "xtensor-stack";
18 repo = "xtensor-python";
19 rev = finalAttrs.version;
20 sha256 = "sha256-kLFt5Ah5/ZO6wfTZQviVXeIAVok+/F/XCwpgPSagOMo=";
21 };
22
23 nativeBuildInputs = [
24 cmake
25 ];
26 buildInputs = [
27 pybind11
28 ];
29 nativeCheckInputs = [
30 gtest
31 ];
32 doCheck = true;
33 cmakeFlags = [
34 "-DBUILD_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}"
35 ];
36
37 propagatedBuildInputs = [
38 xtensor
39 numpy
40 ];
41
42 checkTarget = "xtest";
43
44 meta = with lib; {
45 homepage = "https://github.com/xtensor-stack/xtensor-python";
46 description = "Python bindings for the xtensor C++ multi-dimensional array library";
47 license = licenses.bsd3;
48 maintainers = with maintainers; [ lsix ];
49 };
50}))