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";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "7.0.13";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "${pname}-${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "sha256-nDJvKIbJc23Tvfn7Zqvt5tDDffNf4KQ0juGQQCZ+i1c=";
|
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
|
|
|
};
|
|
|
|
}
|