nixpkgs/pkgs/development/libraries/igraph/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

108 lines
2.0 KiB
Nix
Raw Normal View History

2021-03-24 18:52:27 +00:00
{ stdenv
, lib
, fetchFromGitHub
, arpack
, bison
, blas
, cmake
, flex
, fop
, glpk
, gmp
, lapack
, libxml2
, libxslt
, llvmPackages
2021-03-24 18:52:27 +00:00
, pkg-config
, plfit
2021-03-24 18:52:27 +00:00
, python3
, sourceHighlight
, xmlto
}:
2018-06-26 03:33:09 +00:00
assert (blas.isILP64 == lapack.isILP64 &&
blas.isILP64 == arpack.isILP64 &&
!blas.isILP64);
stdenv.mkDerivation (finalAttrs: {
pname = "igraph";
version = "0.10.7";
2018-06-26 03:33:09 +00:00
src = fetchFromGitHub {
owner = "igraph";
repo = finalAttrs.pname;
rev = finalAttrs.version;
hash = "sha256-1ge5V9G2jmIWQE5TW7+6cXCV9viFkhcnjpYrLQVLrgg=";
2018-06-26 03:33:09 +00:00
};
postPatch = ''
echo "${finalAttrs.version}" > IGRAPH_VERSION
2018-06-26 03:33:09 +00:00
'';
2021-03-24 18:52:27 +00:00
outputs = [ "out" "dev" "doc" ];
nativeBuildInputs = [
bison
2021-03-24 18:52:27 +00:00
cmake
flex
2021-03-24 18:52:27 +00:00
fop
libxml2
libxslt
pkg-config
python3
sourceHighlight
xmlto
];
buildInputs = [
arpack
blas
glpk
gmp
lapack
libxml2
plfit
] ++ lib.optionals stdenv.cc.isClang [
llvmPackages.openmp
2021-03-24 18:52:27 +00:00
];
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"
2021-03-24 18:52:27 +00:00
"-DIGRAPH_GLPK_SUPPORT=ON"
"-DIGRAPH_GRAPHML_SUPPORT=ON"
"-DIGRAPH_OPENMP_SUPPORT=ON"
"-DIGRAPH_ENABLE_LTO=AUTO"
2021-03-24 18:52:27 +00:00
"-DIGRAPH_ENABLE_TLS=ON"
"-DBUILD_SHARED_LIBS=ON"
];
doCheck = true;
2021-03-24 18:52:27 +00:00
postInstall = ''
mkdir -p "$out/share"
cp -r doc "$out/share"
'';
postFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib
'';
2023-09-08 05:30:24 +00:00
passthru.tests = {
python = python3.pkgs.igraph;
};
2021-03-24 18:52:27 +00:00
meta = with lib; {
description = "C library for complex network analysis and graph theory";
homepage = "https://igraph.org/";
changelog = "https://github.com/igraph/igraph/blob/${finalAttrs.src.rev}/CHANGELOG.md";
2021-03-24 18:52:27 +00:00
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ MostAwesomeDude dotlambda ];
2018-06-26 03:33:09 +00:00
};
})