summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/nutils-poly/default.nix
blob: 839fdc90fec8b585d0a85be443172aa09827568b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  rustPlatform,
  libiconv,
  numpy,
  unittestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "nutils-poly";
  version = "1.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "nutils";
    repo = "poly-py";
    tag = "v${finalAttrs.version}";
    hash = "sha256-dxFv4Az3uz6Du5dk5KZJ+unVbt3aZjxXliAQZhmBWDM=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit (finalAttrs) pname version src;
    hash = "sha256-3UBQJfMPVo37V7mJnN9loF1+vKh3JxFJWgynwsOnAg4=";
  };

  nativeBuildInputs = [ rustPlatform.cargoSetupHook ];

  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];

  build-system = [ rustPlatform.maturinBuildHook ];

  dependencies = [ numpy ];

  nativeCheckInputs = [ unittestCheckHook ];

  pythonImportsCheck = [ "nutils_poly" ];

  meta = {
    description = "Low-level functions for evaluating and manipulating polynomials";
    homepage = "https://github.com/nutils/poly-py";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ tomasajt ];
  };
})