From 8579a81f77d2fbfa925c2c90e7f1d9c62f3d8a00 Mon Sep 17 00:00:00 2001 From: tdb Date: Mon, 12 May 2014 20:07:56 +0000 Subject: - Fix to work with libstatgrab 0.90 - Stage support - Fix build with clang on FreeBSD 10+ - Use new LIB_DEPENDS format --- net-mgmt/bwm-ng/Makefile | 11 ++++++----- net-mgmt/bwm-ng/files/patch-src__bwm-ng.c | 17 +++++++++++++++++ .../bwm-ng/files/patch-src__input__libstatgrab.c | 22 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 net-mgmt/bwm-ng/files/patch-src__bwm-ng.c create mode 100644 net-mgmt/bwm-ng/files/patch-src__input__libstatgrab.c (limited to 'net-mgmt/bwm-ng') diff --git a/net-mgmt/bwm-ng/Makefile b/net-mgmt/bwm-ng/Makefile index 2d5a070eec38..25400a6e391e 100644 --- a/net-mgmt/bwm-ng/Makefile +++ b/net-mgmt/bwm-ng/Makefile @@ -3,20 +3,21 @@ PORTNAME= bwm-ng PORTVERSION= 0.6 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= http://www.gropp.org/bwm-ng/ MAINTAINER= tdb@FreeBSD.org COMMENT= A small and simple bandwidth monitor -LIB_DEPENDS= statgrab.8:${PORTSDIR}/devel/libstatgrab +LIB_DEPENDS= libstatgrab.so:${PORTSDIR}/devel/libstatgrab GNU_CONFIGURE= yes USES= pkgconfig -MAN1= bwm-ng.1 -PLIST_FILES= bin/bwm-ng +PLIST_FILES= bin/bwm-ng man/man1/bwm-ng.1.gz -CONFIGURE_ENV= LIBS="`pkg-config --libs libstatgrab`" +CONFIGURE_ENV= CPPFLAGS="-std=gnu89 `pkg-config --cflags libstatgrab`" \ + LIBS="`pkg-config --libs libstatgrab`" +CONFIGURE_ARGS= --with-libstatgrab -NO_STAGE= yes .include diff --git a/net-mgmt/bwm-ng/files/patch-src__bwm-ng.c b/net-mgmt/bwm-ng/files/patch-src__bwm-ng.c new file mode 100644 index 000000000000..d22691d9ca8b --- /dev/null +++ b/net-mgmt/bwm-ng/files/patch-src__bwm-ng.c @@ -0,0 +1,17 @@ +--- ./src/bwm-ng.c.orig 2007-02-27 14:29:33.000000000 +0000 ++++ ./src/bwm-ng.c 2014-05-10 23:06:43.231799957 +0100 +@@ -193,7 +193,13 @@ + deinit(1,"invalid output selected\n"); + if (input_method<0) + deinit(1,"invalid input selected\n"); +- ++ ++#ifdef LIBSTATGRAB ++ if (sg_init(0) != 0) { ++ deinit(1,"libstatgrab failed to initialise\n"); ++ } ++#endif ++ + /* init total stats to zero */ + memset(&if_stats_total,0,(size_t)sizeof(t_iface_stats)); + #ifdef HAVE_CURSES diff --git a/net-mgmt/bwm-ng/files/patch-src__input__libstatgrab.c b/net-mgmt/bwm-ng/files/patch-src__input__libstatgrab.c new file mode 100644 index 000000000000..0c558e88607d --- /dev/null +++ b/net-mgmt/bwm-ng/files/patch-src__input__libstatgrab.c @@ -0,0 +1,22 @@ +--- ./src/input/libstatgrab.c.orig 2007-02-28 02:05:56.000000000 +0000 ++++ ./src/input/libstatgrab.c 2014-05-10 23:06:43.234799929 +0100 +@@ -27,7 +27,8 @@ + /* do the actual work, get and print stats if verbose */ + void get_iface_stats_libstat (char verbose) { + sg_network_io_stats *network_stats=NULL; +- int num_network_stats,current_if_num=0,hidden_if=0; ++ size_t num_network_stats; ++ int current_if_num=0,hidden_if=0; + + t_iface_speed_stats stats; /* local struct, used to calc total values */ + t_iface_speed_stats tmp_if_stats; +@@ -61,7 +62,8 @@ + + void get_iface_stats_libstatdisk (char verbose) { + sg_disk_io_stats *disk_stats=NULL; +- int num_disk_stats,current_if_num=0,hidden_if=0; ++ size_t num_disk_stats; ++ int current_if_num=0,hidden_if=0; + + t_iface_speed_stats stats; /* local struct, used to calc total values */ + t_iface_speed_stats tmp_if_stats; -- cgit