2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl
|
2019-10-31 08:58:44 +01:00
|
|
|
, attr, judy, keyutils, libaio, libapparmor, libbsd, libcap, libgcrypt, lksctp-tools, zlib
|
2018-11-17 16:21:00 +01:00
|
|
|
}:
|
2015-01-14 10:02:05 +01:00
|
|
|
|
2016-01-25 20:08:34 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-05-13 13:34:07 +02:00
|
|
|
pname = "stress-ng";
|
2021-09-22 08:26:58 +02:00
|
|
|
version = "0.13.03";
|
2015-01-14 10:02:05 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-05-13 13:34:07 +02:00
|
|
|
url = "https://kernel.ubuntu.com/~cking/tarballs/${pname}/${pname}-${version}.tar.xz";
|
2021-09-22 08:26:58 +02:00
|
|
|
sha256 = "sha256-PmDWBeN42GqFkaMNblV77XCdgqWxlhY3gALNj/ADeos=";
|
2015-01-14 10:02:05 +01:00
|
|
|
};
|
|
|
|
|
2019-10-31 08:58:44 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/\#include <bsd\/string.h>/i #undef HAVE_STRLCAT\n#undef HAVE_STRLCPY' stress-ng.h
|
|
|
|
''; # needed because of Darwin patch on libbsd
|
|
|
|
|
2018-11-17 16:21:00 +01:00
|
|
|
# All platforms inputs then Linux-only ones
|
2019-10-31 08:58:44 +01:00
|
|
|
buildInputs = [ judy libbsd libgcrypt zlib ]
|
2021-01-15 10:19:50 +01:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
2018-11-17 16:21:00 +01:00
|
|
|
attr keyutils libaio libapparmor libcap lksctp-tools
|
|
|
|
];
|
2015-04-15 03:12:23 +02:00
|
|
|
|
2019-10-31 08:58:44 +01:00
|
|
|
makeFlags = [
|
|
|
|
"BINDIR=${placeholder "out"}/bin"
|
|
|
|
"MANDIR=${placeholder "out"}/share/man/man1"
|
|
|
|
"JOBDIR=${placeholder "out"}/share/stress-ng/example-jobs"
|
|
|
|
"BASHDIR=${placeholder "out"}/share/bash-completion/completions"
|
|
|
|
];
|
2015-01-14 10:02:05 +01:00
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
|
2019-09-15 01:12:36 +02:00
|
|
|
|
2016-08-25 04:38:18 +02:00
|
|
|
# Won't build on i686 because the binary will be linked again in the
|
|
|
|
# install phase without checking the dependencies. This will prevent
|
|
|
|
# triggering the rebuild. Why this only happens on i686 remains a
|
|
|
|
# mystery, though. :-(
|
|
|
|
enableParallelBuilding = (!stdenv.isi686);
|
2015-01-14 10:02:05 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2015-01-14 10:02:05 +01:00
|
|
|
description = "Stress test a computer system";
|
|
|
|
longDescription = ''
|
2019-05-13 13:34:07 +02:00
|
|
|
stress-ng will stress test a computer system in various selectable ways. It
|
|
|
|
was designed to exercise various physical subsystems of a computer as well as
|
|
|
|
the various operating system kernel interfaces. Stress-ng features:
|
|
|
|
|
|
|
|
* over 210 stress tests
|
|
|
|
* over 50 CPU specific stress tests that exercise floating point, integer,
|
|
|
|
bit manipulation and control flow
|
|
|
|
* over 20 virtual memory stress tests
|
|
|
|
* portable: builds on Linux, Solaris, *BSD, Minix, Android, MacOS X,
|
|
|
|
Debian Hurd, Haiku, Windows Subsystem for Linux and SunOs/Dilos with
|
|
|
|
gcc, clang, tcc and pcc.
|
|
|
|
|
|
|
|
stress-ng was originally intended to make a machine work hard and trip hardware
|
|
|
|
issues such as thermal overruns as well as operating system bugs that only
|
|
|
|
occur when a system is being thrashed hard. Use stress-ng with caution as some
|
|
|
|
of the tests can make a system run hot on poorly designed hardware and also can
|
|
|
|
cause excessive system thrashing which may be difficult to stop.
|
|
|
|
|
|
|
|
stress-ng can also measure test throughput rates; this can be useful to observe
|
|
|
|
performance changes across different operating system releases or types of
|
|
|
|
hardware. However, it has never been intended to be used as a precise benchmark
|
|
|
|
test suite, so do NOT use it in this manner.
|
2015-01-14 10:02:05 +01:00
|
|
|
'';
|
2019-05-13 13:34:07 +02:00
|
|
|
homepage = "https://kernel.ubuntu.com/~cking/stress-ng/";
|
|
|
|
downloadPage = "https://kernel.ubuntu.com/~cking/tarballs/stress-ng/";
|
|
|
|
changelog = "https://kernel.ubuntu.com/git/cking/stress-ng.git/plain/debian/changelog?h=V${version}";
|
2015-05-28 19:20:29 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2018-11-17 16:21:00 +01:00
|
|
|
maintainers = with maintainers; [ c0bw3b ];
|
2019-05-13 13:34:07 +02:00
|
|
|
platforms = platforms.unix;
|
2015-01-14 10:02:05 +01:00
|
|
|
};
|
|
|
|
}
|