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 name = "${pname}-${version}";
29 inherit src;
30 hash = "sha256-3UBQJfMPVo37V7mJnN9loF1+vKh3JxFJWgynwsOnAg4=";
31 };
32
33 nativeBuildInputs = [ rustPlatform.cargoSetupHook ];
34
35 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
36
37 build-system = [ rustPlatform.maturinBuildHook ];
38
39 dependencies = [ numpy ];
40
41 nativeCheckInputs = [ unittestCheckHook ];
42
43 pythonImportsCheck = [ "nutils_poly" ];
44
45 meta = {
46 description = "Low-level functions for evaluating and manipulating polynomials";
47 homepage = "https://github.com/nutils/poly-py";
48 license = lib.licenses.mit;
49 maintainers = with lib.maintainers; [ tomasajt ];
50 };
51}