nixpkgs/pkgs/tools/networking/nfstrace/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

44 lines
1.3 KiB
Nix

{ cmake, fetchFromGitHub, fetchpatch, json_c, libpcap, ncurses, lib, stdenv, libtirpc }:
stdenv.mkDerivation rec {
pname = "nfstrace";
version = "0.4.3.2";
src = fetchFromGitHub {
owner = "epam";
repo = "nfstrace";
rev = version;
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";
})
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "-Wno-braced-scalar-init" ""
'';
buildInputs = [ json_c libpcap ncurses libtirpc ];
nativeBuildInputs = [ cmake ];
# To build with GCC 8+ it needs:
CXXFLAGS = "-Wno-class-memaccess -Wno-ignored-qualifiers";
# CMake can't find json_c without:
NIX_CFLAGS_COMPILE = [ "-I${json_c.dev}/include/json-c" "-Wno-error=address-of-packed-member" "-I${libtirpc.dev}/include/tirpc" ];
NIX_LDFLAGS = [ "-ltirpc" ];
doCheck = false; # requires network access
meta = with lib; {
homepage = "http://epam.github.io/nfstrace/";
description = "NFS and CIFS tracing/monitoring/capturing/analyzing tool";
license = licenses.gpl2;
platforms = platforms.linux;
};
}