From ea2c573b3b6a4c0f498cada3c1756f767162683c Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 16 May 2017 09:22:46 +0200 Subject: [PATCH] python.pkgs.scipy: move expression and keep only a single version --- .../{scipy.nix => scipy/default.nix} | 29 ++++++++-------- pkgs/top-level/python-packages.nix | 33 +------------------ 2 files changed, 16 insertions(+), 46 deletions(-) rename pkgs/development/python-modules/{scipy.nix => scipy/default.nix} (62%) diff --git a/pkgs/development/python-modules/scipy.nix b/pkgs/development/python-modules/scipy/default.nix similarity index 62% rename from pkgs/development/python-modules/scipy.nix rename to pkgs/development/python-modules/scipy/default.nix index 023335a5e347..a7428f134a7a 100644 --- a/pkgs/development/python-modules/scipy.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -1,16 +1,17 @@ -{lib, python, buildPythonPackage, isPyPy, gfortran, nose}: +{lib, fetchurl, python, buildPythonPackage, isPyPy, gfortran, nose, numpy}: -args: +buildPythonPackage rec { + pname = "scipy"; + version = "0.19.0"; + name = "${pname}-${version}"; -let - inherit (args) version; - inherit (args) numpy; -in buildPythonPackage (args // rec { + src = fetchurl { + url = "mirror://pypi/s/scipy/scipy-${version}.zip"; + sha256 = "4190d34bf9a09626cd42100bbb12e3d96b2daf1a8a3244e991263eb693732122"; + }; - name = "scipy-${version}"; - - buildInputs = (args.buildInputs or [ gfortran nose ]); - propagatedBuildInputs = (args.propagatedBuildInputs or [ passthru.blas numpy]); + buildInputs = [ gfortran nose numpy.blas ]; + propagatedBuildInputs = [ numpy ]; # Remove tests because of broken wrapper prePatch = '' @@ -25,8 +26,8 @@ in buildPythonPackage (args // rec { echo "Creating site.cfg file..." cat << EOF > site.cfg [openblas] - include_dirs = ${passthru.blas}/include - library_dirs = ${passthru.blas}/lib + include_dirs = ${numpy.blas}/include + library_dirs = ${numpy.blas}/lib EOF ''; @@ -48,5 +49,5 @@ in buildPythonPackage (args // rec { description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering. "; homepage = http://www.scipy.org/; maintainers = with lib.maintainers; [ fridh ]; - } // (args.meta or {}); -}) + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5904a9f8c8f4..1516ccaa94f5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -22740,38 +22740,7 @@ in { }; }; - buildScipyPackage = callPackage ../development/python-modules/scipy.nix { - gfortran = pkgs.gfortran; - }; - - scipy = self.scipy_0_19; - - scipy_0_17 = self.buildScipyPackage rec { - version = "0.17.1"; - src = pkgs.fetchurl { - url = "mirror://pypi/s/scipy/scipy-${version}.tar.gz"; - sha256 = "1b1qpfz2j2rvmlplsjbnznnxnqr9ckbmis506110ii1w07wd4k4w"; - }; - numpy = self.numpy; - }; - - scipy_0_18 = self.buildScipyPackage rec { - version = "0.18.1"; - src = pkgs.fetchurl { - url = "mirror://pypi/s/scipy/scipy-${version}.tar.gz"; - sha256 = "8ab6e9c808bf2fb3e8576cd8cf07226d9cdc18b012c06d9708429a821ac6634e"; - }; - numpy = self.numpy; - }; - - scipy_0_19 = self.buildScipyPackage rec { - version = "0.19.0"; - src = pkgs.fetchurl { - url = "mirror://pypi/s/scipy/scipy-${version}.zip"; - sha256 = "4190d34bf9a09626cd42100bbb12e3d96b2daf1a8a3244e991263eb693732122"; - }; - numpy = self.numpy; - }; + scipy = callPackage ../development/python-modules/scipy { }; scikitimage = buildPythonPackage rec { name = "scikit-image-${version}";