1{ lib, stdenv, fetchurl, pkg-config, libmnl, gitUpdater }:
2
3stdenv.mkDerivation rec {
4 version = "1.2.7";
5 pname = "libnftnl";
6
7 src = fetchurl {
8 url = "https://netfilter.org/projects/${pname}/files/${pname}-${version}.tar.xz";
9 hash = "sha256-kSJ3T5aAk9XAus3dZ95IDzH6QHNAWn/AWKNLDzh67LM=";
10 };
11
12 configureFlags = lib.optional (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") "LDFLAGS=-Wl,--undefined-version";
13
14 nativeBuildInputs = [ pkg-config ];
15 buildInputs = [ libmnl ];
16
17 enableParallelBuilding = true;
18
19 passthru.updateScript = gitUpdater {
20 url = "https://git.netfilter.org/libnftnl";
21 rev-prefix = "libnftnl-";
22 };
23
24 meta = with lib; {
25 description = "Userspace library providing a low-level netlink API to the in-kernel nf_tables subsystem";
26 homepage = "https://netfilter.org/projects/libnftnl/";
27 license = licenses.gpl2Plus;
28 platforms = platforms.linux;
29 maintainers = with maintainers; [ fpletz ] ++ teams.helsinki-systems.members;
30 };
31}