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