2021-11-10 11:30:09 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, lib
|
2021-11-29 20:02:34 +00:00
|
|
|
, stdenv
|
2021-11-10 11:30:09 +00:00
|
|
|
, cmake
|
|
|
|
, cppe
|
|
|
|
, eigen
|
|
|
|
, python
|
|
|
|
, pybind11
|
|
|
|
, numpy
|
|
|
|
, h5py
|
|
|
|
, numba
|
|
|
|
, scipy
|
|
|
|
, pandas
|
|
|
|
, polarizationsolver
|
|
|
|
, pytest
|
2021-11-29 20:02:34 +00:00
|
|
|
, llvmPackages
|
2021-11-10 11:30:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2021-11-29 20:02:34 +00:00
|
|
|
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";
|
2021-11-10 11:30:09 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-11-10 11:30:09 +00:00
|
|
|
pytest
|
|
|
|
h5py
|
|
|
|
numba
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
polarizationsolver
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "cppe" ];
|
|
|
|
}
|