summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/sn/sngrep/package.nix
blob: a047885fc73f2fa3f006aeb387e26cd9696d421e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
  lib,
  stdenv,
  autoconf,
  automake,
  fetchFromGitHub,
  libgcrypt,
  libpcap,
  ncurses,
  openssl,
  pcre2,
  pkg-config,
  fetchpatch,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "sngrep";
  version = "1.8.4";

  src = fetchFromGitHub {
    owner = "irontec";
    repo = "sngrep";
    rev = "v${finalAttrs.version}";
    hash = "sha256-tKIyU8W6Jvp0hoegCpOOIsJkMfEEtmfv9Se7VIQ7hVo=";
  };

  nativeBuildInputs = [
    autoconf
    automake
    pkg-config
  ];

  buildInputs = [
    libgcrypt
    libpcap
    ncurses
    openssl
    pcre2
  ];

  configureFlags = [
    "--with-pcre2"
    "--enable-unicode"
    "--enable-ipv6"
    "--enable-eep"
    "--with-openssl"
  ];

  patches = [
    # TODO: Remove this patch when updating to version 1.8.5
    (fetchpatch {
      name = "CVE-2026-90558.patch";
      url = "https://github.com/irontec/sngrep/commit/1ff74ee3ab5ff280e8ba976aa8c744dca57eb35b.patch";
      hash = "sha256-QizEvKztbosj3GoRtG9yxeqTglyBNLuuOmPF92XU7BE=";
    })

    ./fix-sng_strncpy-declaration.patch
  ];

  preConfigure = ''
    ./bootstrap.sh
  '';

  doCheck = true;

  meta = {
    description = "Tool for displaying SIP calls message flows from terminal";
    mainProgram = "sngrep";
    homepage = "https://github.com/irontec/sngrep";
    license = lib.licenses.gpl3Plus;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ jorise ];
  };
})