2022-01-20 18:30:47 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, asciidoctor, autoreconfHook, pkg-config
|
2022-05-13 09:48:28 +00:00
|
|
|
, boost, libctemplate, libmaxminddb, libpcap, libtins, openssl, protobuf, xz, zlib, catch2
|
2022-01-20 18:30:47 +00:00
|
|
|
, cbor-diag, cddl, diffutils, file, mktemp, netcat, tcpdump, wireshark-cli
|
2019-05-26 15:11:51 +00:00
|
|
|
}:
|
2018-03-22 23:48:53 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-26 15:11:51 +00:00
|
|
|
pname = "compactor";
|
2022-01-20 18:30:47 +00:00
|
|
|
version = "1.2.0";
|
2018-03-22 23:48:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dns-stats";
|
2019-05-26 15:11:51 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-01-20 18:30:47 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
hash = "sha256-AUNPUk70VwJ0nZgMPLMU258nqkL4QP6km0USrZi2ea0=";
|
2018-03-22 23:48:53 +00:00
|
|
|
};
|
|
|
|
|
2022-01-20 18:30:47 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
asciidoctor
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
];
|
2018-03-22 23:48:53 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
2022-01-20 18:30:47 +00:00
|
|
|
libctemplate
|
|
|
|
libmaxminddb
|
2018-03-22 23:48:53 +00:00
|
|
|
libpcap
|
|
|
|
libtins
|
2022-01-20 18:30:47 +00:00
|
|
|
openssl
|
|
|
|
protobuf
|
2021-03-14 18:12:53 +00:00
|
|
|
xz
|
2022-01-20 18:30:47 +00:00
|
|
|
zlib
|
2018-03-22 23:48:53 +00:00
|
|
|
];
|
|
|
|
|
2022-01-20 18:30:47 +00:00
|
|
|
postPatch = ''
|
2018-03-22 23:48:53 +00:00
|
|
|
patchShebangs test-scripts/
|
2022-05-13 09:48:28 +00:00
|
|
|
cp ${catch2}/include/catch2/catch.hpp tests/catch.hpp
|
2018-03-22 23:48:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace configure \
|
|
|
|
--replace "/usr/bin/file" "${file}/bin/file"
|
|
|
|
'';
|
2022-01-20 18:30:47 +00:00
|
|
|
|
2018-03-22 23:48:53 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-boost-libdir=${boost.out}/lib"
|
|
|
|
"--with-boost=${boost.dev}"
|
|
|
|
];
|
2019-05-26 15:11:51 +00:00
|
|
|
enableParallelBuilding = true;
|
2018-03-22 23:48:53 +00:00
|
|
|
|
2022-01-20 18:30:47 +00:00
|
|
|
doCheck = !stdenv.isDarwin; # check-dnstap.sh failing on Darwin
|
|
|
|
checkInputs = [
|
|
|
|
cbor-diag
|
|
|
|
cddl
|
|
|
|
diffutils
|
|
|
|
file
|
|
|
|
mktemp
|
|
|
|
netcat
|
|
|
|
tcpdump
|
|
|
|
wireshark-cli
|
|
|
|
];
|
2018-03-22 23:48:53 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-03-22 23:48:53 +00:00
|
|
|
description = "Tools to capture DNS traffic and record it in C-DNS files";
|
2022-01-20 18:30:47 +00:00
|
|
|
homepage = "https://dns-stats.org/";
|
2019-05-26 15:11:51 +00:00
|
|
|
changelog = "https://github.com/dns-stats/${pname}/raw/${version}/ChangeLog.txt";
|
2022-01-20 18:30:47 +00:00
|
|
|
license = licenses.mpl20;
|
2018-03-22 23:48:53 +00:00
|
|
|
maintainers = with maintainers; [ fdns ];
|
2022-01-20 18:30:47 +00:00
|
|
|
platforms = platforms.unix;
|
2018-03-22 23:48:53 +00:00
|
|
|
};
|
|
|
|
}
|