diff --git a/pkgs/development/libraries/libnet/default.nix b/pkgs/development/libraries/libnet/default.nix index a93c16d784d..f642ad5ccfa 100644 --- a/pkgs/development/libraries/libnet/default.nix +++ b/pkgs/development/libraries/libnet/default.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "0qsapqa7dzq9f6lb19kzilif0pj82b64fjv5bq086hflb9w81hvj"; }; + patches = [ ./fix-includes.patch ]; + meta = with stdenv.lib; { homepage = https://github.com/sam-github/libnet; description = "Portable framework for low-level network packet construction"; diff --git a/pkgs/development/libraries/libnet/fix-includes.patch b/pkgs/development/libraries/libnet/fix-includes.patch new file mode 100644 index 00000000000..5eb86bc37b7 --- /dev/null +++ b/pkgs/development/libraries/libnet/fix-includes.patch @@ -0,0 +1,29 @@ +--- libnet-1.1.6.orig/src/libnet_link_linux.c ++++ libnet-1.1.6/src/libnet_link_linux.c +@@ -30,26 +30,15 @@ + #include + + #include +-#if (__GLIBC__) + #include + #include +-#else +-#include +-#include +-#endif + + #if (HAVE_PACKET_SOCKET) + #ifndef SOL_PACKET + #define SOL_PACKET 263 + #endif /* SOL_PACKET */ +-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1 + #include + #include /* the L2 protocols */ +-#else +-#include +-#include +-#include /* The L2 protocols */ +-#endif + #endif /* HAVE_PACKET_SOCKET */ + + #include "../include/libnet.h"