summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/bezier/default.nix
blob: 13ef41aa96dc1cef69372d175638eab111b7fdd8 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
  lib,
  stdenv,
  fetchFromGitHub,
  buildPythonPackage,
  setuptools,
  numpy,
  matplotlib,
  scipy,
  sympy,

  cmake,
  gfortran,

  nix-update-script,
}:
buildPythonPackage rec {
  name = "bezier";
  version = "2024.6.20";
  src = fetchFromGitHub {
    owner = "dhermes";
    repo = "bezier";
    tag = version;
    hash = "sha256-TH3x6K5S3uV/K/5e+TXCSiJsyJE0tZ+8ZLc+i/x/fV8=";
  };

  pyproject = true;

  build-system = [ setuptools ];

  dependencies = [ numpy ];
  optional-dependencies = {
    full = [
      matplotlib
      scipy
      sympy
    ];
  };

  env = {
    BEZIER_IGNORE_VERSION_CHECK = 1;
    BEZIER_INSTALL_PREFIX = stdenv.mkDerivation {
      name = "bezier-fortran-extension";
      inherit version src;

      sourceRoot = "${src.name}/src/fortran";

      nativeBuildInputs = [
        cmake
        gfortran
      ];
    };
    NIX_CFLAGS_COMPILE = toString [
      "-Wno-error=incompatible-pointer-types"
    ];
  };

  pythonImportsCheck = [ "bezier" ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Helper for Bézier Curves, Triangles, and Higher Order Objects";
    changelog = "https://bezier.readthedocs.io/en/latest/releases/latest.html";
    homepage = "https://github.com/dhermes/bezier";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ WeetHet ];
  };
}