504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
56 lines
950 B
Nix
56 lines
950 B
Nix
{ buildPythonPackage
|
|
, lib
|
|
, stdenv
|
|
, cmake
|
|
, cppe
|
|
, eigen
|
|
, python
|
|
, 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" ];
|
|
}
|