[gentoo-commits] proj/betagarden:master commit in: net-analyzer/nethogs/, net-analyzer/nethogs/files/

2014-08-19 Thread Sebastian Pipping
commit: 539ff83c65a3fe116f0ef306ef1970b4662f578d
Author: Justin Lecher  gentoo  org>
AuthorDate: Thu Jul 24 10:23:36 2014 +
Commit: Sebastian Pipping  gentoo  org>
CommitDate: Thu Jul 24 10:23:36 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=539ff83c

net-analyzer/nethogs: Backport patch for ncurses[tinfo]

Package-Manager: portage-2.2.10

---
 net-analyzer/nethogs/ChangeLog |  4 ++
 .../nethogs/files/nethogs--tinfo.patch | 46 ++
 net-analyzer/nethogs/nethogs-.ebuild   |  7 
 3 files changed, 57 insertions(+)

diff --git a/net-analyzer/nethogs/ChangeLog b/net-analyzer/nethogs/ChangeLog
index d69ab41..46c2ce4 100644
--- a/net-analyzer/nethogs/ChangeLog
+++ b/net-analyzer/nethogs/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  24 Jul 2014; Justin Lecher  nethogs-.ebuild,
+  +files/nethogs--tinfo.patch:
+  Backport patch for ncurses[tinfo]
+
 *nethogs- (21 Jul 2014)
 
   21 Jul 2014; Justin Lecher  +nethogs-.ebuild,

diff --git a/net-analyzer/nethogs/files/nethogs--tinfo.patch 
b/net-analyzer/nethogs/files/nethogs--tinfo.patch
new file mode 100644
index 000..4a80e2a
--- /dev/null
+++ b/net-analyzer/nethogs/files/nethogs--tinfo.patch
@@ -0,0 +1,46 @@
+From 01c61290a30ae40a358ed803190c21d0dd42dc3a Mon Sep 17 00:00:00 2001
+From: Justin Lecher 
+Date: Thu, 24 Jul 2014 12:13:06 +0200
+Subject: [PATCH] Allow to specify ncurses libs at buildtime
+
+If the system is using libtinfo then you need ot link against libncurses and 
libtinfo.
+With this patch it is possible to specify this at buildtime.
+
+Signed-off-by: Justin Lecher 
+---
+ Makefile | 9 ++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 83b1c3e..3c0e7c7 100644
+--- a/Makefile
 b/Makefile
+@@ -20,6 +20,9 @@ CFLAGS?=-Wall -Wextra
+ CXXFLAGS?=-Wall -Wextra
+ 
+ OBJS=packet.o connection.o process.o refresh.o decpcap.o cui.o inode2prog.o 
conninode.o devices.o
++
++NCURSES_LIBS?=-lncurses
++
+ .PHONY: tgz
+ 
+ tgz: clean
+@@ -36,12 +39,12 @@ install: nethogs nethogs.8
+   install -m 644 nethogs.8 $(DESTDIR)$(man8)
+ 
+ test: test.cpp 
+-  $(CXX) $(CXXFLAGS) $(LDFLAGS) test.cpp -o test -lpcap -lm -lncurses 
-DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
++  $(CXX) $(CXXFLAGS) $(LDFLAGS) test.cpp -o test -lpcap -lm 
${NCURSES_LIBS} -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
+ 
+ nethogs: main.cpp nethogs.cpp $(OBJS)
+-  $(CXX) $(CXXFLAGS) $(LDFLAGS) main.cpp $(OBJS) -o nethogs -lpcap -lm 
-lncurses -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
++  $(CXX) $(CXXFLAGS) $(LDFLAGS) main.cpp $(OBJS) -o nethogs -lpcap -lm 
${NCURSES_LIBS} -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
+ nethogs_testsum: nethogs_testsum.cpp $(OBJS)
+-  $(CXX) $(CXXFLAGS) $(LDFLAGS) nethogs_testsum.cpp $(OBJS) -o 
nethogs_testsum -lpcap -lm -lncurses -DVERSION=\"$(VERSION)\" 
-DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\"
++  $(CXX) $(CXXFLAGS) $(LDFLAGS) nethogs_testsum.cpp $(OBJS) -o 
nethogs_testsum -lpcap -lm ${NCURSES_LIBS} -DVERSION=\"$(VERSION)\" 
-DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\"
+ 
+ decpcap_test: decpcap_test.cpp decpcap.o
+   $(CXX) $(CXXFLAGS) $(LDFLAGS) decpcap_test.cpp decpcap.o -o 
decpcap_test -lpcap -lm
+-- 
+2.0.2
+

diff --git a/net-analyzer/nethogs/nethogs-.ebuild 
b/net-analyzer/nethogs/nethogs-.ebuild
index ead5955..6175ec3 100644
--- a/net-analyzer/nethogs/nethogs-.ebuild
+++ b/net-analyzer/nethogs/nethogs-.ebuild
@@ -26,10 +26,17 @@ DEPEND="
 
 DOCS=( Changelog DESIGN README )
 
+PATCHES=( "${FILESDIR}"/${P}-tinfo.patch )
+
 src_prepare() {
+   epatch "${PATCHES[@]}"
tc-export CC CXX PKG_CONFIG
 }
 
+src_compile() {
+   emake NCURSES_LIBS="$($(tc-getPKG_CONFIG) --libs ncurses)"
+}
+
 src_install() {
emake DESTDIR="${ED}" prefix=/usr install
dodoc ${DOCS[@]}



[gentoo-commits] proj/betagarden:master commit in: net-analyzer/nethogs/, net-analyzer/nethogs/files/

2014-07-27 Thread Justin Lecher
commit: 539ff83c65a3fe116f0ef306ef1970b4662f578d
Author: Justin Lecher  gentoo  org>
AuthorDate: Thu Jul 24 10:23:36 2014 +
Commit: Justin Lecher  gentoo  org>
CommitDate: Thu Jul 24 10:23:36 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=539ff83c

net-analyzer/nethogs: Backport patch for ncurses[tinfo]

Package-Manager: portage-2.2.10

---
 net-analyzer/nethogs/ChangeLog |  4 ++
 .../nethogs/files/nethogs--tinfo.patch | 46 ++
 net-analyzer/nethogs/nethogs-.ebuild   |  7 
 3 files changed, 57 insertions(+)

diff --git a/net-analyzer/nethogs/ChangeLog b/net-analyzer/nethogs/ChangeLog
index d69ab41..46c2ce4 100644
--- a/net-analyzer/nethogs/ChangeLog
+++ b/net-analyzer/nethogs/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  24 Jul 2014; Justin Lecher  nethogs-.ebuild,
+  +files/nethogs--tinfo.patch:
+  Backport patch for ncurses[tinfo]
+
 *nethogs- (21 Jul 2014)
 
   21 Jul 2014; Justin Lecher  +nethogs-.ebuild,

diff --git a/net-analyzer/nethogs/files/nethogs--tinfo.patch 
b/net-analyzer/nethogs/files/nethogs--tinfo.patch
new file mode 100644
index 000..4a80e2a
--- /dev/null
+++ b/net-analyzer/nethogs/files/nethogs--tinfo.patch
@@ -0,0 +1,46 @@
+From 01c61290a30ae40a358ed803190c21d0dd42dc3a Mon Sep 17 00:00:00 2001
+From: Justin Lecher 
+Date: Thu, 24 Jul 2014 12:13:06 +0200
+Subject: [PATCH] Allow to specify ncurses libs at buildtime
+
+If the system is using libtinfo then you need ot link against libncurses and 
libtinfo.
+With this patch it is possible to specify this at buildtime.
+
+Signed-off-by: Justin Lecher 
+---
+ Makefile | 9 ++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 83b1c3e..3c0e7c7 100644
+--- a/Makefile
 b/Makefile
+@@ -20,6 +20,9 @@ CFLAGS?=-Wall -Wextra
+ CXXFLAGS?=-Wall -Wextra
+ 
+ OBJS=packet.o connection.o process.o refresh.o decpcap.o cui.o inode2prog.o 
conninode.o devices.o
++
++NCURSES_LIBS?=-lncurses
++
+ .PHONY: tgz
+ 
+ tgz: clean
+@@ -36,12 +39,12 @@ install: nethogs nethogs.8
+   install -m 644 nethogs.8 $(DESTDIR)$(man8)
+ 
+ test: test.cpp 
+-  $(CXX) $(CXXFLAGS) $(LDFLAGS) test.cpp -o test -lpcap -lm -lncurses 
-DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
++  $(CXX) $(CXXFLAGS) $(LDFLAGS) test.cpp -o test -lpcap -lm 
${NCURSES_LIBS} -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
+ 
+ nethogs: main.cpp nethogs.cpp $(OBJS)
+-  $(CXX) $(CXXFLAGS) $(LDFLAGS) main.cpp $(OBJS) -o nethogs -lpcap -lm 
-lncurses -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
++  $(CXX) $(CXXFLAGS) $(LDFLAGS) main.cpp $(OBJS) -o nethogs -lpcap -lm 
${NCURSES_LIBS} -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" 
-DMINORVERSION=\"$(MINORVERSION)\"
+ nethogs_testsum: nethogs_testsum.cpp $(OBJS)
+-  $(CXX) $(CXXFLAGS) $(LDFLAGS) nethogs_testsum.cpp $(OBJS) -o 
nethogs_testsum -lpcap -lm -lncurses -DVERSION=\"$(VERSION)\" 
-DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\"
++  $(CXX) $(CXXFLAGS) $(LDFLAGS) nethogs_testsum.cpp $(OBJS) -o 
nethogs_testsum -lpcap -lm ${NCURSES_LIBS} -DVERSION=\"$(VERSION)\" 
-DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\"
+ 
+ decpcap_test: decpcap_test.cpp decpcap.o
+   $(CXX) $(CXXFLAGS) $(LDFLAGS) decpcap_test.cpp decpcap.o -o 
decpcap_test -lpcap -lm
+-- 
+2.0.2
+

diff --git a/net-analyzer/nethogs/nethogs-.ebuild 
b/net-analyzer/nethogs/nethogs-.ebuild
index ead5955..6175ec3 100644
--- a/net-analyzer/nethogs/nethogs-.ebuild
+++ b/net-analyzer/nethogs/nethogs-.ebuild
@@ -26,10 +26,17 @@ DEPEND="
 
 DOCS=( Changelog DESIGN README )
 
+PATCHES=( "${FILESDIR}"/${P}-tinfo.patch )
+
 src_prepare() {
+   epatch "${PATCHES[@]}"
tc-export CC CXX PKG_CONFIG
 }
 
+src_compile() {
+   emake NCURSES_LIBS="$($(tc-getPKG_CONFIG) --libs ncurses)"
+}
+
 src_install() {
emake DESTDIR="${ED}" prefix=/usr install
dodoc ${DOCS[@]}