From efff65834a789ddf58e1dc2a60568e1a5dfccd17 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 23 Nov 2024 23:40:01 +0000 Subject: [PATCH] superlu: 5.2.1 -> 7.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Includes fixes for GCC 14. Also addresses non‐free code already removed by Debian. If there’s demand for this functionality it could be re‐added under a flag. --- pkgs/by-name/su/superlu/package.nix | 63 ++++++++++++++++++----------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/pkgs/by-name/su/superlu/package.nix b/pkgs/by-name/su/superlu/package.nix index 4f52c2d6c507..9d9dfa5fe3d3 100644 --- a/pkgs/by-name/su/superlu/package.nix +++ b/pkgs/by-name/su/superlu/package.nix @@ -1,44 +1,59 @@ -{ lib, stdenv, fetchurl, cmake, +{ lib, stdenv, fetchFromGitHub, fetchurl, cmake, ninja, gfortran, blas, lapack}: assert (!blas.isILP64) && (!lapack.isILP64); -stdenv.mkDerivation rec { - version = "5.2.1"; +stdenv.mkDerivation (finalAttrs: { pname = "superlu"; + version = "7.0.0"; - src = fetchurl { - url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_${version}.tar.gz"; - sha256 = "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"; + src = fetchFromGitHub { + owner = "xiaoyeli"; + repo = "superlu"; + rev = "refs/tags/v${finalAttrs.version}"; + # Remove non‐free files. + # + # See: + # * + # * + # * + postFetch = "rm $out/SRC/mc64ad.* $out/DOC/*.pdf"; + hash = "sha256-iJiVyY+/vr6kll8FCunvZ8rKBj+w+Rnj4F696XW9xFc="; }; - nativeBuildInputs = [ cmake gfortran ]; + patches = [ + (fetchurl { + url = "https://salsa.debian.org/science-team/superlu/-/raw/fae141179928d1cc5a8e381503e8b1264d297c3d/debian/patches/mc64ad-stub.patch"; + hash = "sha256-QUaNUDaRghTqr6jk1TE6a7CdXABqu7xAkYZDhL/lZBQ="; + }) + ]; + + nativeBuildInputs = [ cmake ninja gfortran ]; propagatedBuildInputs = [ blas ]; cmakeFlags = [ - "-DBUILD_SHARED_LIBS=true" - "-DUSE_XSDK_DEFAULTS=true" - ]; - - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=implicit-function-declaration" - "-Wno-error=implicit-int" - ]; - }; - - patches = [ - ./add-superlu-lib-as-dependency-for-the-unit-tests.patch + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeBool "enable_fortran" true) ]; doCheck = true; - checkTarget = "test"; meta = { - homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"; - license = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/License.txt"; + homepage = "https://portal.nersc.gov/project/sparse/superlu/"; + license = [ + lib.licenses.bsd3Lbnl + + # Xerox code; actually `Boehm-GC` variant. + lib.licenses.mit + + # University of Minnesota example files. + lib.licenses.gpl2Plus + + # University of Florida code; permissive COLAMD licence. + lib.licenses.free + ]; description = "Library for the solution of large, sparse, nonsymmetric systems of linear equations"; platforms = lib.platforms.unix; }; -} +})