1{
2 buildPythonPackage,
3 lib,
4 fetchurl,
5 stdenv,
6
7 boost,
8 cairomm,
9 cgal,
10 expat,
11 gmp,
12 gobject-introspection,
13 gtk3,
14 llvmPackages,
15 matplotlib,
16 mpfr,
17 numpy,
18 pkg-config,
19 pycairo,
20 pygobject3,
21 python,
22 scipy,
23 sparsehash,
24 gitUpdater,
25}:
26
27let
28 boost' = boost.override {
29 enablePython = true;
30 inherit python;
31 };
32in
33buildPythonPackage rec {
34 pname = "graph-tool";
35 version = "2.97";
36 format = "other";
37
38 src = fetchurl {
39 url = "https://downloads.skewed.de/graph-tool/graph-tool-${version}.tar.bz2";
40 hash = "sha256-Yt2PuLuvvv4iNcv6UHzr5lTwFkReVtVO/znSADkxjKU=";
41 };
42
43 postPatch = ''
44 # remove error messages about tput during build process without adding ncurses
45 substituteInPlace configure \
46 --replace-fail 'tput setaf $1' : \
47 --replace-fail 'tput sgr0' :
48 '';
49
50 configureFlags = [
51 "--with-python-module-path=$(out)/${python.sitePackages}"
52 "--with-boost-libdir=${boost'}/lib"
53 "--with-cgal=${cgal}"
54 ];
55
56 enableParallelBuilding = true;
57
58 build-system = [ pkg-config ];
59
60 # https://graph-tool.skewed.de/installation.html#manual-compilation
61 dependencies = [
62 boost'
63 cairomm
64 cgal
65 expat
66 gmp
67 gobject-introspection
68 gtk3
69 matplotlib
70 mpfr
71 numpy
72 pycairo
73 pygobject3
74 scipy
75 sparsehash
76 ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
77
78 pythonImportsCheck = [ "graph_tool" ];
79
80 passthru.updateScript = gitUpdater {
81 url = "https://git.skewed.de/count0/graph-tool";
82 rev-prefix = "release-";
83 };
84
85 meta = {
86 description = "Python module for manipulation and statistical analysis of graphs";
87 homepage = "https://graph-tool.skewed.de";
88 changelog = "https://git.skewed.de/count0/graph-tool/commits/release-${version}";
89 license = lib.licenses.lgpl3Plus;
90 maintainers = [ lib.maintainers.mjoerg ];
91 };
92}