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