1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitLab,
5 cmake,
6 nanobind,
7 ninja,
8 scikit-build-core,
9 setuptools,
10 numpy,
11 pytestCheckHook,
12 scipy,
13 pytest-xdist,
14}:
15
16buildPythonPackage rec {
17 pname = "ducc0";
18 version = "0.38.0";
19 pyproject = true;
20
21 src = fetchFromGitLab {
22 domain = "gitlab.mpcdf.mpg.de";
23 owner = "mtr";
24 repo = "ducc";
25 tag = "ducc0_${lib.replaceStrings [ "." ] [ "_" ] version}";
26 hash = "sha256-Be7lw9i1uEOY3w/Efnn7sZ4Xg5DenQuih6uReCmOI1I=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml --replace-fail '"pybind11>=2.13.6", ' ""
31 '';
32
33 DUCC0_USE_NANOBIND = "";
34 DUCC0_OPTIMIZATION = "portable";
35
36 build-system = [
37 cmake
38 nanobind
39 ninja
40 scikit-build-core
41 setuptools
42 ];
43 dontUseCmakeConfigure = true;
44 dependencies = [ numpy ];
45
46 nativeCheckInputs = [
47 pytestCheckHook
48 scipy
49 pytest-xdist
50 ];
51 enabledTestPaths = [ "python/test" ];
52 pythonImportsCheck = [ "ducc0" ];
53
54 postInstall = ''
55 mkdir -p $out/include
56 cp -r ${src}/src/ducc0 $out/include
57 '';
58
59 meta = {
60 homepage = "https://gitlab.mpcdf.mpg.de/mtr/ducc";
61 description = "Efficient algorithms for Fast Fourier transforms and more";
62 license = lib.licenses.gpl2Plus;
63 maintainers = with lib.maintainers; [ parras ];
64 };
65}