forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{ lib, stdenv, fetchurl, openssl, fetchpatch }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "iperf";
|
|
version = "3.9";
|
|
|
|
src = fetchurl {
|
|
url = "https://downloads.es.net/pub/iperf/iperf-${version}.tar.gz";
|
|
sha256 = "0f601avdmzpwsa3lbi0ppjhkrdipm5wifhhxy5czf99370k3mdi4";
|
|
};
|
|
|
|
buildInputs = [ openssl ];
|
|
configureFlags = [
|
|
"--with-openssl=${openssl.dev}"
|
|
];
|
|
|
|
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=7f979fc51ae31d5c695d8481ba84a4afc5080efb";
|
|
name = "remove-pg-flags.patch";
|
|
sha256 = "0z3zsmf7ln08rg1mmzl8s8jm5gp8x62f5cxiqcmi8dcs2nsxwgbi";
|
|
})
|
|
];
|
|
|
|
postInstall = ''
|
|
ln -s $out/bin/iperf3 $out/bin/iperf
|
|
ln -s $man/share/man/man1/iperf3.1 $man/share/man/man1/iperf.1
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "http://software.es.net/iperf/";
|
|
description = "Tool to measure IP bandwidth using UDP or TCP";
|
|
platforms = platforms.unix;
|
|
license = licenses.bsd3;
|
|
maintainers = with maintainers; [ fpletz ];
|
|
};
|
|
}
|