nixpkgs/pkgs/tools/networking/nuttcp/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
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
2021-01-11 10:38:22 +01:00

52 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "nuttcp";
version = "8.1.4";
src = fetchurl {
urls = [
"http://nuttcp.net/nuttcp/latest/${pname}-${version}.c"
"http://nuttcp.net/nuttcp/${pname}-${version}/${pname}-${version}.c"
"http://nuttcp.net/nuttcp/beta/${pname}-${version}.c"
];
sha256 = "1mygfhwxfi6xg0iycivx98ckak2abc3vwndq74278kpd8g0yyqyh";
};
man = fetchurl {
url = "http://nuttcp.net/nuttcp/${pname}-${version}/nuttcp.8";
sha256 = "1yang94mcdqg362qbi85b63746hk6gczxrk619hyj91v5763n4vx";
};
dontUnpack = true;
buildPhase = ''
cc -O2 -o nuttcp $src
'';
installPhase = ''
mkdir -p $out/bin
cp nuttcp $out/bin
'';
meta = with lib; {
description = "Network performance measurement tool";
longDescription = ''
nuttcp is a network performance measurement tool intended for use by
network and system managers. Its most basic usage is to determine the raw
TCP (or UDP) network layer throughput by transferring memory buffers from
a source system across an interconnecting network to a destination
system, either transferring data for a specified time interval, or
alternatively transferring a specified number of bytes. In addition to
reporting the achieved network throughput in Mbps, nuttcp also provides
additional useful information related to the data transfer such as user,
system, and wall-clock time, transmitter and receiver CPU utilization,
and loss percentage (for UDP transfers).
'';
license = licenses.gpl2;
homepage = "http://nuttcp.net/";
maintainers = with maintainers; [ ];
platforms = platforms.unix;
};
}