1 { lib, stdenv, fetchFromGitHub
2 , useCoefficients ? false
3 , indicateProgress ? false
4 , useGoogleHashmap ? false, sparsehash ? null
5 , fileFormat ? "lowerTriangularCsv"
8 assert lib.assertOneOf "fileFormat" fileFormat
9 ["lowerTriangularCsv" "upperTriangularCsv" "dipha"];
10 assert useGoogleHashmap -> sparsehash != null;
19 src = fetchFromGitHub {
23 sha256 = "sha256-BxmkPQ/nl5cF+xwQMTjXnLgkLgdmT/39y7Kzl2wDfpE=";
26 buildInputs = lib.optional useGoogleHashmap sparsehash;
33 ++ lib.optional useCoefficients "-D USE_COEFFICIENTS"
34 ++ lib.optional indicateProgress "-D INDICATE_PROGRESS"
35 ++ lib.optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP"
36 ++ lib.optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV"
37 ++ lib.optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV"
38 ++ lib.optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"
41 buildPhase = "c++ ripser.cpp -o ripser $buildFlags";
49 description = "Lean C++ code for the computation of Vietoris–Rips persistence barcodes";
50 mainProgram = "ripser";
51 homepage = "https://github.com/Ripser/ripser";
52 license = lib.licenses.lgpl3;
53 maintainers = with lib.maintainers; [erikryb];
54 platforms = lib.platforms.linux;