tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
pktgen: 3.1.0 -> 3.4.0
Ruslan Babayev
8 years ago
f1e1d714
f6075fc2
+40
-4
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
pktgen
Makefile.patch
default.nix
+34
pkgs/os-specific/linux/pktgen/Makefile.patch
···
1
1
+
diff --git a/app/Makefile b/app/Makefile
2
2
+
index 5078b9a..99b208a 100644
3
3
+
--- a/app/Makefile
4
4
+
+++ b/app/Makefile
5
5
+
@@ -46,29 +46,10 @@ APP = pktgen
6
6
+
CFLAGS += -O3 -g $(WERROR_FLAGS) -fno-stack-protector
7
7
+
CFLAGS += -I$(RTE_SRCDIR) -I$(RTE_SRCDIR)/../lib/common
8
8
+
9
9
+
-dpdk_ver := $(RTE_SDK)/xusertools/dpdk-version.sh
10
10
+
-pktgen_ver := $(RTE_SRCDIR)/../tools/dpdk-version.sh
11
11
+
-ver_cmd := $(if $(wildcard $(dpdk_ver)),$(dpdk_ver),$(pktgen_ver))
12
12
+
-# $(info ver_cmd=$(ver_cmd))
13
13
+
-
14
14
+
-yy := $(shell $(ver_cmd) -yy)
15
15
+
-# mm := $(shell $(ver_cmd) -mm)
16
16
+
-
17
17
+
-# $(info yy=$(yy))
18
18
+
-
19
19
+
-ifeq ($(yy),17)
20
20
+
COMMON_PRE := $(RTE_SRCDIR)/../lib/common
21
21
+
LUA_PRE := $(RTE_SRCDIR)/../lib/lua/src
22
22
+
CLI_PRE := $(RTE_SRCDIR)/../lib/cli
23
23
+
GUI_PRE := $(RTE_SRCDIR)/../gui/gui
24
24
+
-else
25
25
+
-ifeq ($(yy),16)
26
26
+
-COMMON_PRE := $(RTE_SRCDIR)/../lib/common/lib/common
27
27
+
-LUA_PRE := $(RTE_SRCDIR)/../lib/lua/src/lib/lua/src
28
28
+
-CLI_PRE := $(RTE_SRCDIR)/../lib/cli/lib/cli
29
29
+
-GUI_PRE := $(RTE_SRCDIR)/../gui
30
30
+
-endif
31
31
+
-endif
32
32
+
33
33
+
COMMON_LIB := $(COMMON_PRE)/$(RTE_TARGET)
34
34
+
LUA_LIB := $(LUA_PRE)/$(RTE_TARGET)
+6
-4
pkgs/os-specific/linux/pktgen/default.nix
···
5
5
6
6
stdenv.mkDerivation rec {
7
7
name = "pktgen-${version}";
8
8
-
version = "3.1.0";
8
8
+
version = "3.4.0";
9
9
10
10
src = fetchurl {
11
11
-
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-v${version}.tar.gz";
12
12
-
sha256 = "1a1dl8h8p76wlcjlvn736mz4nc2nc5c3764rlydiz86wl45mb0nb";
11
11
+
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz";
12
12
+
sha256 = "0fcyb56d4mkvchi5i8s3m210f5c3xa8zbjb08ranpa1a2k1kzfg5";
13
13
};
14
14
15
15
nativeBuildInputs = stdenv.lib.optionals withGtk [ pkgconfig ];
···
24
24
25
25
NIX_CFLAGS_COMPILE = [ "-march=core2" ];
26
26
27
27
+
patches = [ ./Makefile.patch ];
28
28
+
27
29
postPatch = ''
28
30
substituteInPlace lib/lua/src/luaconf.h --replace /usr/local $out
29
31
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
···
31
33
32
34
installPhase = ''
33
35
install -d $out/bin
34
34
-
install -m 0755 app/app/${RTE_TARGET}/app/pktgen $out/bin
36
36
+
install -m 0755 app/${RTE_TARGET}/pktgen $out/bin
35
37
install -d $out/lib/lua/5.3
36
38
install -m 0644 Pktgen.lua $out/lib/lua/5.3
37
39
'';