commit:     539ff83c65a3fe116f0ef306ef1970b4662f578d
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 24 10:23:36 2014 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Jul 24 10:23:36 2014 +0000
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-9999-tinfo.patch         | 46 ++++++++++++++++++++++
 net-analyzer/nethogs/nethogs-9999.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 <j...@gentoo.org> nethogs-9999.ebuild,
+  +files/nethogs-9999-tinfo.patch:
+  Backport patch for ncurses[tinfo]
+
 *nethogs-9999 (21 Jul 2014)
 
   21 Jul 2014; Justin Lecher <j...@gentoo.org> +nethogs-9999.ebuild,

diff --git a/net-analyzer/nethogs/files/nethogs-9999-tinfo.patch 
b/net-analyzer/nethogs/files/nethogs-9999-tinfo.patch
new file mode 100644
index 0000000..4a80e2a
--- /dev/null
+++ b/net-analyzer/nethogs/files/nethogs-9999-tinfo.patch
@@ -0,0 +1,46 @@
+From 01c61290a30ae40a358ed803190c21d0dd42dc3a Mon Sep 17 00:00:00 2001
+From: Justin Lecher <j...@gentoo.org>
+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 <j...@gentoo.org>
+---
+ 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-9999.ebuild 
b/net-analyzer/nethogs/nethogs-9999.ebuild
index ead5955..6175ec3 100644
--- a/net-analyzer/nethogs/nethogs-9999.ebuild
+++ b/net-analyzer/nethogs/nethogs-9999.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[@]}

Reply via email to