nixpkgs/pkgs/os-specific/linux/nftables/default.nix

50 lines
1.4 KiB
Nix
Raw Normal View History

2019-11-13 09:52:54 +00:00
{ stdenv, fetchurl, pkgconfig, bison, file, flex
2019-11-13 06:12:59 +00:00
, asciidoc, libxslt, findXMLCatalogs, docbook_xml_dtd_45, docbook_xsl
2019-08-18 18:14:48 +01:00
, libmnl, libnftnl, libpcap
, gmp, jansson, readline
2019-11-13 09:52:54 +00:00
, withDebugSymbols ? false
, withPython ? false , python3
2019-08-18 18:14:48 +01:00
, withXtables ? false , iptables
}:
with stdenv.lib;
2014-08-24 00:16:06 +01:00
stdenv.mkDerivation rec {
2019-12-03 14:22:44 +00:00
version = "0.9.3";
pname = "nftables";
2014-08-24 00:16:06 +01:00
src = fetchurl {
url = "https://netfilter.org/projects/nftables/files/${pname}-${version}.tar.bz2";
2019-12-03 14:22:44 +00:00
sha256 = "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm";
2014-08-24 00:16:06 +01:00
};
2019-11-13 06:12:59 +00:00
nativeBuildInputs = [
2019-11-13 09:52:54 +00:00
pkgconfig bison file flex
asciidoc docbook_xml_dtd_45 docbook_xsl findXMLCatalogs libxslt
2019-11-13 06:12:59 +00:00
];
2014-08-24 00:16:06 +01:00
2019-08-18 18:14:48 +01:00
buildInputs = [
libmnl libnftnl libpcap
2019-11-13 09:52:54 +00:00
gmp jansson readline
] ++ optional withXtables iptables
++ optional withPython python3;
preConfigure = ''
substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
'';
configureFlags = [
"--with-json"
] ++ optional (!withDebugSymbols) "--disable-debug"
++ optional (!withPython) "--disable-python"
++ optional withPython "--enable-python"
++ optional withXtables "--with-xtables";
2014-08-24 00:16:06 +01:00
2019-08-18 18:14:48 +01:00
meta = {
description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework";
2019-08-18 18:14:48 +01:00
homepage = "https://netfilter.org/projects/nftables/";
2014-08-24 00:16:06 +01:00
license = licenses.gpl2;
platforms = platforms.linux;
};
}