python312Packages.icontract: relax deps (#380554)
[NixPkgs.git] / pkgs / by-name / ne / nethoscope / package.nix
bloba7bc672c2338b184635e3019592ef6c4ca479980
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   pkg-config,
6   alsa-lib,
7   libpcap,
8   expect,
9 }:
11 rustPlatform.buildRustPackage rec {
12   pname = "nethoscope";
13   version = "0.1.1";
15   src = fetchFromGitHub {
16     owner = "vvilhonen";
17     repo = "nethoscope";
18     rev = "v${version}";
19     hash = "sha256-v7GO+d4b0N3heN10+WSUJEpcShKmx4BPR1FyZoELWzc=";
20   };
22   useFetchCargoVendor = true;
23   cargoHash = "sha256-Psu47S39/46ksv7YUU/Ppq3IB70tL2D5ZjaPdpOrrdM=";
25   nativeBuildInputs = [
26     pkg-config
27   ];
28   buildInputs = [
29     alsa-lib
30     libpcap
31   ];
33   LD_LIBRARY_PATH = lib.makeLibraryPath [
34     libpcap
35     alsa-lib
36   ];
38   doInstallCheck = true;
39   installCheckPhase = ''
40     if [[ "$(${expect}/bin/unbuffer "$out/bin/${pname}" --help 2> /dev/null | strings | grep ${version} | tr -d '\n')" == " ${version}" ]]; then
41       echo '${pname} smoke check passed'
42     else
43       echo '${pname} smoke check failed'
44       return 1
45     fi
46   '';
48   meta = with lib; {
49     description = "Listen to your network traffic";
50     longDescription = ''
51       Employ your built-in wetware pattern recognition and
52       signal processing facilities to understand your network traffic.
53     '';
54     homepage = "https://github.com/vvilhonen/nethoscope";
55     license = licenses.isc;
56     maintainers = with maintainers; [ _0x4A6F ];
57     platforms = platforms.linux;
58     mainProgram = "nethoscope";
59   };