about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/parsing/spicy/default.nix
blob: bd7c8c4db0aeb1fd2e96026a8f3bac8634bc1d30 (plain) (blame)
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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, makeWrapper
, python3
, bison
, flex
, zlib
}:

stdenv.mkDerivation rec {
  pname = "spicy";
  version = "1.8.1";

  strictDeps = true;

  src = fetchFromGitHub {
    owner = "zeek";
    repo = "spicy";
    rev = "v${version}";
    hash = "sha256-Cb+HYUObL3So3ZcG4Iy276rdO0TC9rholwEBIYA5BNU=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    cmake
    makeWrapper
    python3
  ];

  buildInputs = [
    bison
    flex
    zlib
  ];

  postPatch = ''
    patchShebangs scripts tests/scripts
  '';

  cmakeFlags = [
    "-DHILTI_DEV_PRECOMPILE_HEADERS=OFF"
  ];

  preFixup = ''
    for b in $out/bin/*
      do wrapProgram "$b" --prefix PATH : "${lib.makeBinPath [ bison flex ]}"
    done
  '';

  meta = with lib; {
    homepage = "https://github.com/zeek/spicy";
    description = "A C++ parser generator for dissecting protocols & files";
    longDescription = ''
      Spicy is a parser generator that makes it easy to create robust C++
      parsers for network protocols, file formats, and more. Spicy is a bit
      like a "yacc for protocols", but it's much more than that: It's an
      all-in-one system enabling developers to write attributed grammars that
      describe both syntax and semantics of an input format using a single,
      unified language. Think of Spicy as a domain-specific scripting language
      for all your parsing needs.
    '';
    license = licenses.bsd3;
    maintainers = with maintainers; [ tobim ];
  };
}