about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/numpy')
-rw-r--r--nixpkgs/pkgs/development/python-modules/numpy/default.nix22
1 files changed, 13 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/numpy/default.nix b/nixpkgs/pkgs/development/python-modules/numpy/default.nix
index 92bcb131ab19..949d5e5898b3 100644
--- a/nixpkgs/pkgs/development/python-modules/numpy/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/numpy/default.nix
@@ -5,21 +5,23 @@
 , gfortran
 , pytest
 , blas
+, lapack
 , writeTextFile
 , isPyPy
 , cython
 , setuptoolsBuildHook
  }:
 
+assert (!blas.is64bit) && (!lapack.is64bit);
+
 let
-  blasImplementation = lib.nameFromURL blas.name "-";
   cfg = writeTextFile {
     name = "site.cfg";
     text = (lib.generators.toINI {} {
-      ${blasImplementation} = {
-        include_dirs = "${blas}/include";
-        library_dirs = "${blas}/lib";
-      } // lib.optionalAttrs (blasImplementation == "mkl") {
+      ${blas.implementation} = {
+        include_dirs = "${blas}/include:${lapack}/include";
+        library_dirs = "${blas}/lib:${lapack}/lib";
+      } // lib.optionalAttrs (blas.implementation == "mkl") {
         mkl_libs = "mkl_rt";
         lapack_libs = "";
       };
@@ -37,7 +39,7 @@ in buildPythonPackage rec {
   };
 
   nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
-  buildInputs = [ blas ];
+  buildInputs = [ blas lapack ];
 
   patches = lib.optionals python.hasDistutilsCxxPatch [
     # We patch cpython/distutils to fix https://bugs.python.org/issue1222585
@@ -68,8 +70,10 @@ in buildPythonPackage rec {
   '';
 
   passthru = {
-    blas = blas;
-    inherit blasImplementation cfg;
+    # just for backwards compatibility
+    blas = blas.provider;
+    blasImplementation = blas.implementation;
+    inherit cfg;
   };
 
   # Disable test
@@ -78,7 +82,7 @@ in buildPythonPackage rec {
 
   meta = {
     description = "Scientific tools for Python";
-    homepage = https://numpy.org/;
+    homepage = "https://numpy.org/";
     maintainers = with lib.maintainers; [ fridh ];
   };
 }