From 6d3fcd33d79b0a66b84912d1b7d36fcfc8656946 Mon Sep 17 00:00:00 2001 From: Ruslan Babayev Date: Wed, 1 Jun 2016 16:41:25 -0700 Subject: [PATCH] pktgen: init at 3.0.00 --- lib/maintainers.nix | 1 + pkgs/os-specific/linux/pktgen/default.nix | 38 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 41 insertions(+) create mode 100644 pkgs/os-specific/linux/pktgen/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 198bb93c6be3..55b09925b5f6 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -11,6 +11,7 @@ abaldeau = "Andreas Baldeau "; abbradar = "Nikolay Amiantov "; aboseley = "Adam Boseley "; + abuibrahim = "Ruslan Babayev "; adev = "Adrien Devresse "; Adjective-Object = "Maxwell Huang-Hobbs "; adnelson = "Allen Nelson "; diff --git a/pkgs/os-specific/linux/pktgen/default.nix b/pkgs/os-specific/linux/pktgen/default.nix new file mode 100644 index 000000000000..56ef935920b8 --- /dev/null +++ b/pkgs/os-specific/linux/pktgen/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl, dpdk, libpcap, utillinux }: + +stdenv.mkDerivation rec { + name = "pktgen-${version}"; + version = "3.0.00"; + + src = fetchurl { + url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz"; + sha256 = "703f8bd615aa4ae3a3085055483f9889dda09d082abb58afd33c1ba7c766ea65"; + }; + + buildInputs = [ dpdk libpcap ]; + + RTE_SDK = "${dpdk}"; + RTE_TARGET = "x86_64-native-linuxapp-gcc"; + + enableParallelBuilding = true; + + patchPhase = '' + sed -i -e s:/usr/local:$out:g lib/lua/src/luaconf.h + sed -i -e s:/usr/bin/lscpu:${utillinux}/bin/lscpu:g lib/common/wr_lscpu.h + ''; + + installPhase = '' + install -d $out/bin + install -m 0755 app/app/${RTE_TARGET}/app/pktgen $out/bin + install -d $out/lib/lua/5.3 + install -m 0644 Pktgen.lua $out/lib/lua/5.3 + ''; + + meta = with stdenv.lib; { + description = "Traffic generator powered by DPDK"; + homepage = http://dpdk.org/; + license = licenses.bsdOriginal; + platforms = [ "x86_64-linux" ]; + maintainers = [ maintainers.abuibrahim ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1091807486be..1fd798503f3f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10844,6 +10844,8 @@ in dpdk = callPackage ../os-specific/linux/dpdk { }; + pktgen = callPackage ../os-specific/linux/pktgen { }; + e1000e = callPackage ../os-specific/linux/e1000e {}; v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };