1{lib, stdenv, fetchurl}:
2
3stdenv.mkDerivation rec {
4 pname = "limitcpu";
5 version = "3.0";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/limitcpu/cpulimit-${version}.tar.gz";
9 sha256 = "sha256-rS9BXrK72j6DqKLZGO9ekPUuvMb+5h6Uv5F7PoTrtJw=";
10 };
11
12 buildFlags = with stdenv; [ (
13 if isDarwin then "osx"
14 else if isFreeBSD then "freebsd"
15 else "cpulimit"
16 ) ];
17
18 installFlags = [ "PREFIX=$(out)" ];
19
20 meta = with lib; {
21 homepage = "https://limitcpu.sourceforge.net/";
22 description = "A tool to throttle the CPU usage of programs";
23 platforms = with platforms; linux ++ freebsd;
24 license = licenses.gpl2;
25 maintainers = [maintainers.rycee];
26 };
27}