Skip to content

Commit

Permalink
python.pkgs.numpy: move and get rid of multiple versions
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed May 16, 2017
1 parent 9174bd2 commit c9b4a2f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
'';

Expand Down Expand Up @@ -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 {});
})
};
}
30 changes: 1 addition & 29 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down

0 comments on commit c9b4a2f

Please sign in to comment.