Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 45 lines 1.3 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 jre, 6}: 7 8stdenv.mkDerivation rec { 9 pname = "antlr"; 10 version = "3.4"; 11 src = fetchurl { 12 url = "https://www.antlr3.org/download/antlr-${version}-complete.jar"; 13 sha256 = "1xqbam8vf04q5fasb0m2n1pn5dbp2yw763sj492ncq04c5mqcglx"; 14 }; 15 16 dontUnpack = true; 17 18 installPhase = '' 19 mkdir -p "$out"/{lib/antlr,bin} 20 cp "$src" "$out/lib/antlr/antlr-${version}-complete.jar" 21 22 echo "#! ${stdenv.shell}" >> "$out/bin/antlr" 23 echo "'${jre}/bin/java' -cp '$out/lib/antlr/antlr-${version}-complete.jar' -Xms200M -Xmx400M org.antlr.Tool \"\$@\"" >> "$out/bin/antlr" 24 25 chmod a+x "$out/bin/antlr" 26 ln -s "$out/bin/antlr"{,3} 27 ''; 28 29 inherit jre; 30 31 meta = with lib; { 32 description = "Powerful parser generator"; 33 longDescription = '' 34 ANTLR (ANother Tool for Language Recognition) is a powerful parser 35 generator for reading, processing, executing, or translating structured 36 text or binary files. It's widely used to build languages, tools, and 37 frameworks. From a grammar, ANTLR generates a parser that can build and 38 walk parse trees. 39 ''; 40 homepage = "https://www.antlr.org/"; 41 sourceProvenance = with sourceTypes; [ binaryBytecode ]; 42 license = licenses.bsd3; 43 platforms = platforms.linux ++ platforms.darwin; 44 }; 45}