1{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, bison, flex, pkgconfig }:
2
3let version = "3.3.0"; in
4stdenv.mkDerivation {
5 name = "libnl-${version}";
6
7 src = fetchFromGitHub {
8 repo = "libnl";
9 owner = "thom311";
10 rev = "libnl${lib.replaceStrings ["."] ["_"] version}";
11 sha256 = "1796kyq2lkhz2802v9kp32vlxf8ynlyqgyw9nhmry3qh5d0ahcsv";
12 };
13
14 outputs = [ "bin" "dev" "out" "man" ];
15
16 patches = stdenv.lib.optional stdenv.hostPlatform.isMusl
17 (fetchpatch {
18 url = "https://raw.githubusercontent.com/gentoo/musl/48d2a28710ae40877fd3e178ead1fb1bb0baa62c/dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch";
19 sha256 = "0dd7xxikib201i99k2if066hh7gwf2i4ffckrjplq6lr206jn00r";
20 });
21
22 nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ];
23
24 meta = with lib; {
25 inherit version;
26 homepage = http://www.infradead.org/~tgr/libnl/;
27 description = "Linux Netlink interface library suite";
28 license = licenses.lgpl21;
29 maintainers = with maintainers; [ fpletz ];
30 platforms = platforms.linux;
31 };
32}