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

51 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, pkg-config, bison, file, flex
2019-11-12 22:12:59 -08:00
, asciidoc, libxslt, findXMLCatalogs, docbook_xml_dtd_45, docbook_xsl
2019-08-18 10:14:48 -07:00
, libmnl, libnftnl, libpcap
, gmp, jansson, readline
2019-11-13 01:52:54 -08:00
, withDebugSymbols ? false
, withPython ? false , python3
2019-08-18 10:14:48 -07:00
, withXtables ? false , iptables
}:
2021-01-15 06:45:37 -08:00
with lib;
2014-08-23 16:16:06 -07:00
stdenv.mkDerivation rec {
2021-01-17 07:53:29 -08:00
version = "0.9.8";
pname = "nftables";
2014-08-23 16:16:06 -07:00
src = fetchurl {
url = "https://netfilter.org/projects/nftables/files/${pname}-${version}.tar.bz2";
2021-01-17 07:53:29 -08:00
sha256 = "1r4g22grhd4s1918wws9vggb8821sv4kkj8197ygxr6sar301z30";
2014-08-23 16:16:06 -07:00
};
2019-11-12 22:12:59 -08:00
nativeBuildInputs = [
pkg-config bison file flex
2020-10-31 08:38:30 -07:00
asciidoc docbook_xml_dtd_45 docbook_xsl findXMLCatalogs libxslt
2019-11-12 22:12:59 -08:00
];
2014-08-23 16:16:06 -07:00
2019-08-18 10:14:48 -07:00
buildInputs = [
libmnl libnftnl libpcap
2019-11-13 01:52:54 -08: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-23 16:16:06 -07:00
2019-08-18 10:14:48 -07:00
meta = {
description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework";
2019-08-18 10:14:48 -07:00
homepage = "https://netfilter.org/projects/nftables/";
2014-08-23 16:16:06 -07:00
license = licenses.gpl2;
platforms = platforms.linux;
2020-10-31 08:38:30 -07:00
maintainers = with maintainers; [ izorkin ];
2014-08-23 16:16:06 -07:00
};
}