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