git.iko.soy/typeable/nixpkgs
on master help sign in
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

commite5bda9399db0e5fdcf0982f7752419055d68e2eb authoraszlig <aszlig@nix.build> dateThu 9 Nov 2017, 01:31 (9 years ago) parentb8abd97
2 files changed+26
pkgs/tools/networking/netsniff-ng/default.nix+2 pkgs/tools/networking/netsniff-ng/glibc-2.26.patch+24
pkgs/tools/networking/netsniff-ng/default.nix+2
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
1414 sha256 = "1lz4hwgwdq3znlqjmvl7cw3g3ilbayn608h0hwqdf7v2jq6n67kg";
1515 };
1616
17+ patches = [ ./glibc-2.26.patch ];
18+
1719 buildInputs = [ bison flex geoip geolite-legacy libcli libnet libnl
1820 libnetfilter_conntrack libpcap libsodium liburcu ncurses perl
1921 pkgconfig zlib ];
pkgs/tools/networking/netsniff-ng/glibc-2.26.patchnew file+24
@@ -0,0 +1,24 @@
1+diff --git a/built_in.h b/built_in.h
2+index da04dbd..7acc183 100644
3+--- a/built_in.h
4++++ b/built_in.h
5+@@ -10,6 +10,7 @@
6+ #include <endian.h>
7+ #include <byteswap.h>
8+ #include <asm/byteorder.h>
9++#include <string.h>
10+
11+ typedef uint64_t u64;
12+ typedef uint32_t u32;
13+diff --git a/staging/tools.c b/staging/tools.c
14+index 9d2d1be..909b059 100644
15+--- a/staging/tools.c
16++++ b/staging/tools.c
17+@@ -55,6 +55,7 @@
18+ ////////////////////////////////////////////////////////////////////////////////////////////
19+
20+ #include "mz.h"
21++#include <stdint.h>
22+
23+ #define CMP_INT(a, b) ((a) < (b) ? -1 : (a) > (b))
24+ #define IPV6_MAX_RANGE_LEN strlen("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128")