1{lib, fetchurl, python, buildPythonPackage, isPyPy, gfortran, nose, numpy}:
2
3buildPythonPackage rec {
4 pname = "scipy";
5 version = "0.19.1";
6 name = "${pname}-${version}";
7
8 src = fetchurl {
9 url = "mirror://pypi/s/scipy/scipy-${version}.tar.gz";
10 sha256 = "a19a2ca7a7336495ec180adeaa0dfdcf41e96dbbee90d51c3ed828ba570884e6";
11 };
12
13 buildInputs = [ gfortran nose 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 preConfigure = ''
22 sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py
23 export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
24 '';
25
26 preBuild = ''
27 echo "Creating site.cfg file..."
28 cat << EOF > site.cfg
29 [openblas]
30 include_dirs = ${numpy.blas}/include
31 library_dirs = ${numpy.blas}/lib
32 EOF
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 = http://www.scipy.org/;
54 maintainers = with lib.maintainers; [ fridh ];
55 };
56}