1{ buildPythonPackage
2, lib
3, stdenv
4, cmake
5, cppe
6, eigen
7, python
8, pybind11
9, numpy
10, h5py
11, numba
12, scipy
13, pandas
14, polarizationsolver
15, pytest
16, llvmPackages
17}:
18
19buildPythonPackage rec {
20 inherit (cppe) pname version src meta;
21
22 # The python interface requires eigen3, but builds from a checkout in tree.
23 # Using the nixpkgs version instead.
24 postPatch = ''
25 substituteInPlace setup.py \
26 --replace "external/eigen3" "${eigen}/include/eigen3"
27 '';
28
29 nativeBuildInputs = [
30 cmake
31 eigen
32 ];
33
34 dontUseCmakeConfigure = true;
35
36 buildInputs = [ pybind11 ]
37 ++ lib.optional stdenv.cc.isClang llvmPackages.openmp;
38
39 NIX_CFLAGS_LINK = lib.optional stdenv.cc.isClang "-lomp";
40
41 hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
42
43 checkInputs = [
44 pytest
45 h5py
46 numba
47 numpy
48 pandas
49 polarizationsolver
50 scipy
51 ];
52
53 pythonImportsCheck = [ "cppe" ];
54}