Files
2026-06-03 16:40:52 +00:00

79 lines
1.3 KiB
Nix

{
lib,
stdenv,
pkgs,
buildPythonPackage,
# build-system
cmake,
ninja,
pip,
setuptools,
# nativeBuildInputs
openmpi,
# dependencies
numpy,
mpiSupport ? false,
}:
let
conduit = pkgs.conduit.override { inherit mpiSupport; };
in
buildPythonPackage {
inherit (conduit)
pname
version
src
# nativeBuildInputs
buildInputs
;
pyproject = true;
__structuredAttrs = true;
postPatch = (conduit.postPatch or "") + ''
substituteInPlace pyproject.toml \
--replace-fail \
"cmake<=3.30.0" \
"cmake"
'';
env.ENABLE_MPI = mpiSupport;
build-system = [
cmake
ninja
pip
setuptools
];
dontUseCmakeConfigure = true;
nativeBuildInputs = conduit.nativeBuildInputs ++ [
# openmpi needs to be in nativeBuildInputs, otherwise cmake can't find it
openmpi
];
dependencies = [
numpy
];
pythonImportsCheck = [ "conduit" ];
# No python tests
doCheck = false;
meta = {
description = "Python bindings for the conduit library";
inherit (conduit.meta)
homepage
changelog
license
platforms
;
maintainers = with lib.maintainers; [ GaetanLepage ];
# Cross-compilation is broken
broken = stdenv.hostPlatform != stdenv.buildPlatform;
};
}