2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchzip, jre, makeWrapper }:
|
2016-10-05 13:05:27 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "LanguageTool";
|
2022-01-02 21:00:50 +00:00
|
|
|
version = "5.6";
|
2017-11-21 12:01:41 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://www.languagetool.org/download/${pname}-${version}.zip";
|
2022-01-02 21:00:50 +00:00
|
|
|
sha256 = "sha256-HsRAu8exGXCGF0P7wZaDtuAKRDmNjMF9P2hFliZ1RXo=";
|
2016-10-05 13:05:27 +00:00
|
|
|
};
|
2017-11-21 12:01:41 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-25 15:01:20 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2017-11-21 12:01:41 +00:00
|
|
|
mkdir -p $out/share
|
2021-01-11 11:17:26 +00:00
|
|
|
mv -- * $out/share/
|
2017-11-21 12:01:41 +00:00
|
|
|
|
2016-10-05 13:05:27 +00:00
|
|
|
for lt in languagetool{,-commandline,-server};do
|
2017-11-21 12:01:41 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/$lt \
|
|
|
|
--add-flags "-cp $out/share/ -jar $out/share/$lt.jar"
|
2016-10-05 13:05:27 +00:00
|
|
|
done
|
2017-11-21 12:01:41 +00:00
|
|
|
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/languagetool-http-server \
|
|
|
|
--add-flags "-cp $out/share/languagetool-server.jar org.languagetool.server.HTTPServer"
|
2021-04-25 15:01:20 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-10-05 13:05:27 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-03-27 04:20:20 +00:00
|
|
|
homepage = "https://languagetool.org";
|
2016-10-05 15:04:50 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2021-01-11 11:17:26 +00:00
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
2020-12-20 04:20:00 +00:00
|
|
|
platforms = jre.meta.platforms;
|
2017-11-21 12:01:41 +00:00
|
|
|
description = "A proofreading program for English, French German, Polish, and more";
|
2016-10-05 13:05:27 +00:00
|
|
|
};
|
|
|
|
}
|