Files
Sean Gilligan 83c59da4da igraph: enable (and fix) html documentation generation
Add the "html" target to the CMake build. This requires
docbook_xml_dtd_43 and docbook_xsl (catalogs) to build properly.
2026-05-21 13:07:16 -07:00

126 lines
2.3 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
arpack,
bison,
blas,
cmake,
flex,
glpk,
gmp,
lapack,
libxml2,
libxslt,
docbook_xml_dtd_43,
docbook_xsl,
llvmPackages,
pkg-config,
plfit,
python3,
sourceHighlight,
xmlto,
}:
assert (blas.isILP64 == lapack.isILP64 && blas.isILP64 == arpack.isILP64 && !blas.isILP64);
stdenv.mkDerivation (finalAttrs: {
pname = "igraph";
version = "1.0.1";
src = fetchFromGitHub {
owner = "igraph";
repo = "igraph";
tag = finalAttrs.version;
hash = "sha256-mXaW9UOTPN5iM7ZNoV2NjH+2Maez5A/YfABeQRe0vgY=";
};
postPatch = ''
echo "${finalAttrs.version}" > IGRAPH_VERSION
'';
outputs = [
"out"
"dev"
"doc"
];
nativeBuildInputs = [
bison
cmake
flex
libxml2
libxslt
docbook_xml_dtd_43
docbook_xsl
pkg-config
python3
sourceHighlight
xmlto
];
buildInputs = [
arpack
blas
glpk
gmp
lapack
libxml2
plfit
]
++ lib.optionals stdenv.cc.isClang [
llvmPackages.openmp
];
cmakeFlags = [
"-DIGRAPH_USE_INTERNAL_BLAS=OFF"
"-DIGRAPH_USE_INTERNAL_LAPACK=OFF"
"-DIGRAPH_USE_INTERNAL_ARPACK=OFF"
"-DIGRAPH_USE_INTERNAL_GLPK=OFF"
"-DIGRAPH_USE_INTERNAL_GMP=OFF"
"-DIGRAPH_USE_INTERNAL_PLFIT=OFF"
"-DIGRAPH_GLPK_SUPPORT=ON"
"-DIGRAPH_GRAPHML_SUPPORT=ON"
"-DIGRAPH_OPENMP_SUPPORT=ON"
"-DIGRAPH_ENABLE_LTO=AUTO"
"-DIGRAPH_ENABLE_TLS=ON"
"-DBUILD_SHARED_LIBS=ON"
];
buildFlags = [
"all"
"html"
];
doCheck = true;
postInstall = ''
mkdir -p "$out/share"
cp -r doc "$out/share"
'';
postFixup = ''
substituteInPlace $dev/lib/cmake/igraph/igraph-targets.cmake \
--replace-fail "_IMPORT_PREFIX \"$out\"" "_IMPORT_PREFIX \"$dev\""
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib
'';
passthru.tests = {
python = python3.pkgs.igraph;
};
meta = {
description = "C library for complex network analysis and graph theory";
homepage = "https://igraph.org/";
changelog = "https://github.com/igraph/igraph/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
MostAwesomeDude
dotlambda
];
};
})