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