base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / sp / spicy-parser-generator / package.nix
blob6199fad8e63769196bb54f589139ff6c06ca5254
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , makeWrapper
6 , python3
7 , bison
8 , flex
9 , zlib
10 , apple-sdk_11
13 stdenv.mkDerivation rec {
14   pname = "spicy";
15   version = "1.11.3";
17   strictDeps = true;
19   src = fetchFromGitHub {
20     owner = "zeek";
21     repo = "spicy";
22     rev = "v${version}";
23     hash = "sha256-SKhNBqZRgeN2cZZ2lv/IsOqaa5LY666OlICewN/iPVA=";
24     fetchSubmodules = true;
25   };
27   nativeBuildInputs = [
28     bison
29     cmake
30     flex
31     makeWrapper
32     python3
33   ];
35   buildInputs = [
36     flex
37     zlib
38   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
39     apple-sdk_11
40   ];
42   postPatch = ''
43     patchShebangs scripts tests/scripts
44   '';
46   cmakeFlags = [
47     "-DHILTI_DEV_PRECOMPILE_HEADERS=OFF"
48   ];
50   preFixup = ''
51     for b in $out/bin/*
52       do wrapProgram "$b" --prefix PATH : "${lib.makeBinPath [ bison flex ]}"
53     done
54   '';
56   meta = with lib; {
57     homepage = "https://github.com/zeek/spicy";
58     description = "C++ parser generator for dissecting protocols & files";
59     longDescription = ''
60       Spicy is a parser generator that makes it easy to create robust C++
61       parsers for network protocols, file formats, and more. Spicy is a bit
62       like a "yacc for protocols", but it's much more than that: It's an
63       all-in-one system enabling developers to write attributed grammars that
64       describe both syntax and semantics of an input format using a single,
65       unified language. Think of Spicy as a domain-specific scripting language
66       for all your parsing needs.
67     '';
68     license = licenses.bsd3;
69     maintainers = with maintainers; [ tobim ];
70     platforms = platforms.unix;
71   };