@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libnl }:
1+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libnl, iptables }:
22
33let
44 sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; };
@@ -9,15 +9,13 @@ stdenv.mkDerivation {
99
1010 src = sourceAttrs.src;
1111
12− setSourceRoot = ''
13− sourceRoot=$(echo */usr)
14− '';
15−
1612 nativeBuildInputs = [ autoreconfHook pkgconfig ];
17− buildInputs = [ libnl ];
13+ buildInputs = [ libnl iptables ];
14+
15+ makeFlags = "-C src/usr";
1816
19− postPatch = ''
20− chmod u+w -R ../common
17+ prePatch = ''
18+ sed -e 's%^XTABLES_SO_DIR = .*%XTABLES_SO_DIR = '"$out"'/lib/xtables%g' -i src/usr/iptables/Makefile
2119 '';
2220
2321 meta = with stdenv.lib; {