summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-07-13 00:05:23 +0000
committerGitHub <noreply@github.com>2021-07-13 00:05:23 +0000
commit10be3b5eed4879ef52d86537c23e8e59f788335f (patch)
treeccbaea2e34d0fe77e5f5823ed72d2e6a5855c73c /pkgs/development/libraries
parent707671dae2502ff8b67b863dd514bdd6018ab569 (diff)
parent057515d569de49287277a1c3920e9a4902becb14 (diff)
downloadnixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.tar
nixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.tar.gz
nixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.tar.bz2
nixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.tar.lz
nixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.tar.xz
nixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.tar.zst
nixpkgs-10be3b5eed4879ef52d86537c23e8e59f788335f.zip
Merge master into haskell-updates
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/java/saxon/default.nix6
-rw-r--r--pkgs/development/libraries/science/math/petsc/default.nix77
2 files changed, 55 insertions, 28 deletions
diff --git a/pkgs/development/libraries/java/saxon/default.nix b/pkgs/development/libraries/java/saxon/default.nix
index e6f2fcadbe7..da1e6120da6 100644
--- a/pkgs/development/libraries/java/saxon/default.nix
+++ b/pkgs/development/libraries/java/saxon/default.nix
@@ -1,7 +1,7 @@
-{ lib, stdenv, fetchurl, unzip, jre }:
+{ lib, stdenv, fetchurl, unzip, jre, jre8 }:
 
 let
-  common = { pname, version, src, description
+  common = { pname, version, src, description, java ? jre
            , prog ? null, jar ? null, license ? lib.licenses.mpl20 }:
     stdenv.mkDerivation {
       name = "${pname}-${version}";
@@ -45,6 +45,7 @@ in {
     description = "XSLT 1.0 processor";
     # http://saxon.sourceforge.net/saxon6.5.3/conditions.html
     license = lib.licenses.mpl10;
+    java = jre8;
   };
 
   saxonb_8_8 = common {
@@ -56,6 +57,7 @@ in {
       sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
     };
     description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
+    java = jre8;
   };
 
   saxonb_9_1 = common {
diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix
index f06a028fe64..ee495deedc1 100644
--- a/pkgs/development/libraries/science/math/petsc/default.nix
+++ b/pkgs/development/libraries/science/math/petsc/default.nix
@@ -1,4 +1,20 @@
-{ lib, stdenv , darwin , fetchurl , blas , gfortran , lapack , python }:
+{ lib
+, stdenv
+, fetchurl
+, darwin
+, gfortran
+, python3
+, blas
+, lapack
+, mpi                   # generic mpi dependency
+, openssh               # required for openmpi tests
+, petsc-withp4est ? true
+, p4est
+, zlib                  # propagated by p4est but required by petsc
+}:
+
+# This version of PETSc does not support a non-MPI p4est build
+assert petsc-withp4est -> p4est.mpiSupport;
 
 stdenv.mkDerivation rec {
   pname = "petsc";
@@ -9,44 +25,53 @@ stdenv.mkDerivation rec {
     sha256 = "04vy3qyakikslc58qyv8c9qrwlivix3w6znc993i37cvfg99dch9";
   };
 
-  nativeBuildInputs = [ blas gfortran gfortran.cc.lib lapack python ];
-
-  # 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
-  '' + lib.optionalString stdenv.isDarwin ''
+  mpiSupport = !withp4est || p4est.mpiSupport;
+  withp4est = petsc-withp4est;
+
+  nativeBuildInputs = [ python3 gfortran ];
+  buildInputs = [ blas lapack ]
+    ++ lib.optional mpiSupport mpi
+    ++ lib.optional (mpiSupport && mpi.pname == "openmpi") openssh
+    ++ lib.optional withp4est p4est
+  ;
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace config/install.py \
       --replace /usr/bin/install_name_tool ${darwin.cctools}/bin/install_name_tool
   '';
 
   preConfigure = ''
     export FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran"
-    patchShebangs .
+    patchShebangs ./lib/petsc/bin
     configureFlagsArray=(
       $configureFlagsArray
-      "--CC=$CC"
-      "--with-cxx=$CXX"
-      "--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]"
+      ${if !mpiSupport then ''
+        "--with-mpi=0"
+      '' else ''
+        "--CC=mpicc"
+        "--with-cxx=mpicxx"
+        "--with-fc=mpif90"
+        "--with-mpi=1"
+      ''}
+      ${if withp4est then ''
+        "--with-p4est=1"
+        "--with-zlib-include=${zlib.dev}/include"
+        "--with-zlib-lib=-L${zlib}/lib -lz"
+      '' else ""}
+      "--with-blas=1"
+      "--with-lapack=1"
     )
   '';
 
+  configureScript = "python ./configure";
+
+  enableParallelBuilding = true;
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+
   meta = with lib; {
-    description = ''
-      Library of linear algebra algorithms for solving partial differential
-      equations
-    '';
+    description = "Portable Extensible Toolkit for Scientific computation";
     homepage = "https://www.mcs.anl.gov/petsc/index.html";
     license = licenses.bsd2;
-    maintainers = with maintainers; [ wucke13 ];
-    platforms = platforms.all;
+    maintainers = with maintainers; [ wucke13 cburstedde ];
   };
 }