2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ant
|
|
|
|
, jdk
|
|
|
|
, jre
|
|
|
|
, makeWrapper
|
2024-04-21 15:54:59 +00:00
|
|
|
, stripJavaArchivesHook
|
2024-01-13 08:15:51 +00:00
|
|
|
}:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-02-05 17:12:51 +00:00
|
|
|
pname = "javacc";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "7.0.13";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-13 08:15:51 +00:00
|
|
|
owner = "javacc";
|
|
|
|
repo = "javacc";
|
|
|
|
rev = "javacc-${finalAttrs.version}";
|
|
|
|
hash = "sha256-nDJvKIbJc23Tvfn7Zqvt5tDDffNf4KQ0juGQQCZ+i1c=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
|
|
|
jdk
|
|
|
|
makeWrapper
|
2024-04-21 15:54:59 +00:00
|
|
|
stripJavaArchivesHook
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2024-01-13 08:15:51 +00:00
|
|
|
runHook preBuild
|
2021-02-05 17:12:51 +00:00
|
|
|
ant jar
|
2024-01-13 08:15:51 +00:00
|
|
|
runHook postBuild
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-01-13 08:15:51 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm644 target/javacc.jar -t $out/target
|
|
|
|
install -Dm755 scripts/{javacc,jjdoc,jjtree,jjrun} -t $out/bin
|
|
|
|
|
|
|
|
for file in $out/bin/*; do
|
2022-09-09 14:08:57 +00:00
|
|
|
wrapProgram "$file" --suffix PATH : ${jre}/bin
|
|
|
|
done
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
doCheck = true;
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
ant test
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/javacc/javacc/blob/${finalAttrs.src.rev}/docs/release-notes.md";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Parser generator for building parsers from grammars";
|
2024-01-13 08:15:51 +00:00
|
|
|
homepage = "https://javacc.github.io/javacc";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.bsd2;
|
2024-01-13 08:15:51 +00:00
|
|
|
mainProgram = "javacc";
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = teams.deshaw.members;
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
})
|