2021-01-11 10:54:33 +03:00
|
|
|
{ writeText, lib, stdenv, fetchurl, ncurses }:
|
2013-08-14 15:00:59 +04:00
|
|
|
|
2015-09-25 16:33:42 +03:00
|
|
|
let
|
|
|
|
version = "0.6.1";
|
|
|
|
in
|
2013-08-14 15:00:59 +04:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-14 00:52:01 +03:00
|
|
|
pname = "bwm-ng";
|
|
|
|
inherit version;
|
2015-09-25 16:33:42 +03:00
|
|
|
|
2013-08-14 15:00:59 +04:00
|
|
|
src = fetchurl {
|
2019-08-14 00:52:01 +03:00
|
|
|
url = "https://www.gropp.org/bwm-ng/${pname}-${version}.tar.gz";
|
2015-09-25 16:30:59 +03:00
|
|
|
sha256 = "1w0dwpjjm9pqi613i8glxrgca3rdyqyp3xydzagzr5ndc34z6z02";
|
2013-08-14 15:00:59 +04:00
|
|
|
};
|
2015-05-15 00:49:02 +03:00
|
|
|
|
2013-08-14 15:00:59 +04:00
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
2018-02-24 02:56:02 +03:00
|
|
|
# gcc7 has some issues with inline functions
|
|
|
|
patches = [
|
|
|
|
(writeText "gcc7.patch"
|
|
|
|
''
|
|
|
|
--- a/src/bwm-ng.c
|
|
|
|
+++ b/src/bwm-ng.c
|
|
|
|
@@ -27,5 +27,5 @@
|
|
|
|
/* handle interrupt signal */
|
|
|
|
void sigint(int sig) FUNCATTR_NORETURN;
|
|
|
|
-inline void init(void);
|
|
|
|
+static inline void init(void);
|
2019-10-30 04:29:30 +03:00
|
|
|
|
2018-02-24 02:56:02 +03:00
|
|
|
/* clear stuff and exit */
|
|
|
|
--- a/src/options.c
|
|
|
|
+++ b/src/options.c
|
|
|
|
@@ -35,5 +35,5 @@
|
|
|
|
inline int str2output_type(char *optarg);
|
|
|
|
#endif
|
|
|
|
-inline int str2out_method(char *optarg);
|
|
|
|
+static inline int str2out_method(char *optarg);
|
|
|
|
inline int str2in_method(char *optarg);
|
|
|
|
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
|
|
|
|
2015-05-15 00:49:02 +03:00
|
|
|
# This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline
|
2021-01-15 12:19:50 +03:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=gnu89";
|
2015-05-15 00:49:02 +03:00
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2015-04-30 18:05:14 +03:00
|
|
|
description = "A small and simple console-based live network and disk io bandwidth monitor";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "http://www.gropp.org/?id=projects&sub=bwm-ng";
|
2013-08-14 15:00:59 +04:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Features
|
|
|
|
|
|
|
|
supports /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit, devstat and libstatgrab
|
|
|
|
unlimited number of interfaces/devices supported
|
|
|
|
interfaces/devices are added or removed dynamically from list
|
|
|
|
white-/blacklist of interfaces/devices
|
|
|
|
output of KB/s, Kb/s, packets, errors, average, max and total sum
|
|
|
|
output in curses, plain console, CSV or HTML
|
|
|
|
configfile
|
|
|
|
|
|
|
|
Short list of changes since 0.5 (for full list read changelog):
|
|
|
|
|
|
|
|
curses2 output, a nice bar chart
|
|
|
|
disk input for bsd/macosx/linux/solaris
|
|
|
|
win32 network bandwidth support
|
|
|
|
moved to autotools
|
|
|
|
alot fixes
|
|
|
|
|
|
|
|
Info
|
|
|
|
This was influenced by the old bwm util written by Barney (barney@freewill.tzo.com) which had some issues with faster interfaces and was very simple. Since i had almost all code done anyway for other projects, i decided to create my own version.
|
|
|
|
|
2014-12-30 05:31:03 +03:00
|
|
|
I actually don't know if netstat input is useful at all. I saw this elsewhere, so i added it. Its target is "netstat 1.42 (2001-04-15)" linux or Free/Open/netBSD. If there are other formats i would be happy to add them.
|
2015-09-25 16:33:42 +03:00
|
|
|
|
2013-08-14 15:00:59 +04:00
|
|
|
(from homepage)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|