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 17:14:48 +00:00
|
|
|
, libmnl, libnftnl, libpcap
|
2022-02-21 17:46:50 +00:00
|
|
|
, gmp, jansson, libedit
|
|
|
|
, autoreconfHook, fetchpatch
|
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 17:14:48 +00:00
|
|
|
}:
|
|
|
|
|
2014-08-23 23:16:06 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-02-21 17:46:50 +00:00
|
|
|
version = "1.0.2";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "nftables";
|
2014-08-23 23:16:06 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://netfilter.org/projects/nftables/files/${pname}-${version}.tar.bz2";
|
2022-02-21 17:46:50 +00:00
|
|
|
sha256 = "00jcjn1pl7qyqpg8pd4yhlkys7wbj4vkzgg73n27nmplzips6a0b";
|
2014-08-23 23:16:06 +00:00
|
|
|
};
|
|
|
|
|
2019-11-13 06:12:59 +00:00
|
|
|
nativeBuildInputs = [
|
2022-02-21 17:46:50 +00:00
|
|
|
autoreconfHook
|
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-23 23:16:06 +00:00
|
|
|
|
2019-08-18 17:14:48 +00:00
|
|
|
buildInputs = [
|
|
|
|
libmnl libnftnl libpcap
|
2022-02-21 17:46:50 +00:00
|
|
|
gmp jansson libedit
|
2022-04-30 00:04:02 +00:00
|
|
|
] ++ lib.optional withXtables iptables
|
|
|
|
++ lib.optional withPython python3;
|
2019-11-13 09:52:54 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
|
|
|
|
'';
|
|
|
|
|
2022-02-21 17:46:50 +00:00
|
|
|
patches = [
|
|
|
|
# fix build after 1.0.2 release, drop when updating to a newer release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://git.netfilter.org/nftables/patch/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3";
|
|
|
|
sha256 = "03dzhd7fhg0d20ly4rffk4ra7wlxp731892dhp8zw67jwhys9ywz";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-11-13 09:52:54 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-json"
|
2022-02-21 17:46:50 +00:00
|
|
|
"--with-cli=editline"
|
2022-04-30 00:04:02 +00:00
|
|
|
] ++ lib.optional (!withDebugSymbols) "--disable-debug"
|
|
|
|
++ lib.optional (!withPython) "--disable-python"
|
|
|
|
++ lib.optional withPython "--enable-python"
|
|
|
|
++ lib.optional withXtables "--with-xtables";
|
2014-08-23 23:16:06 +00:00
|
|
|
|
2022-04-30 00:04:02 +00:00
|
|
|
meta = with lib; {
|
2016-06-20 10:53:46 +00:00
|
|
|
description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework";
|
2019-08-18 17:14:48 +00:00
|
|
|
homepage = "https://netfilter.org/projects/nftables/";
|
2021-11-08 13:37:46 +00:00
|
|
|
license = licenses.gpl2Only;
|
2014-08-23 23:16:06 +00:00
|
|
|
platforms = platforms.linux;
|
2021-11-18 13:58:15 +00:00
|
|
|
maintainers = with maintainers; [ izorkin ajs124 ];
|
2014-08-23 23:16:06 +00:00
|
|
|
};
|
|
|
|
}
|