2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, autoreconfHook
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, libpcap
|
|
|
|
, zlib
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "darkstat";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "3.0.721";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "emikulic";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-kKj4fCgphoe3lojJfARwpITxQh7E6ehUew9FVEW63uQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
|
|
|
# Avoid multiple definitions of CLOCK_REALTIME on macOS 11,
|
|
|
|
# see https://github.com/emikulic/darkstat/pull/2
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/emikulic/darkstat/commit/d2fd232e1167dee6e7a2d88b9ab7acf2a129f697.diff";
|
|
|
|
sha256 = "0z5mpyc0q65qb6cn4xcrxl0vx21d8ibzaam5kjyrcw4icd8yg4jb";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libpcap
|
|
|
|
zlib
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Network statistics web interface";
|
|
|
|
longDescription = ''
|
|
|
|
Captures network traffic, calculates statistics about usage, and serves
|
|
|
|
reports over HTTP. Features:
|
|
|
|
- Traffic graphs, reports per host, shows ports for each host.
|
|
|
|
- Embedded web-server with deflate compression.
|
|
|
|
- Asynchronous reverse DNS resolution using a child process.
|
|
|
|
- Small. Portable. Single-threaded. Efficient.
|
|
|
|
- Supports IPv6.
|
|
|
|
'';
|
|
|
|
homepage = "http://unix4lyfe.org/darkstat";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/emikulic/darkstat/releases/tag/${version}";
|
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|