1{
2 fetchurl,
3 lib,
4 stdenv,
5 ncurses,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "nmon";
10 version = "16q";
11
12 src = fetchurl {
13 url = "mirror://sourceforge/nmon/lmon${version}.c";
14 sha256 = "sha256-G3ioFnLBkpGz0RpuMZ3ZsjoCKiYtuh786gCNbfUaylE=";
15 };
16
17 buildInputs = [ ncurses ];
18 dontUnpack = true;
19 buildPhase = "${stdenv.cc.targetPrefix}cc -o nmon ${src} -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -lm -g -D ${
20 with stdenv.hostPlatform;
21 if isx86 then
22 "X86"
23 else if isAarch then
24 "ARM"
25 else if isPower then
26 "POWER"
27 else
28 "UNKNOWN"
29 }";
30 installPhase = ''
31 mkdir -p $out/bin
32 cp nmon $out/bin
33 '';
34
35 meta = with lib; {
36 description = "AIX & Linux Performance Monitoring tool";
37 mainProgram = "nmon";
38 homepage = "https://nmon.sourceforge.net";
39 license = licenses.gpl3Plus;
40 platforms = platforms.linux;
41 maintainers = with maintainers; [ sveitser ];
42 };
43}