From 3d6a8c2ea5acf343b380daa5d19bc2b9fd1bbe8c Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 31 Mar 2023 16:16:46 +0300 Subject: [PATCH] mongoose: 2.0.4 -> 3.0.4 --- .../science/math/mongoose/default.nix | 57 +++++++++++++------ 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/science/math/mongoose/default.nix b/pkgs/development/libraries/science/math/mongoose/default.nix index c7348c9e4a98..e48658b19b82 100644 --- a/pkgs/development/libraries/science/math/mongoose/default.nix +++ b/pkgs/development/libraries/science/math/mongoose/default.nix @@ -3,40 +3,63 @@ , fetchFromGitHub , fetchpatch , cmake +, blas }: +let + suitesparseVersion = "7.0.1"; +in stdenv.mkDerivation rec { pname = "mongoose"; - version = "2.0.4"; + version = "3.0.4"; outputs = [ "bin" "out" "dev" ]; src = fetchFromGitHub { - owner = "ScottKolo"; - repo = "Mongoose"; - rev = "v${version}"; - sha256 = "0ymwd4n8p8s0ndh1vcbmjcsm0x2cc2b7v3baww5y6as12873bcrh"; + owner = "DrTimothyAldenDavis"; + repo = "SuiteSparse"; + rev = "v${suitesparseVersion}"; + hash = "sha256-EIreweeOx44YDxlnxnJ7l31Ie1jSx6y87VAyEX+4NsQ="; }; - patches = [ - # TODO: remove on next release - (fetchpatch { - name = "add-an-option-to-disable-coverage.patch"; - url = "https://github.com/ScottKolo/Mongoose/commit/39f4a0059ff7bad5bffa84369f31839214ac7877.patch"; - sha256 = "sha256-V8lCq22ixCCzLmKtW6bUL8cvJFZzdgYoA4BFs4xYd3c="; - }) - ]; - nativeBuildInputs = [ cmake ]; - # ld: file not found: libclang_rt.profile_osx.a - cmakeFlags = lib.optional (stdenv.isDarwin && stdenv.isAarch64) "-DENABLE_COVERAGE=OFF"; + buildInputs = [ + blas + ]; + + dontUseCmakeConfigure = true; + + cmakeFlags = [ + "-DBLAS_LIBRARIES=${blas}" + "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" + ]; + + buildPhase = '' + runHook preConfigure + + for f in SuiteSparse_config Mongoose; do + (cd $f && cmakeConfigurePhase && make -j$NIX_BUILD_CORES) + done + + runHook postConfigure + ''; + + installPhase = '' + runHook preInstall + + for f in SuiteSparse_config Mongoose; do + (cd $f/build && make install -j$NIX_BUILD_CORES) + done + + runHook postInstall + ''; meta = with lib; { description = "Graph Coarsening and Partitioning Library"; - homepage = "https://github.com/ScottKolo/Mongoose"; + homepage = "https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/Mongoose"; license = licenses.gpl3Only; maintainers = with maintainers; [ wegank ]; platforms = with platforms; unix;