2018-12-09 16:12:53 +00:00
|
|
|
{ stdenv, fetchurl, fetchpatch, bison, flex, pkgconfig, pruneLibtoolFiles
|
2018-11-29 21:44:29 +00:00
|
|
|
, libnetfilter_conntrack, libnftnl, libmnl, libpcap }:
|
2008-08-15 10:49:43 +01:00
|
|
|
|
2009-07-23 19:16:24 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-12-12 22:16:48 +00:00
|
|
|
name = "iptables-${version}";
|
2018-11-29 21:44:29 +00:00
|
|
|
version = "1.8.2";
|
2008-08-15 10:49:43 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.netfilter.org/projects/iptables/files/${name}.tar.bz2";
|
2018-11-29 21:44:29 +00:00
|
|
|
sha256 = "1bqj9hf3szy9r0w14iy23w00ir8448nfhpcprbwmcchsxm88nxx3";
|
2008-08-15 10:49:43 +01:00
|
|
|
};
|
|
|
|
|
2018-11-29 21:44:29 +00:00
|
|
|
patches = [
|
|
|
|
# Adds missing bits to extensions' libipt_icmp.c and libip6t_icmp6.c that were causing build to fail
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://git.netfilter.org/iptables/patch/?id=907e429d7548157016cd51aba4adc5d0c7d9f816";
|
|
|
|
sha256 = "0vc7ljcglz5152lc3jx4p44vjfi6ipvxdrgkdb5dmkhlb5v93i2h";
|
|
|
|
})
|
|
|
|
# Build with musl libc fails because of conflicting struct ethhdr definitions
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://git.netfilter.org/iptables/patch/?id=51d374ba41ae4f1bb851228c06b030b83dd2092f";
|
|
|
|
sha256 = "05fwrq03f9sm0v2bfwshbrg7pi2p978w1460arnmpay3135gj266";
|
|
|
|
})
|
2018-12-09 16:12:53 +00:00
|
|
|
# Extensions: libip6t_mh: fix bogus translation error
|
2018-11-29 21:44:29 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://git.netfilter.org/iptables/patch/?id=5839d7fe62ff667af7132fc7d589b386951f27b3";
|
|
|
|
sha256 = "0578jn1ip710z9kijwg9g2vjq2kfrbafl03m1rgi4fasz215gvkf";
|
|
|
|
})
|
|
|
|
# Prevent headers collisions between linux and netfilter (in.h and in6.h)
|
2018-12-09 16:12:53 +00:00
|
|
|
# Fixed upstream with two commits
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://git.netfilter.org/iptables/patch/?id=8d9d7e4b9ef4c6e6abab2cf35c747d7ca36824bd";
|
|
|
|
sha256 = "0q3wcspiqym1r6dg1jhg7h8hpvsjzx1k7cs39z36mzlbmj9lm0zb";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://git.netfilter.org/iptables/patch/?id=2908eda10bf9fc81119d4f3ad672c67918ab5955";
|
|
|
|
sha256 = "1dci4c8b7gcdrf77l2aicrcwlbp320xjz76fhavams0b4kgs6yr3";
|
|
|
|
})
|
2018-11-29 21:44:29 +00:00
|
|
|
];
|
|
|
|
|
2018-12-09 16:12:53 +00:00
|
|
|
nativeBuildInputs = [ bison flex pkgconfig pruneLibtoolFiles ];
|
2016-01-01 01:54:56 +00:00
|
|
|
|
2018-11-29 21:44:29 +00:00
|
|
|
buildInputs = [ libnetfilter_conntrack libnftnl libmnl libpcap ];
|
2016-01-01 01:54:56 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lmnl -lnftnl"
|
|
|
|
'';
|
|
|
|
|
2018-07-25 22:44:21 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-devel"
|
|
|
|
"--enable-shared"
|
2018-11-29 21:44:29 +00:00
|
|
|
"--enable-bpf-compiler"
|
2018-07-25 22:44:21 +01:00
|
|
|
];
|
2010-05-20 23:11:44 +01:00
|
|
|
|
2017-01-22 01:20:00 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2008-08-15 10:49:43 +01:00
|
|
|
description = "A program to configure the Linux IP packet filtering ruleset";
|
2018-11-29 21:44:29 +00:00
|
|
|
homepage = https://www.netfilter.org/projects/iptables/index.html;
|
2017-01-22 01:20:00 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2018-08-29 23:34:22 +01:00
|
|
|
license = licenses.gpl2;
|
2018-11-29 21:44:29 +00:00
|
|
|
downloadPage = "https://www.netfilter.org/projects/iptables/files/";
|
2014-12-12 22:16:48 +00:00
|
|
|
updateWalker = true;
|
|
|
|
inherit version;
|
2008-08-15 10:49:43 +01:00
|
|
|
};
|
|
|
|
}
|