pygame-sdl2: 2.1.0 -> 8.3.1.24090601; modernize derivation (#374642)
[NixPkgs.git] / pkgs / tools / networking / iperf / 3.nix
bloba73184265f56c3daf7ec762467281ffe9d90bfa1
2   lib,
3   stdenv,
4   fetchurl,
5   openssl,
6   fetchpatch,
7   lksctp-tools,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "iperf";
12   version = "3.17.1";
14   src = fetchurl {
15     url = "https://downloads.es.net/pub/iperf/iperf-${version}.tar.gz";
16     hash = "sha256-hEBMqEMbWV6GxHPY8j2LsQKBAAHxX+r2EO/9OzGHiKo=";
17   };
19   buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isLinux [ lksctp-tools ];
20   configureFlags = [ "--with-openssl=${openssl.dev}" ];
22   outputs = [
23     "out"
24     "man"
25   ];
27   patches = lib.optionals stdenv.hostPlatform.isMusl [
28     (fetchpatch {
29       url = "https://git.alpinelinux.org/aports/plain/main/iperf3/remove-pg-flags.patch?id=7f979fc51ae31d5c695d8481ba84a4afc5080efb";
30       name = "remove-pg-flags.patch";
31       sha256 = "0z3zsmf7ln08rg1mmzl8s8jm5gp8x62f5cxiqcmi8dcs2nsxwgbi";
32     })
33   ];
35   postInstall = ''
36     ln -s $out/bin/iperf3 $out/bin/iperf
37     ln -s $man/share/man/man1/iperf3.1 $man/share/man/man1/iperf.1
38   '';
40   meta = {
41     homepage = "https://software.es.net/iperf/";
42     description = "Tool to measure IP bandwidth using UDP or TCP";
43     platforms = lib.platforms.unix;
44     license = lib.licenses.bsd3;
45     mainProgram = "iperf3";
46     maintainers = with lib.maintainers; [ fpletz ];
47   };