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

107 lines
2.1 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
, pkg-config
, python3
, sourceHighlight
, suitesparse
, xmlto
}:
2018-06-26 03:33:09 +00:00
stdenv.mkDerivation rec {
pname = "igraph";
version = "0.9.3";
2018-06-26 03:33:09 +00:00
src = fetchFromGitHub {
owner = "igraph";
repo = pname;
2018-06-26 03:33:09 +00:00
rev = version;
sha256 = "sha256-StRXtP2PelPcS+l5O1AOVFkza3hiKFwCdp8XLal4grE=";
2018-06-26 03:33:09 +00:00
};
# Normally, igraph wants us to call bootstrap.sh, which will call
# tools/getversion.sh. Instead, we're going to put the version directly
# where igraph wants, and then let autoreconfHook do the rest of the
# bootstrap. ~ C.
2018-06-26 03:33:09 +00:00
postPatch = ''
echo "${version}" > IGRAPH_VERSION
2021-03-24 18:52:27 +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" ""
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
suitesparse
];
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"
"-DIGRAPH_GLPK_SUPPORT=ON"
"-DIGRAPH_GRAPHML_SUPPORT=ON"
"-DIGRAPH_ENABLE_LTO=AUTO"
2021-03-24 18:52:27 +00:00
"-DIGRAPH_ENABLE_TLS=ON"
"-DBUILD_SHARED_LIBS=ON"
];
doCheck = true;
# 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-24 18:52:27 +00:00
export LD_LIBRARY_PATH="$PWD/src"
'';
postInstall = ''
mkdir -p "$out/share"
cp -r doc "$out/share"
'';
meta = with lib; {
2018-06-26 03:33:09 +00:00
description = "The network analysis package";
homepage = "https://igraph.org/";
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
};
}