summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/ducc0/default.nix
blob: f782562c94a6479111477f011111404e52369779 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitLab,
  cmake,
  nanobind,
  ninja,
  scikit-build-core,
  setuptools,
  numpy,
  pytestCheckHook,
  scipy,
  pytest-xdist,
}:

buildPythonPackage rec {
  pname = "ducc0";
  version = "0.39.1";
  pyproject = true;

  src = fetchFromGitLab {
    domain = "gitlab.mpcdf.mpg.de";
    owner = "mtr";
    repo = "ducc";
    tag = "ducc0_${lib.replaceStrings [ "." ] [ "_" ] version}";
    hash = "sha256-8nM7Jnxx1NoQQwL0VyPGLzdq1UW5apjxKa1ksq2Qh6U=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml --replace-fail '"pybind11>=2.13.6", ' ""
  '';

  DUCC0_USE_NANOBIND = "";
  DUCC0_OPTIMIZATION = "portable";

  build-system = [
    cmake
    nanobind
    ninja
    scikit-build-core
    setuptools
  ];
  dontUseCmakeConfigure = true;
  dependencies = [ numpy ];

  nativeCheckInputs = [
    pytestCheckHook
    scipy
    pytest-xdist
  ];
  enabledTestPaths = [ "python/test" ];
  pythonImportsCheck = [ "ducc0" ];

  postInstall = ''
    mkdir -p $out/include
    cp -r ${src}/src/ducc0 $out/include
  '';

  meta = {
    homepage = "https://gitlab.mpcdf.mpg.de/mtr/ducc";
    description = "Efficient algorithms for Fast Fourier transforms and more";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [ parras ];
  };
}