504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
111 lines
2.2 KiB
Nix
111 lines
2.2 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
, arpack
|
|
, bison
|
|
, blas
|
|
, cmake
|
|
, flex
|
|
, fop
|
|
, glpk
|
|
, gmp
|
|
, lapack
|
|
, libxml2
|
|
, libxslt
|
|
, llvmPackages
|
|
, pkg-config
|
|
, plfit
|
|
, python3
|
|
, sourceHighlight
|
|
, xmlto
|
|
}:
|
|
|
|
assert (blas.isILP64 == lapack.isILP64 &&
|
|
blas.isILP64 == arpack.isILP64 &&
|
|
!blas.isILP64);
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "igraph";
|
|
version = "0.10.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "igraph";
|
|
repo = finalAttrs.pname;
|
|
rev = finalAttrs.version;
|
|
hash = "sha256-suma1iS9NdJwU/4EQl6qoFyD4bErLSkY+0yxgh3dHkw=";
|
|
};
|
|
|
|
postPatch = ''
|
|
echo "${finalAttrs.version}" > IGRAPH_VERSION
|
|
''
|
|
# https://github.com/igraph/igraph/issues/2340
|
|
+ lib.optionalString stdenv.isDarwin ''
|
|
sed -i "/safelocale/d" tests/CMakeLists.txt
|
|
'';
|
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
nativeBuildInputs = [
|
|
bison
|
|
cmake
|
|
flex
|
|
fop
|
|
libxml2
|
|
libxslt
|
|
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"
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
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
|
|
'';
|
|
|
|
passthru.tests = {
|
|
python = python3.pkgs.igraph;
|
|
};
|
|
|
|
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";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ MostAwesomeDude dotlambda ];
|
|
};
|
|
})
|