2024-07-21 19:49:37 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
openssl,
|
|
|
|
fetchpatch,
|
|
|
|
lksctp-tools,
|
|
|
|
}:
|
2014-10-05 01:23:00 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-06-09 19:20:38 +01:00
|
|
|
pname = "iperf";
|
2024-07-21 19:47:57 +01:00
|
|
|
version = "3.17.1";
|
2014-10-05 01:23:00 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-06-09 19:20:38 +01:00
|
|
|
url = "https://downloads.es.net/pub/iperf/iperf-${version}.tar.gz";
|
2024-07-21 19:47:57 +01:00
|
|
|
hash = "sha256-hEBMqEMbWV6GxHPY8j2LsQKBAAHxX+r2EO/9OzGHiKo=";
|
2014-10-05 01:23:00 +01:00
|
|
|
};
|
|
|
|
|
2022-04-14 04:15:33 +01:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isLinux [ lksctp-tools ];
|
2024-07-21 19:49:37 +01:00
|
|
|
configureFlags = [ "--with-openssl=${openssl.dev}" ];
|
2017-11-05 23:52:13 +00:00
|
|
|
|
2024-07-21 19:49:37 +01:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
2019-06-03 14:50:48 +01:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
patches = lib.optionals stdenv.hostPlatform.isMusl [
|
2016-09-06 19:44:46 +01:00
|
|
|
(fetchpatch {
|
2019-10-17 17:40:44 +01:00
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/iperf3/remove-pg-flags.patch?id=7f979fc51ae31d5c695d8481ba84a4afc5080efb";
|
2016-09-06 19:44:46 +01:00
|
|
|
name = "remove-pg-flags.patch";
|
2019-10-17 17:40:44 +01:00
|
|
|
sha256 = "0z3zsmf7ln08rg1mmzl8s8jm5gp8x62f5cxiqcmi8dcs2nsxwgbi";
|
2016-09-06 19:44:46 +01:00
|
|
|
})
|
2018-02-21 18:35:59 +00:00
|
|
|
];
|
2016-09-06 19:44:46 +01:00
|
|
|
|
2014-10-05 01:23:00 +01:00
|
|
|
postInstall = ''
|
2019-06-03 14:50:48 +01:00
|
|
|
ln -s $out/bin/iperf3 $out/bin/iperf
|
|
|
|
ln -s $man/share/man/man1/iperf3.1 $man/share/man/man1/iperf.1
|
2014-10-05 01:23:00 +01:00
|
|
|
'';
|
|
|
|
|
2024-07-21 19:49:37 +01:00
|
|
|
meta = {
|
2023-07-20 00:34:43 +01:00
|
|
|
homepage = "https://software.es.net/iperf/";
|
2014-10-05 01:23:00 +01:00
|
|
|
description = "Tool to measure IP bandwidth using UDP or TCP";
|
2024-07-21 19:49:37 +01:00
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
license = lib.licenses.bsd3;
|
2024-08-08 10:15:26 +01:00
|
|
|
mainProgram = "iperf3";
|
2024-07-21 19:49:37 +01:00
|
|
|
maintainers = with lib.maintainers; [ fpletz ];
|
2014-10-05 01:23:00 +01:00
|
|
|
};
|
|
|
|
}
|