1{lib, fetchPypi, python, buildPythonPackage, gfortran, nose, pytest, numpy, fetchpatch}:
2
3buildPythonPackage rec {
4 pname = "scipy";
5 version = "1.1.0";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "878352408424dffaa695ffedf2f9f92844e116686923ed9aa8626fc30d32cfd1";
10 };
11
12 checkInputs = [ nose pytest ];
13 buildInputs = [ gfortran numpy.blas ];
14 propagatedBuildInputs = [ numpy ];
15
16 # Remove tests because of broken wrapper
17 prePatch = ''
18 rm scipy/linalg/tests/test_lapack.py
19 '';
20
21 # INTERNALERROR, solved with https://github.com/scipy/scipy/pull/8871
22 # however, it does not apply cleanly.
23 doCheck = false;
24
25 preConfigure = ''
26 sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py
27 export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
28 '';
29
30 preBuild = ''
31 echo "Creating site.cfg file..."
32 cat << EOF > site.cfg
33 [openblas]
34 include_dirs = ${numpy.blas}/include
35 library_dirs = ${numpy.blas}/lib
36 EOF
37 '';
38
39 enableParallelBuilding = true;
40
41 checkPhase = ''
42 runHook preCheck
43 pushd dist
44 ${python.interpreter} -c 'import scipy; scipy.test("fast", verbose=10)'
45 popd
46 runHook postCheck
47 '';
48
49 passthru = {
50 blas = numpy.blas;
51 };
52
53 setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
54
55 meta = {
56 description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering. ";
57 homepage = https://www.scipy.org/;
58 maintainers = with lib.maintainers; [ fridh ];
59 };
60}