1{lib, fetchurl, python, buildPythonPackage, isPyPy, gfortran, nose, pytest, numpy}:
2
3buildPythonPackage rec {
4 pname = "scipy";
5 version = "1.0.0";
6 name = "${pname}-${version}";
7
8 src = fetchurl {
9 url = "mirror://pypi/s/scipy/scipy-${version}.tar.gz";
10 sha256 = "87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10";
11 };
12
13 checkInputs = [ nose pytest ];
14 buildInputs = [ gfortran 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 preConfigure = ''
23 sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py
24 export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
25 '';
26
27 preBuild = ''
28 echo "Creating site.cfg file..."
29 cat << EOF > site.cfg
30 [openblas]
31 include_dirs = ${numpy.blas}/include
32 library_dirs = ${numpy.blas}/lib
33 EOF
34 '';
35
36 enableParallelBuilding = true;
37
38 checkPhase = ''
39 runHook preCheck
40 pushd dist
41 ${python.interpreter} -c 'import scipy; scipy.test("fast", verbose=10)'
42 popd
43 runHook postCheck
44 '';
45
46 passthru = {
47 blas = numpy.blas;
48 };
49
50 setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
51
52 meta = {
53 description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering. ";
54 homepage = http://www.scipy.org/;
55 maintainers = with lib.maintainers; [ fridh ];
56 };
57}