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