about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/stress-ng/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/system/stress-ng/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/system/stress-ng/default.nix25
1 files changed, 16 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/tools/system/stress-ng/default.nix b/nixpkgs/pkgs/tools/system/stress-ng/default.nix
index 9a9879d55641..7d3e62d7beb5 100644
--- a/nixpkgs/pkgs/tools/system/stress-ng/default.nix
+++ b/nixpkgs/pkgs/tools/system/stress-ng/default.nix
@@ -1,25 +1,34 @@
 { stdenv, fetchurl
-, attr, keyutils, libaio, libapparmor, libbsd, libcap, libgcrypt, lksctp-tools, zlib
+, attr, judy, keyutils, libaio, libapparmor, libbsd, libcap, libgcrypt, lksctp-tools, zlib
 }:
 
 stdenv.mkDerivation rec {
   pname = "stress-ng";
-  version = "0.10.02";
+  version = "0.10.14";
 
   src = fetchurl {
     url = "https://kernel.ubuntu.com/~cking/tarballs/${pname}/${pname}-${version}.tar.xz";
-    sha256 = "100daxz0j80jhmpfnqa78mvfwq1qj7zb67y7w9f747a0f1havvim";
+    sha256 = "0lazjxrlqzhxd6fg3y1vh38h66v8swkd9q2say4m6sglzkfqdfnq";
   };
 
+  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
+
   # All platforms inputs then Linux-only ones
-  buildInputs = [ libbsd libgcrypt zlib ]
+  buildInputs = [ judy libbsd libgcrypt zlib ]
     ++ stdenv.lib.optionals stdenv.hostPlatform.isLinux [
       attr keyutils libaio libapparmor libcap lksctp-tools
     ];
 
-  postPatch = ''
-    substituteInPlace Makefile --replace "/usr" ""
-  '';
+  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"
+  ];
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
 
   # Won't build on i686 because the binary will be linked again in the
   # install phase without checking the dependencies. This will prevent
@@ -27,8 +36,6 @@ stdenv.mkDerivation rec {
   # mystery, though. :-(
   enableParallelBuilding = (!stdenv.isi686);
 
-  installFlags = [ "DESTDIR=${placeholder "out"}" ];
-
   meta = with stdenv.lib; {
     description = "Stress test a computer system";
     longDescription = ''