2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, file, lib, fetchFromGitHub, autoreconfHook, bison, flex, pkg-config
|
2021-04-05 15:23:46 +00:00
|
|
|
, pythonSupport ? false, swig ? null, python ? null}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libnl";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "3.7.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "libnl";
|
|
|
|
owner = "thom311";
|
|
|
|
rev = "libnl${lib.replaceStrings ["."] ["_"] version}";
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "sha256-Ty9NdWKWB29MTRfG5OJlSE0mSTN3Wy+sR4KtuExXcB4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "man" ] ++ lib.optional pythonSupport "py";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook bison flex pkg-config file ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional pythonSupport swig;
|
|
|
|
|
|
|
|
postBuild = lib.optionalString (pythonSupport) ''
|
|
|
|
cd python
|
2021-04-05 15:23:46 +00:00
|
|
|
${python.interpreter} setup.py install --prefix=../pythonlib
|
2020-04-24 23:36:52 +00:00
|
|
|
cd -
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = lib.optionalString pythonSupport ''
|
|
|
|
mv "pythonlib/" "$py"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit pythonSupport;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "http://www.infradead.org/~tgr/libnl/";
|
|
|
|
description = "Linux Netlink interface library suite";
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|