depot/third_party/nixpkgs/pkgs/development/python-modules/cppe/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

60 lines
975 B
Nix

{
buildPythonPackage,
lib,
stdenv,
cmake,
cppe,
eigen,
pybind11,
numpy,
h5py,
numba,
scipy,
pandas,
polarizationsolver,
pytest,
llvmPackages,
}:
buildPythonPackage rec {
inherit (cppe)
pname
version
src
meta
;
# The python interface requires eigen3, but builds from a checkout in tree.
# Using the nixpkgs version instead.
postPatch = ''
substituteInPlace setup.py \
--replace "external/eigen3" "${eigen}/include/eigen3"
'';
nativeBuildInputs = [
cmake
eigen
];
dontUseCmakeConfigure = true;
format = "setuptools";
buildInputs = [ pybind11 ] ++ lib.optional stdenv.cc.isClang llvmPackages.openmp;
NIX_CFLAGS_LINK = lib.optional stdenv.cc.isClang "-lomp";
hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
nativeCheckInputs = [
pytest
h5py
numba
numpy
pandas
polarizationsolver
scipy
];
pythonImportsCheck = [ "cppe" ];
}