1 { lib, stdenv, fetchFromGitHub
2 , attr, judy, keyutils, libaio, libapparmor, libbsd, libcap, libgcrypt, lksctp-tools, zlib
6 stdenv.mkDerivation rec {
10 src = fetchFromGitHub {
11 owner = "ColinIanKing";
14 hash = "sha256-zQKyVzfqDzarEhb2tlndQ60GuIkL5a2fXh86wIdWLDk=";
18 sed -i '/\#include <bsd\/string.h>/i #undef HAVE_STRLCAT\n#undef HAVE_STRLCPY' stress-ng.h
19 ''; # needed because of Darwin patch on libbsd
21 # All platforms inputs then Linux-only ones
22 buildInputs = [ judy libbsd libgcrypt zlib ]
23 ++ lib.optionals stdenv.hostPlatform.isLinux [
24 attr keyutils libaio libapparmor libcap lksctp-tools libglvnd mesa
28 "BINDIR=${placeholder "out"}/bin"
29 "MANDIR=${placeholder "out"}/share/man/man1"
30 "JOBDIR=${placeholder "out"}/share/stress-ng/example-jobs"
31 "BASHDIR=${placeholder "out"}/share/bash-completion/completions"
34 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
36 # Won't build on i686 because the binary will be linked again in the
37 # install phase without checking the dependencies. This will prevent
38 # triggering the rebuild. Why this only happens on i686 remains a
39 # mystery, though. :-(
40 enableParallelBuilding = (!stdenv.hostPlatform.isi686);
43 description = "Stress test a computer system";
45 stress-ng will stress test a computer system in various selectable ways. It
46 was designed to exercise various physical subsystems of a computer as well as
47 the various operating system kernel interfaces. Stress-ng features:
49 * over 210 stress tests
50 * over 50 CPU specific stress tests that exercise floating point, integer,
51 bit manipulation and control flow
52 * over 20 virtual memory stress tests
53 * portable: builds on Linux, Solaris, *BSD, Minix, Android, MacOS X,
54 Debian Hurd, Haiku, Windows Subsystem for Linux and SunOs/Dilos with
55 gcc, clang, tcc and pcc.
57 stress-ng was originally intended to make a machine work hard and trip hardware
58 issues such as thermal overruns as well as operating system bugs that only
59 occur when a system is being thrashed hard. Use stress-ng with caution as some
60 of the tests can make a system run hot on poorly designed hardware and also can
61 cause excessive system thrashing which may be difficult to stop.
63 stress-ng can also measure test throughput rates; this can be useful to observe
64 performance changes across different operating system releases or types of
65 hardware. However, it has never been intended to be used as a precise benchmark
66 test suite, so do NOT use it in this manner.
68 homepage = "https://github.com/ColinIanKing/stress-ng";
69 downloadPage = "https://github.com/ColinIanKing/stress-ng/tags";
70 changelog = "https://github.com/ColinIanKing/stress-ng/raw/V${version}/debian/changelog";
71 license = licenses.gpl2Plus;
72 maintainers = with maintainers; [ c0bw3b ];
73 platforms = platforms.unix;
74 mainProgram = "stress-ng";