1{lib, python, buildPythonPackage, isPyPy, gfortran, nose, blas}:
2
3args:
4
5let
6 inherit (args) version;
7in buildPythonPackage (args // rec {
8
9 name = "numpy-${version}";
10
11 disabled = isPyPy;
12 buildInputs = args.buildInputs or [ gfortran nose ];
13 propagatedBuildInputs = args.propagatedBuildInputs or [ passthru.blas ];
14
15 preConfigure = ''
16 sed -i 's/-faltivec//' numpy/distutils/system_info.py
17 '';
18
19 preBuild = ''
20 echo "Creating site.cfg file..."
21 cat << EOF > site.cfg
22 [openblas]
23 include_dirs = ${passthru.blas}/include
24 library_dirs = ${passthru.blas}/lib
25 EOF
26 '';
27
28 checkPhase = ''
29 runHook preCheck
30 pushd dist
31 ${python.interpreter} -c 'import numpy; numpy.test("fast", verbose=10)'
32 popd
33 runHook postCheck
34 '';
35
36 passthru = {
37 blas = blas;
38 };
39
40 # The large file support test is disabled because it takes forever
41 # and can cause the machine to run out of disk space when run.
42 prePatch = ''
43 sed -i 's/test_large_file_support/donttest/' numpy/lib/tests/test_format.py
44 '';
45
46 meta = {
47 description = "Scientific tools for Python";
48 homepage = "http://numpy.scipy.org/";
49 maintainers = with lib.maintainers; [ fridh ];
50 } // (args.meta or {});
51})