summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2017-11-09 01:31:08 +0100
committeraszlig <aszlig@nix.build>2017-11-09 01:34:57 +0100
commite5bda9399db0e5fdcf0982f7752419055d68e2eb (patch)
tree1cc7567d52c943071fd99adafc160ea402a72947 /pkgs
parentb8abd97c3b19f172c21c9d4bb0a3357c89f3b587 (diff)
downloadnixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.tar
nixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.tar.gz
nixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.tar.bz2
nixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.tar.lz
nixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.tar.xz
nixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.tar.zst
nixpkgs-e5bda9399db0e5fdcf0982f7752419055d68e2eb.zip
netsniff-ng: Fix build against glibc 2.26
The build fails first of all because it cannot find the function body
for __builtin_memset. In glibc 2.26 this is available via inclusion of
string.h.

Another failure was that UINT64_MAX wasn't available in staging/tools.c,
which is fixed again by inclusion of stdint.h.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @nckx
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/netsniff-ng/default.nix2
-rw-r--r--pkgs/tools/networking/netsniff-ng/glibc-2.26.patch24
2 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/tools/networking/netsniff-ng/default.nix b/pkgs/tools/networking/netsniff-ng/default.nix
index 5ca3079a084..b0921375849 100644
--- a/pkgs/tools/networking/netsniff-ng/default.nix
+++ b/pkgs/tools/networking/netsniff-ng/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
     sha256 = "1lz4hwgwdq3znlqjmvl7cw3g3ilbayn608h0hwqdf7v2jq6n67kg";
   };
 
+  patches = [ ./glibc-2.26.patch ];
+
   buildInputs = [ bison flex geoip geolite-legacy libcli libnet libnl
     libnetfilter_conntrack libpcap libsodium liburcu ncurses perl
     pkgconfig zlib ];
diff --git a/pkgs/tools/networking/netsniff-ng/glibc-2.26.patch b/pkgs/tools/networking/netsniff-ng/glibc-2.26.patch
new file mode 100644
index 00000000000..2ee7b478e9b
--- /dev/null
+++ b/pkgs/tools/networking/netsniff-ng/glibc-2.26.patch
@@ -0,0 +1,24 @@
+diff --git a/built_in.h b/built_in.h
+index da04dbd..7acc183 100644
+--- a/built_in.h
++++ b/built_in.h
+@@ -10,6 +10,7 @@
+ #include <endian.h>
+ #include <byteswap.h>
+ #include <asm/byteorder.h>
++#include <string.h>
+ 
+ typedef uint64_t	u64;
+ typedef uint32_t	u32;
+diff --git a/staging/tools.c b/staging/tools.c
+index 9d2d1be..909b059 100644
+--- a/staging/tools.c
++++ b/staging/tools.c
+@@ -55,6 +55,7 @@
+ ////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ #include "mz.h"
++#include <stdint.h>
+ 
+ #define CMP_INT(a, b) ((a) < (b) ? -1 : (a) > (b))
+ #define IPV6_MAX_RANGE_LEN strlen("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128")