biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / parsing / antlr / 3.5.nix
blob132da31fee35139ab9bce195b3d5f0bc62c86654
1 {lib, stdenv, fetchpatch, fetchurl, fetchFromGitHub, jre}:
3 stdenv.mkDerivation rec {
4   pname = "antlr";
5   version = "3.5.2";
6   jar = fetchurl {
7     url = "https://www.antlr3.org/download/antlr-${version}-complete.jar";
8     sha256 = "0srjwxipwsfzmpi0v32d1l5lzk9gi5in8ayg33sq8wyp8ygnbji6";
9   };
10   src = fetchFromGitHub {
11     owner = "antlr";
12     repo = "antlr3";
13     rev = "5c2a916a10139cdb5c7c8851ee592ed9c3b3d4ff";
14     sha256 = "1i0w2v9prrmczlwkfijfp4zfqfgrss90a7yk2hg3y0gkg2s4abbk";
15   };
17   patches = [
18     (fetchpatch {
19       url = "https://src.fedoraproject.org/rpms/antlr3/raw/f1bb8d639678047935e1761c3bf3c1c7da8d0f1d/f/0006-antlr3memory.hpp-fix-for-C-20-mode.patch";
20       sha256 = "0apk904afjqbad6c7z9r72a9lkbz69vwrl8j2a6zgxjn8dfb2p8b";
21     })
22   ];
24   installPhase = ''
25     mkdir -p "$out"/{lib/antlr,bin,include}
26     cp "$jar" "$out/lib/antlr/antlr-${version}-complete.jar"
27     cp runtime/Cpp/include/* $out/include/
29     echo "#! ${stdenv.shell}" >> "$out/bin/antlr"
30     echo "'${jre}/bin/java' -cp '$out/lib/antlr/antlr-${version}-complete.jar' -Xms200M -Xmx400M org.antlr.Tool \"\$@\"" >> "$out/bin/antlr"
32     chmod a+x "$out/bin/antlr"
33     ln -s "$out/bin/antlr"{,3}
34   '';
36   inherit jre;
38   meta = with lib; {
39     description = "Powerful parser generator";
40     longDescription = ''
41       ANTLR (ANother Tool for Language Recognition) is a powerful parser
42       generator for reading, processing, executing, or translating structured
43       text or binary files. It's widely used to build languages, tools, and
44       frameworks. From a grammar, ANTLR generates a parser that can build and
45       walk parse trees.
46     '';
47     homepage = "https://www.antlr.org/";
48     sourceProvenance = with sourceTypes; [ binaryBytecode ];
49     license = licenses.bsd3;
50     platforms = platforms.linux;
51     maintainers = [ lib.maintainers.farlion ];
52   };