1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 rustPlatform,
7 libiconv,
8 numpy,
9 unittestCheckHook,
10 pythonOlder,
11}:
12
13buildPythonPackage rec {
14 pname = "nutils-poly";
15 version = "1.0.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "nutils";
22 repo = "poly-py";
23 tag = "v${version}";
24 hash = "sha256-dxFv4Az3uz6Du5dk5KZJ+unVbt3aZjxXliAQZhmBWDM=";
25 };
26
27 cargoDeps = rustPlatform.fetchCargoVendor {
28 inherit pname version src;
29 hash = "sha256-3UBQJfMPVo37V7mJnN9loF1+vKh3JxFJWgynwsOnAg4=";
30 };
31
32 nativeBuildInputs = [ rustPlatform.cargoSetupHook ];
33
34 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
35
36 build-system = [ rustPlatform.maturinBuildHook ];
37
38 dependencies = [ numpy ];
39
40 nativeCheckInputs = [ unittestCheckHook ];
41
42 pythonImportsCheck = [ "nutils_poly" ];
43
44 meta = {
45 description = "Low-level functions for evaluating and manipulating polynomials";
46 homepage = "https://github.com/nutils/poly-py";
47 license = lib.licenses.mit;
48 maintainers = with lib.maintainers; [ tomasajt ];
49 };
50}