diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libnet')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libnet/default.nix | 20 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch | 29 |
2 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libnet/default.nix b/nixpkgs/pkgs/development/libraries/libnet/default.nix new file mode 100644 index 000000000000..cb3375708df1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libnet/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "libnet"; + version = "1.2-rc3"; + + src = fetchurl { + url = "mirror://sourceforge/libnet-dev/${pname}-${version}.tar.gz"; + sha256 = "0qsapqa7dzq9f6lb19kzilif0pj82b64fjv5bq086hflb9w81hvj"; + }; + + patches = [ ./fix-includes.patch ]; + + meta = with lib; { + homepage = "https://github.com/sam-github/libnet"; + description = "Portable framework for low-level network packet construction"; + license = licenses.bsd3; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch b/nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch new file mode 100644 index 000000000000..5eb86bc37b79 --- /dev/null +++ b/nixpkgs/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 <sys/time.h> + + #include <net/if.h> +-#if (__GLIBC__) + #include <netinet/if_ether.h> + #include <net/if_arp.h> +-#else +-#include <linux/if_arp.h> +-#include <linux/if_ether.h> +-#endif + + #if (HAVE_PACKET_SOCKET) + #ifndef SOL_PACKET + #define SOL_PACKET 263 + #endif /* SOL_PACKET */ +-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1 + #include <netpacket/packet.h> + #include <net/ethernet.h> /* the L2 protocols */ +-#else +-#include <asm/types.h> +-#include <linux/if_packet.h> +-#include <linux/if_ether.h> /* The L2 protocols */ +-#endif + #endif /* HAVE_PACKET_SOCKET */ + + #include "../include/libnet.h" |