@@ -1,28 +1,19 @@
1−{ stdenv, fetchFromGitHub, fetchpatch, bash, coreutils, gdb, zlib }:
1+{ stdenv, fetchFromGitHub, bash, coreutils, gdb, zlib }:
22
33stdenv.mkDerivation rec {
44 pname = "procdump";
5− version = "1.0.1";
5+ version = "1.1";
66
77 src = fetchFromGitHub {
88 owner = "Microsoft";
99 repo = "ProcDump-for-Linux";
1010 rev = version;
11− sha256 = "1lkm05hq4hl1vadj9ifm18hi7cbf5045xlfxdfbrpsl6kxgfwcc4";
11+ sha256 = "1pcf6cpslpazla0na0q680dih9wb811q5irr7d2zmw0qmxm33jw2";
1212 };
1313
1414 nativeBuildInputs = [ zlib ];
1515 buildInputs = [ bash coreutils gdb ];
1616
17− patches = [
18− # Fix name conflict when built with musl
19− # TODO: check if fixed upstream https://github.com/Microsoft/ProcDump-for-Linux/pull/50
20− (fetchpatch {
21− url = "https://github.com/Microsoft/ProcDump-for-Linux/commit/1b7b50b910f20b463fb628c8213663c8a8d11d0d.patch";
22− sha256 = "0h0dj3gi6hw1wdpc0ih9s4kkagv0d9jzrg602cr85r2z19lmb7yk";
23− })
24− ];
25−
2617 postPatch = ''
2718 substituteInPlace src/CoreDumpWriter.c \
2819 --replace '"gcore ' '"${gdb}/bin/gcore ' \
@@ -31,16 +22,26 @@ stdenv.mkDerivation rec {
3122 '';
3223
3324 makeFlags = [
34− "DESTDIR=$(out)"
25+ "DESTDIR=${placeholder "out"}"
3526 "INSTALLDIR=/bin"
3627 "MANDIR=/share/man/man1"
3728 ];
3829
39− doCheck = false; # needs root
30+ doCheck = false; # needs sudo root
31+
32+ doInstallCheck = true;
33+ installCheckPhase = ''
34+ runHook preInstallCheck
35+ set +o pipefail
36+ ($out/bin/procdump -h | grep "ProcDump v${version}") ||
37+ (echo "ERROR: ProcDump is not the expected version or does not run properly" ; exit 1)
38+ set -o pipefail
39+ runHook postInstallCheck
40+ '';
4041
4142 meta = with stdenv.lib; {
4243 description = "A Linux version of the ProcDump Sysinternals tool";
43− homepage = https://github.com/Microsoft/ProcDump-for-Linux;
44+ homepage = "https://github.com/Microsoft/ProcDump-for-Linux";
4445 license = licenses.mit;
4546 maintainers = with maintainers; [ c0bw3b ];
4647 platforms = platforms.linux;