diff --git a/pkgs/tools/networking/iperf/2.nix b/pkgs/tools/networking/iperf/2.nix index 9faa0f953510..6494b907a3a9 100644 --- a/pkgs/tools/networking/iperf/2.nix +++ b/pkgs/tools/networking/iperf/2.nix @@ -11,10 +11,18 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; configureFlags = [ "--enable-fastsampling" ]; + postInstall = '' + mv $out/bin/iperf $out/bin/iperf2 + ln -s $out/bin/iperf2 $out/bin/iperf + ''; + meta = with stdenv.lib; { homepage = https://sourceforge.net/projects/iperf/; description = "Tool to measure IP bandwidth using UDP or TCP"; platforms = platforms.unix; license = licenses.mit; + + # prioritize iperf3 + priority = 10; }; } diff --git a/pkgs/tools/networking/iperf/3.nix b/pkgs/tools/networking/iperf/3.nix index 9082a484aa5a..46e0154a0042 100644 --- a/pkgs/tools/networking/iperf/3.nix +++ b/pkgs/tools/networking/iperf/3.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; + outputs = [ "out" "man" ]; + patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ (fetchpatch { url = "https://git.alpinelinux.org/aports/plain/main/iperf3/remove-pg-flags.patch?id=99ec9e1c84e338629cf1b27b0fdc808bde4d8564"; @@ -19,7 +21,8 @@ stdenv.mkDerivation rec { ]; postInstall = '' - ln -s iperf3 $out/bin/iperf + ln -s $out/bin/iperf3 $out/bin/iperf + ln -s $man/share/man/man1/iperf3.1 $man/share/man/man1/iperf.1 ''; meta = with stdenv.lib; {