biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / networking / nfstrace / default.nix
blobc54a5deec46fcacdfe00b029b1e3da101d0ed44d
1 { cmake, fetchFromGitHub, fetchpatch, json_c, libpcap, ncurses, lib, stdenv, libtirpc }:
3 stdenv.mkDerivation rec {
4   pname = "nfstrace";
5   version = "0.4.3.2";
7   src = fetchFromGitHub {
8     owner = "epam";
9     repo = "nfstrace";
10     rev = version;
11     sha256 = "1djsyn7i3xp969rnmsdaf5vwjiik9wylxxrc5nm7by00i76c1vsg";
12   };
14   patches = [
15     (fetchpatch {
16       url = "https://salsa.debian.org/debian/nfstrace/raw/debian/0.4.3.1-3/debian/patches/reproducible_build.patch";
17       sha256 = "0fd96r8xi142kjwibqkd46s6jwsg5kfc5v28bqsj9rdlc2aqmay5";
18     })
19     # Fixes build failure with gcc-10
20     # Related PR https://github.com/epam/nfstrace/pull/42/commits/4562a895ed3ac0e811bdd489068ad3ebe4d7b501
21     (fetchpatch {
22       url = "https://github.com/epam/nfstrace/commit/4562a895ed3ac0e811bdd489068ad3ebe4d7b501.patch";
23       sha256 = "1fbicbllyykjknik7asa81x0ixxmbwqwkiz74cnznagv10jlkj3p";
24     })
26     # Fix pending upstream inclusion for ncurses-6.3 support:
27     #  https://github.com/epam/nfstrace/pull/50
28     (fetchpatch {
29       name = "ncurses-6.3.patch";
30       url = "https://github.com/epam/nfstrace/commit/29c7c415f5412df1aae9b1e6ed3a2760d2c227a0.patch";
31       sha256 = "134709w6bld010jx3xdy9imcjzal904a84n9f8vv0wnas5clxdmx";
32     })
33   ];
35   postPatch = ''
36    # -Wall -Wextra -Werror fails on clang and newer gcc
37     substituteInPlace CMakeLists.txt \
38       --replace "-Wno-braced-scalar-init" "" \
39       --replace "-Werror" ""
40   '';
42   buildInputs = [ json_c libpcap ncurses libtirpc ];
43   nativeBuildInputs = [ cmake ];
45   # To build with GCC 8+ it needs:
46   CXXFLAGS = "-Wno-class-memaccess -Wno-ignored-qualifiers";
47   # CMake can't find json_c without:
48   env.NIX_CFLAGS_COMPILE = toString [ "-I${json_c.dev}/include/json-c" "-Wno-error=address-of-packed-member" "-I${libtirpc.dev}/include/tirpc" ];
49   NIX_LDFLAGS = [ "-ltirpc" ];
51   doCheck = false; # requires network access
53   meta = with lib; {
54     homepage = "http://epam.github.io/nfstrace/";
55     description = "NFS and CIFS tracing/monitoring/capturing/analyzing tool";
56     license = licenses.gpl2Only;
57     platforms = platforms.linux;
58     mainProgram = "nfstrace";
59   };