about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qrupdate
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/libraries/qrupdate
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qrupdate')
-rw-r--r--nixpkgs/pkgs/development/libraries/qrupdate/default.nix45
1 files changed, 29 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
index 424502dce0d4..b941021cb688 100644
--- a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
@@ -3,25 +3,35 @@
 , gfortran
 , blas
 , lapack
+, which
 }:
-stdenv.mkDerivation {
-  name = "qrupdate-1.1.2";
+
+stdenv.mkDerivation rec {
+  pname = "qrupdate";
+  version = "1.1.2";
   src = fetchurl {
-    url = "mirror://sourceforge/qrupdate/qrupdate-1.1.2.tar.gz";
+    url = "mirror://sourceforge/qrupdate/${pname}-${version}.tar.gz";
     sha256 = "024f601685phcm1pg8lhif3lpy5j9j0k6n0r46743g4fvh8wg8g2";
   };
 
-  configurePhase =
-    ''
-      export PREFIX=$out
-      sed -i -e 's,^BLAS=.*,BLAS=-L${blas}/lib -lblas,' \
-          -e 's,^LAPACK=.*,LAPACK=-L${lapack}/lib -llapack,' \
-          Makeconf
-    ''
-    + stdenv.lib.optionalString blas.isILP64
-    ''
-      sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/'
-    '';
+  preBuild =
+    # Check that blas and lapack are compatible
+    assert (blas.isILP64 == lapack.isILP64);
+  # We don't have structuredAttrs yet implemented, and we need to use space
+  # seprated values in makeFlags, so only this works.
+  ''
+    makeFlagsArray+=(
+      "LAPACK=-L${lapack}/lib -llapack"
+      "BLAS=-L${blas}/lib -lblas"
+      "PREFIX=${placeholder "out"}"
+      ${stdenv.lib.optionalString blas.isILP64
+      # If another application intends to use qrupdate compiled with blas with
+      # 64 bit support, it should add this to it's FFLAGS as well. See (e.g):
+      # https://savannah.gnu.org/bugs/?50339
+      "FFLAGS=-fdefault-integer-8"
+      }
+    )
+  '';
 
   doCheck = true;
 
@@ -31,12 +41,15 @@ stdenv.mkDerivation {
 
   installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
 
-  buildInputs = [ gfortran blas lapack ];
+  buildInputs = [ gfortran ];
+
+  nativeBuildInputs = [ which ];
 
   meta = with stdenv.lib; {
     description = "Library for fast updating of qr and cholesky decompositions";
     homepage = "https://sourceforge.net/projects/qrupdate/";
-    license = licenses.gpl3;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ doronbehar ];
     platforms = platforms.unix;
   };
 }