2022-09-09 14:08:57 +00:00
|
|
|
{ lib, stdenv, fetchzip, jre, makeWrapper, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "LanguageTool";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "6.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://www.languagetool.org/download/${pname}-${version}.zip";
|
2023-08-04 22:07:22 +00:00
|
|
|
sha256 = "sha256-I0Blp3o+NVL0b/86UTztufwKVkgO9KNXtBuUrUnbWco=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-26 19:14:03 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share
|
2021-01-15 22:18:51 +00:00
|
|
|
mv -- * $out/share/
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
for lt in languagetool{,-commandline,-server};do
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/$lt \
|
|
|
|
--add-flags "-cp $out/share/ -jar $out/share/$lt.jar"
|
|
|
|
done
|
|
|
|
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/languagetool-http-server \
|
|
|
|
--add-flags "-cp $out/share/languagetool-server.jar org.languagetool.server.HTTPServer"
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
passthru.tests.languagetool = nixosTests.languagetool;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://languagetool.org";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
2020-12-25 13:55:36 +00:00
|
|
|
platforms = jre.meta.platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A proofreading program for English, French German, Polish, and more";
|
|
|
|
};
|
|
|
|
}
|