1{ stdenv
2, file
3, lib
4, fetchFromGitHub
5, autoreconfHook
6, bison
7, flex
8, pkg-config
9, doxygen
10, graphviz
11, mscgen
12, asciidoc
13, sourceHighlight
14, pythonSupport ? false
15, swig ? null
16, python ? null
17}:
18
19stdenv.mkDerivation rec {
20 pname = "libnl";
21 version = "3.8.0";
22
23 src = fetchFromGitHub {
24 repo = "libnl";
25 owner = "thom311";
26 rev = "libnl${lib.replaceStrings ["."] ["_"] version}";
27 hash = "sha256-zVpoRlB5xDfo6wJkCJGGptuCXkNkriudtZF2Job9YD4=";
28 };
29
30 outputs = [ "bin" "dev" "out" "man" ] ++ lib.optional pythonSupport "py";
31
32 enableParallelBuilding = true;
33
34 nativeBuildInputs = [
35 autoreconfHook
36 bison
37 flex
38 pkg-config
39 file
40 doxygen
41 graphviz
42 mscgen
43 asciidoc
44 sourceHighlight
45 ] ++ lib.optional pythonSupport swig;
46
47 postBuild = lib.optionalString (pythonSupport) ''
48 cd python
49 ${python.pythonOnBuildForHost.interpreter} setup.py install --prefix=../pythonlib
50 cd -
51 '';
52
53 postFixup = lib.optionalString pythonSupport ''
54 mv "pythonlib/" "$py"
55 '';
56
57 passthru = {
58 inherit pythonSupport;
59 };
60
61 meta = with lib; {
62 homepage = "http://www.infradead.org/~tgr/libnl/";
63 description = "Linux Netlink interface library suite";
64 license = licenses.lgpl21;
65 maintainers = with maintainers; [ fpletz ];
66 platforms = platforms.linux;
67 };
68}