1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, pkg-config
6, igraph
7, texttable
8, unittestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "igraph";
13 version = "0.11.2";
14
15 disabled = pythonOlder "3.8";
16
17 format = "setuptools";
18
19 src = fetchFromGitHub {
20 owner = "igraph";
21 repo = "python-igraph";
22 rev = "refs/tags/${version}";
23 hash = "sha256-evYnUv2PWO+LbVBBQPa708dQb8Wq8SQ92bJ6clQNV/g=";
24 };
25
26 postPatch = ''
27 rm -r vendor
28 '';
29
30 nativeBuildInputs = [
31 pkg-config
32 ];
33
34 buildInputs = [
35 igraph
36 ];
37
38 propagatedBuildInputs = [
39 texttable
40 ];
41
42 # NB: We want to use our igraph, not vendored igraph, but even with
43 # pkg-config on the PATH, their custom setup.py still needs to be explicitly
44 # told to do it. ~ C.
45 setupPyGlobalFlags = [ "--use-pkg-config" ];
46
47 nativeCheckInputs = [
48 unittestCheckHook
49 ];
50
51 pythonImportsCheck = [ "igraph" ];
52
53 meta = with lib; {
54 description = "High performance graph data structures and algorithms";
55 homepage = "https://igraph.org/python/";
56 changelog = "https://github.com/igraph/python-igraph/blob/${src.rev}/CHANGELOG.md";
57 license = licenses.gpl2Plus;
58 maintainers = with maintainers; [ MostAwesomeDude dotlambda ];
59 };
60}