diff options
author | Claudio Bley <cbley@exa-online.de> | 2019-09-19 09:02:15 +0200 |
---|---|---|
committer | Claudio Bley <cbley@exa-online.de> | 2019-09-19 09:08:50 +0200 |
commit | c4486a084f718b7813352d5a77d9b219ec44f99c (patch) | |
tree | 6f0cf6b37012fd1d2e8f15575d9c53c56b84d090 /pkgs/tools/networking/ntopng | |
parent | b9ba391469f548c83984b9aa10678a7f11fc9362 (diff) |
ntopng: Add patch needed to build with newer libpcap
Fixes build errors for the third-party mongoose module: ``` In file included from /nix/store/r5s3w32ahjzdlzsfrhybc3l2qcpi6yb2-libpcap-1.9.0/include/pcap.h:43, from /build/ntopng-2.0/include/ntop_includes.h:93, from src/HTTPserver.cpp:22: /nix/store/r5s3w32ahjzdlzsfrhybc3l2qcpi6yb2-libpcap-1.9.0/include/pcap/pcap.h:958: note: this is the location of the previous definition #define INVALID_SOCKET -1 src/../third-party/mongoose/mongoose.c:270:13: error: multiple types in one declaration typedef int SOCKET; ^~~~~~ ```
Diffstat (limited to 'pkgs/tools/networking/ntopng')
-rw-r--r-- | pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch | 34 | ||||
-rw-r--r-- | pkgs/tools/networking/ntopng/default.nix | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch b/pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch new file mode 100644 index 0000000000000..51c9a706f8983 --- /dev/null +++ b/pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch @@ -0,0 +1,34 @@ +From 9cb650ea96c0e5063775071cfdae072e92c553b8 Mon Sep 17 00:00:00 2001 +From: emanuele-f <faranda@ntop.org> +Date: Tue, 18 Sep 2018 12:49:57 +0200 +Subject: [PATCH] Compilation fix with new libpcap + +SOCKET and INVALID_SOCKET are now defined in pcap.h +--- + third-party/mongoose/mongoose.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/third-party/mongoose/mongoose.c b/third-party/mongoose/mongoose.c +index 6a61cea9b..634c142e3 100644 +--- a/third-party/mongoose/mongoose.c ++++ b/third-party/mongoose/mongoose.c +@@ -247,7 +247,9 @@ struct pollfd { + #define mg_rename(x, y) rename(x, y) + #define mg_sleep(x) usleep((x) * 1000) + #define ERRNO errno ++#ifndef INVALID_SOCKET + #define INVALID_SOCKET (-1) ++#endif + + /* ntop */ + #if ((ULONG_MAX) == (UINT_MAX)) +@@ -270,7 +272,9 @@ struct pollfd { + #endif + + //#define INT64_FMT PRId64 ++#ifndef SOCKET + typedef int SOCKET; ++#endif + #define WINCDECL + + #endif // End of Windows and UNIX specific includes diff --git a/pkgs/tools/networking/ntopng/default.nix b/pkgs/tools/networking/ntopng/default.nix index d745ba8d14d15..98d97fbb7d78d 100644 --- a/pkgs/tools/networking/ntopng/default.nix +++ b/pkgs/tools/networking/ntopng/default.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { patches = [ ./0001-Undo-weird-modification-of-data_dir.patch ./0002-Remove-requirement-to-have-writeable-callback-dir.patch + ./0003-New-libpcap-defines-SOCKET.patch ]; buildInputs = [ libpcap/* gnutls libgcrypt*/ libxml2 glib geoip geolite-legacy |