Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 40 additions & 17 deletions pkgs/development/libraries/science/math/mongoose/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down