summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorBenjamin Hipple <bhipple@protonmail.com>2020-07-07 13:50:29 -0400
committerGitHub <noreply@github.com>2020-07-07 13:50:29 -0400
commit2ec54796895cbb7aad7639e59beb3a7bb0ac09d3 (patch)
tree46d8b33b4d23fb8fad76106e09e47f1d1cacdfb3 /pkgs
parent832a240b12727f543501e688b795aea90bafa575 (diff)
parentdc5113fb06941f88c84a9f58d38eeaf0b8c1399a (diff)
downloadnixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.tar
nixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.tar.gz
nixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.tar.bz2
nixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.tar.lz
nixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.tar.xz
nixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.tar.zst
nixpkgs-2ec54796895cbb7aad7639e59beb3a7bb0ac09d3.zip
Merge pull request #89299 from wucke13/petsc
petsc: add fotran build argument
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/science/math/petsc/default.nix20
1 files changed, 15 insertions, 5 deletions
diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix
index 6eeeda9e928..a4d0850c77f 100644
--- a/pkgs/development/libraries/science/math/petsc/default.nix
+++ b/pkgs/development/libraries/science/math/petsc/default.nix
@@ -2,27 +2,37 @@
 
 stdenv.mkDerivation rec {
   pname = "petsc";
-  version = "3.13.1";
+  version = "3.13.2";
 
   src = fetchurl {
     url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${version}.tar.gz";
-    sha256 = "0pr604b9pnryl9q0q5arlhs0xdx7wslca0sbz0pzs9qylmz775qp";
+    sha256 = "0yf5lm8dqpbz1yq9nvd5g2iy2w0rgjp9vcj44ba63rwig37j3clp";
   };
 
-  nativeBuildInputs = [ blas gfortran.cc.lib lapack python ];
+  nativeBuildInputs = [ blas gfortran gfortran.cc.lib lapack python ];
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  # Upstream does some hot she-py-bang stuff, this change streamlines that
+  # process. The original script in upstream is both a shell script and a
+  # python script, where the shellscript just finds a suitable python
+  # interpreter to execute the python script. See
+  # https://github.com/NixOS/nixpkgs/pull/89299#discussion_r450203444 
+  # for more details.
+  prePatch = ''
+    substituteInPlace configure \
+      --replace /bin/sh /usr/bin/python
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
     substituteInPlace config/install.py \
       --replace /usr/bin/install_name_tool install_name_tool
   '';
 
   preConfigure = ''
+    export FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran"
     patchShebangs .
     configureFlagsArray=(
       $configureFlagsArray
       "--CC=$CC"
       "--with-cxx=$CXX"
-      "--with-fc=0"
+      "--with-fc=$FC"
       "--with-mpi=0"
       "--with-blas-lib=[${blas}/lib/libblas.so,${gfortran.cc.lib}/lib/libgfortran.a]"
       "--with-lapack-lib=[${lapack}/lib/liblapack.so,${gfortran.cc.lib}/lib/libgfortran.a]"