Skip to content

Commit

Permalink
addpkg(main/languagetool): languagetool 6.5
Browse files Browse the repository at this point in the history
Closes #21086
  • Loading branch information
mbekkomo committed Nov 13, 2024
1 parent 9558b2a commit 3cc6ebf
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/languagetool-libs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
TERMUX_PKG_HOMEPAGE=https://languagetool.org
TERMUX_PKG_DESCRIPTION="Libraries needed for languagetool"
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=6.5
TERMUX_PKG_SRCURL=https://languagetool.org/download/LanguageTool-${TERMUX_PKG_VERSION}.zip
TERMUX_PKG_SHA256=27f3ae5a29efbc8267a5a266908dfec205d16d312af8516e0b5bcec871edea0b
TERMUX_PKG_BUILD_IN_SRC=true

termux_step_make_install() {
mkdir -p "${TERMUX_PREFIX}/share/java/languagetool/libs"
mv ./languagetool-{commandline,server}.jar "${TERMUX_PREFIX}/share/java/languagetool"
mv ./libs/*.jar "${TERMUX_PREFIX}/share/java/libs"

for pair_raw in \
"languagetool org.languagetool.commandline.Main" \
"languagetool-http-server org.languagetool.server.HTTPServer" \
"languagetool-https-server org.languagetool.server.HTTPSServer"; do
# shellcheck disable=SC2206
local pair=($pair_raw)
sed "s|@MAIN@|${pair[1]}|g" "${TERMUX_PKG_BUILDER_DIR}/languagetool.sh" > "${TERMUX_PREFIX}/bin/${pair[0]}"
chmod 700 "${TERMUX_PREFIX}/bin/${pair[0]}"
done
}
3 changes: 3 additions & 0 deletions packages/languagetool-libs/languagetool-server.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TERMUX_SUBPKG_INCLUDE="bin/languagetool-http-server bin/languagetool-https-server"
TERMUX_SUBPKG_DEPENDS="openjdk-17"
TERMUX_SUBPKG_DESCRIPTION="Server for languagetool"
10 changes: 10 additions & 0 deletions packages/languagetool-libs/languagetool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/data/data/com.termux/files/usr/bin/env bash

main="@MAIN@"

mods="${TERMUX_PREFIX}/share/languagetool"
for jar in "${TERMUX_PREFIX}/share/java/langugetool"/*.jar; do
mods=$mods:$jar
done

exec "${JAVA_HOME}/bin/java" -cp "$mods" "$main" "$@"
3 changes: 3 additions & 0 deletions packages/languagetool-libs/languagetool.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TERMUX_SUBPKG_INCLUDE="share/java/languagetool/libs"
TERMUX_SUBPKGS_DEPENDS="openjdk-17"
TERMUX_SUBPKG_DESCRIPTION="Style and Grammar Checker for 25+ Languages"

0 comments on commit 3cc6ebf

Please sign in to comment.