1{ stdenv, file, lib, fetchFromGitHub, autoreconfHook, bison, flex, pkg-config
2, pythonSupport ? false, swig ? null, python ? null}:
3
4stdenv.mkDerivation rec {
5 pname = "libnl";
6 version = "3.7.0";
7
8 src = fetchFromGitHub {
9 repo = "libnl";
10 owner = "thom311";
11 rev = "libnl${lib.replaceStrings ["."] ["_"] version}";
12 sha256 = "sha256-Ty9NdWKWB29MTRfG5OJlSE0mSTN3Wy+sR4KtuExXcB4=";
13 };
14
15 outputs = [ "bin" "dev" "out" "man" ] ++ lib.optional pythonSupport "py";
16
17 enableParallelBuilding = true;
18
19 nativeBuildInputs = [ autoreconfHook bison flex pkg-config file ]
20 ++ lib.optional pythonSupport swig;
21
22 postBuild = lib.optionalString (pythonSupport) ''
23 cd python
24 ${python.pythonOnBuildForHost.interpreter} setup.py install --prefix=../pythonlib
25 cd -
26 '';
27
28 postFixup = lib.optionalString pythonSupport ''
29 mv "pythonlib/" "$py"
30 '';
31
32 passthru = {
33 inherit pythonSupport;
34 };
35
36 meta = with lib; {
37 homepage = "http://www.infradead.org/~tgr/libnl/";
38 description = "Linux Netlink interface library suite";
39 license = licenses.lgpl21;
40 maintainers = with maintainers; [ fpletz ];
41 platforms = platforms.linux;
42 };
43}