2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, 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
|
2020-02-27 10:47:33 +00:00
|
|
|
, withXtables ? true , iptables
|
2019-08-18 18:14:48 +01:00
|
|
|
}:
|
|
|
|
|
2021-01-15 14:45:37 +00:00
|
|
|
with lib;
|
2014-08-24 00:16:06 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-11-18 13:58:15 +00:00
|
|
|
version = "1.0.1";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "nftables";
|
2014-08-24 00:16:06 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://netfilter.org/projects/nftables/files/${pname}-${version}.tar.bz2";
|
2021-11-18 13:58:15 +00:00
|
|
|
sha256 = "08x4xw0s5sap3q7jfr91v7mrkxrydi4dvsckw85ims0qb1ibmviw";
|
2014-08-24 00:16:06 +01:00
|
|
|
};
|
|
|
|
|
2019-11-13 06:12:59 +00:00
|
|
|
nativeBuildInputs = [
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config bison file flex
|
2020-10-31 15:38:30 +00:00
|
|
|
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"
|
2021-11-18 13:58:15 +00:00
|
|
|
"--with-cli=readline" # TODO: maybe switch to editline
|
2019-11-13 09:52:54 +00:00
|
|
|
] ++ 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 = {
|
2016-06-20 11:53:46 +01:00
|
|
|
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/";
|
2021-11-08 13:37:46 +00:00
|
|
|
license = licenses.gpl2Only;
|
2014-08-24 00:16:06 +01:00
|
|
|
platforms = platforms.linux;
|
2021-11-18 13:58:15 +00:00
|
|
|
maintainers = with maintainers; [ izorkin ajs124 ];
|
2014-08-24 00:16:06 +01:00
|
|
|
};
|
|
|
|
}
|