2021-03-20 04:20:00 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, arpack
|
|
|
|
, bison
|
|
|
|
, blas
|
|
|
|
, cmake
|
|
|
|
, flex
|
|
|
|
, fop
|
|
|
|
, glpk
|
|
|
|
, gmp
|
|
|
|
, lapack
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
2022-04-15 01:41:22 +00:00
|
|
|
, llvmPackages
|
2021-03-20 04:20:00 +00:00
|
|
|
, pkg-config
|
2022-04-15 01:41:22 +00:00
|
|
|
, plfit
|
2021-03-20 04:20:00 +00:00
|
|
|
, python3
|
|
|
|
, sourceHighlight
|
|
|
|
, suitesparse
|
|
|
|
, xmlto
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "igraph";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "0.9.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "igraph";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-SL9PcT18vFvykCv4VRXxXtlcDAcybmwEImnnKXMciFQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-07-18 16:06:22 +00:00
|
|
|
echo "${version}" > IGRAPH_VERSION
|
2021-03-20 04:20:00 +00:00
|
|
|
'' + lib.optionalString stdenv.isAarch64 ''
|
|
|
|
# https://github.com/igraph/igraph/issues/1694
|
|
|
|
substituteInPlace tests/CMakeLists.txt \
|
|
|
|
--replace "igraph_scg_grouping3" "" \
|
|
|
|
--replace "igraph_scg_semiprojectors2" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-04-18 02:13:31 +00:00
|
|
|
bison
|
2021-03-20 04:20:00 +00:00
|
|
|
cmake
|
2021-04-18 02:13:31 +00:00
|
|
|
flex
|
2021-03-20 04:20:00 +00:00
|
|
|
fop
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
sourceHighlight
|
|
|
|
xmlto
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
arpack
|
|
|
|
blas
|
|
|
|
glpk
|
|
|
|
gmp
|
|
|
|
lapack
|
|
|
|
libxml2
|
2022-04-15 01:41:22 +00:00
|
|
|
plfit
|
2021-03-20 04:20:00 +00:00
|
|
|
suitesparse
|
2022-04-15 01:41:22 +00:00
|
|
|
] ++ lib.optionals stdenv.cc.isClang [
|
|
|
|
llvmPackages.openmp
|
2021-03-20 04:20:00 +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_CXSPARSE=OFF"
|
|
|
|
"-DIGRAPH_USE_INTERNAL_GMP=OFF"
|
2022-04-15 01:41:22 +00:00
|
|
|
"-DIGRAPH_USE_INTERNAL_PLFIT=OFF"
|
2021-03-20 04:20:00 +00:00
|
|
|
"-DIGRAPH_GLPK_SUPPORT=ON"
|
|
|
|
"-DIGRAPH_GRAPHML_SUPPORT=ON"
|
2022-04-15 01:41:22 +00:00
|
|
|
"-DIGRAPH_OPENMP_SUPPORT=ON"
|
2021-05-20 23:08:51 +00:00
|
|
|
"-DIGRAPH_ENABLE_LTO=AUTO"
|
2021-03-20 04:20:00 +00:00
|
|
|
"-DIGRAPH_ENABLE_TLS=ON"
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# needed to find libigraph, and liblas on darwin
|
|
|
|
preCheck = if stdenv.isDarwin then ''
|
|
|
|
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [ blas ]}:$PWD/src"
|
|
|
|
'' else ''
|
2021-03-20 04:20:00 +00:00
|
|
|
export LD_LIBRARY_PATH="$PWD/src"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share"
|
|
|
|
cp -r doc "$out/share"
|
|
|
|
'';
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
postFixup = lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib
|
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The network analysis package";
|
|
|
|
homepage = "https://igraph.org/";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ MostAwesomeDude dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|