2021-01-11 07:54:33 +00:00
|
|
|
{ cmake, fetchFromGitHub, fetchpatch, json_c, libpcap, ncurses, lib, stdenv, libtirpc }:
|
2019-11-04 15:45:39 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nfstrace";
|
|
|
|
version = "0.4.3.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "epam";
|
|
|
|
repo = "nfstrace";
|
2020-11-01 22:39:49 +00:00
|
|
|
rev = version;
|
2019-11-04 15:45:39 +00:00
|
|
|
sha256 = "1djsyn7i3xp969rnmsdaf5vwjiik9wylxxrc5nm7by00i76c1vsg";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://salsa.debian.org/debian/nfstrace/raw/debian/0.4.3.1-3/debian/patches/reproducible_build.patch";
|
|
|
|
sha256 = "0fd96r8xi142kjwibqkd46s6jwsg5kfc5v28bqsj9rdlc2aqmay5";
|
|
|
|
})
|
2021-05-16 20:10:06 +01:00
|
|
|
# Fixes build failure with gcc-10
|
|
|
|
# Related PR https://github.com/epam/nfstrace/pull/42/commits/4562a895ed3ac0e811bdd489068ad3ebe4d7b501
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/epam/nfstrace/commit/4562a895ed3ac0e811bdd489068ad3ebe4d7b501.patch";
|
|
|
|
sha256 = "1fbicbllyykjknik7asa81x0ixxmbwqwkiz74cnznagv10jlkj3p";
|
|
|
|
})
|
2021-11-18 08:18:23 +00:00
|
|
|
|
|
|
|
# Fix pending upstream inclusion for ncurses-6.3 support:
|
|
|
|
# https://github.com/epam/nfstrace/pull/50
|
|
|
|
(fetchpatch {
|
|
|
|
name = "ncurses-6.3.patch";
|
|
|
|
url = "https://github.com/epam/nfstrace/commit/29c7c415f5412df1aae9b1e6ed3a2760d2c227a0.patch";
|
|
|
|
sha256 = "134709w6bld010jx3xdy9imcjzal904a84n9f8vv0wnas5clxdmx";
|
|
|
|
})
|
2019-11-04 15:45:39 +00:00
|
|
|
];
|
|
|
|
|
2020-01-06 16:59:51 +00:00
|
|
|
postPatch = ''
|
2021-11-30 19:31:55 +00:00
|
|
|
# -Wall -Wextra -Werror fails on clang and newer gcc
|
2020-01-06 16:59:51 +00:00
|
|
|
substituteInPlace CMakeLists.txt \
|
2021-11-30 19:31:55 +00:00
|
|
|
--replace "-Wno-braced-scalar-init" "" \
|
2021-11-18 08:18:23 +00:00
|
|
|
--replace "-Werror" ""
|
2020-01-06 16:59:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-08-12 09:59:19 +01:00
|
|
|
buildInputs = [ json_c libpcap ncurses libtirpc ];
|
2019-11-04 15:45:39 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
# To build with GCC 8+ it needs:
|
2019-11-12 17:31:22 +00:00
|
|
|
CXXFLAGS = "-Wno-class-memaccess -Wno-ignored-qualifiers";
|
2019-11-04 15:45:39 +00:00
|
|
|
# CMake can't find json_c without:
|
2020-08-12 09:59:19 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-I${json_c.dev}/include/json-c" "-Wno-error=address-of-packed-member" "-I${libtirpc.dev}/include/tirpc" ];
|
|
|
|
NIX_LDFLAGS = [ "-ltirpc" ];
|
2019-11-04 15:45:39 +00:00
|
|
|
|
|
|
|
doCheck = false; # requires network access
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-11-04 15:45:39 +00:00
|
|
|
homepage = "http://epam.github.io/nfstrace/";
|
|
|
|
description = "NFS and CIFS tracing/monitoring/capturing/analyzing tool";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|