depot/third_party/nixpkgs/pkgs/development/tools/parsing/javacc/default.nix
Default email b450903751 Project import generated by Copybara.
GitOrigin-RevId: 74a1793c659d09d7cf738005308b1f86c90cb59b
2022-09-09 16:08:57 +02:00

39 lines
927 B
Nix

{ stdenv, lib, fetchFromGitHub, ant, jdk, jre, makeWrapper }:
stdenv.mkDerivation rec {
pname = "javacc";
version = "7.0.12";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "${pname}-${version}";
sha256 = "sha256-tDtstF3ivKjG01vOZ8Ga1zTjIZFSTWt5QPY1VQvyFMU=";
};
nativeBuildInputs = [ ant jdk makeWrapper ];
buildPhase = ''
ant jar
'';
installPhase = ''
mkdir -p $out/target
mv scripts $out/bin
mv target/javacc.jar $out/target/
find -L "$out/bin" -type f -executable -print0 \
| while IFS= read -r -d ''' file; do
wrapProgram "$file" --suffix PATH : ${jre}/bin
done
'';
doCheck = true;
checkPhase = "ant test";
meta = with lib; {
homepage = "https://javacc.github.io/javacc";
description = "A parser generator for building parsers from grammars";
license = licenses.bsd2;
maintainers = teams.deshaw.members;
};
}