From c9b4a2f319914fe31eb8eee866ad47052824c697 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 16 May 2017 09:22:07 +0200 Subject: [PATCH] python.pkgs.numpy: move and get rid of multiple versions --- .../{numpy.nix => numpy/default.nix} | 27 +++++++++-------- .../{ => numpy}/numpy-distutils-C++.patch | 0 pkgs/top-level/python-packages.nix | 30 +------------------ 3 files changed, 15 insertions(+), 42 deletions(-) rename pkgs/development/python-modules/{numpy.nix => numpy/default.nix} (69%) rename pkgs/development/python-modules/{ => numpy}/numpy-distutils-C++.patch (100%) diff --git a/pkgs/development/python-modules/numpy.nix b/pkgs/development/python-modules/numpy/default.nix similarity index 69% rename from pkgs/development/python-modules/numpy.nix rename to pkgs/development/python-modules/numpy/default.nix index 16c919eb4b2e..d427a33f80f4 100644 --- a/pkgs/development/python-modules/numpy.nix +++ b/pkgs/development/python-modules/numpy/default.nix @@ -1,16 +1,17 @@ -{lib, python, buildPythonPackage, isPy27, isPyPy, gfortran, nose, blas}: +{lib, fetchurl, python, buildPythonPackage, isPy27, isPyPy, gfortran, nose, blas}: -args: +buildPythonPackage rec { + pname = "numpy"; + version = "1.12.1"; + name = "${pname}-${version}"; -let - inherit (args) version; -in buildPythonPackage (args // rec { - - name = "numpy-${version}"; + src = fetchurl { + url = "mirror://pypi/n/numpy/numpy-${version}.zip"; + sha256 = "a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542"; + }; disabled = isPyPy; - buildInputs = args.buildInputs or [ gfortran nose ]; - propagatedBuildInputs = args.propagatedBuildInputs or [ passthru.blas ]; + buildInputs = [ gfortran nose blas ]; patches = lib.optionals (python.hasDistutilsCxxPatch or false) [ # See cpython 2.7 patches. @@ -26,8 +27,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 = ${blas}/include + library_dirs = ${blas}/lib EOF ''; @@ -56,5 +57,5 @@ in buildPythonPackage (args // rec { description = "Scientific tools for Python"; homepage = "http://numpy.scipy.org/"; maintainers = with lib.maintainers; [ fridh ]; - } // (args.meta or {}); -}) + }; +} diff --git a/pkgs/development/python-modules/numpy-distutils-C++.patch b/pkgs/development/python-modules/numpy/numpy-distutils-C++.patch similarity index 100% rename from pkgs/development/python-modules/numpy-distutils-C++.patch rename to pkgs/development/python-modules/numpy/numpy-distutils-C++.patch diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d529473acb2e..5904a9f8c8f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15814,38 +15814,10 @@ in { }; }; - - buildNumpyPackage = callPackage ../development/python-modules/numpy.nix { - gfortran = pkgs.gfortran; + numpy = callPackage ../development/python-modules/numpy { blas = pkgs.openblasCompat; }; - numpy = self.numpy_1_12; - - numpy_1_10 = self.buildNumpyPackage rec { - version = "1.10.4"; - src = pkgs.fetchurl { - url = "mirror://pypi/n/numpy/numpy-${version}.tar.gz"; - sha256 = "7356e98fbcc529e8d540666f5a919912752e569150e9a4f8d869c686f14c720b"; - }; - }; - - numpy_1_11 = self.buildNumpyPackage rec { - version = "1.11.3"; - src = pkgs.fetchurl { - url = "mirror://pypi/n/numpy/numpy-${version}.zip"; - sha256 = "2e0fc5248246a64628656fe14fcab0a959741a2820e003bd15538226501b82f7"; - }; - }; - - numpy_1_12 = self.buildNumpyPackage rec { - version = "1.12.1"; - src = pkgs.fetchurl { - url = "mirror://pypi/n/numpy/numpy-${version}.zip"; - sha256 = "a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542"; - }; - }; - numpydoc = buildPythonPackage rec { pname = "numpydoc"; name = "${pname}-${version}";