2021-08-22 07:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchPypi
|
|
|
|
, python
|
|
|
|
, buildPythonPackage
|
2021-09-18 10:52:07 +00:00
|
|
|
, cython
|
2021-08-22 07:53:02 +00:00
|
|
|
, gfortran
|
2021-09-18 10:52:07 +00:00
|
|
|
, pythran
|
2021-08-22 07:53:02 +00:00
|
|
|
, nose
|
|
|
|
, pytest
|
|
|
|
, pytest-xdist
|
|
|
|
, numpy
|
|
|
|
, pybind11
|
|
|
|
}:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "scipy";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-nj+xsOiW8UqFqpoo1fdV2q7rVMiXt0bfelXMsCs0DzM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [ cython gfortran pythran ];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [ numpy.blas pybind11 ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkInputs = [ nose pytest pytest-xdist ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Remove tests because of broken wrapper
|
|
|
|
prePatch = ''
|
|
|
|
rm scipy/linalg/tests/test_lapack.py
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
doCheck = !(stdenv.isx86_64 && stdenv.isDarwin);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py
|
|
|
|
export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
ln -s ${numpy.cfg} site.cfg
|
|
|
|
'';
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
# disable stackprotector on aarch64-darwin for now
|
|
|
|
#
|
|
|
|
# build error:
|
|
|
|
#
|
|
|
|
# /private/tmp/nix-build-python3.9-scipy-1.6.3.drv-0/ccDEsw5U.s:109:15: error: index must be an integer in range [-256, 255].
|
|
|
|
#
|
|
|
|
# ldr x0, [x0, ___stack_chk_guard];momd
|
|
|
|
#
|
|
|
|
hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
pushd dist
|
2021-06-28 23:13:55 +00:00
|
|
|
${python.interpreter} -c "import scipy; scipy.test('fast', verbose=10, parallel=$NIX_BUILD_CORES)"
|
2020-04-24 23:36:52 +00:00
|
|
|
popd
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
blas = numpy.blas;
|
|
|
|
};
|
|
|
|
|
|
|
|
setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
|
|
|
|
|
|
|
|
SCIPY_USE_G77_ABI_WRAPPER = 1;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.scipy.org/";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.fridh ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|