From b35d187e841f33df949c340be0c452d98b3ba085 Mon Sep 17 00:00:00 2001 From: Komo <71205197+mbekkomo@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:01:07 +0800 Subject: [PATCH] addpkg(main/languagetool-libs),addpkg(x11/languagetool-gui): languagetool 6.5 Closes #21086 --- packages/languagetool-libs/build.sh | 24 ++++++++++++++++++ .../languagetool-server.subpackage.sh | 3 +++ packages/languagetool-libs/languagetool.sh | 10 ++++++++ .../languagetool.subpackage.sh | 3 +++ x11-packages/languagetool-gui/build.sh | 25 +++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 packages/languagetool-libs/build.sh create mode 100644 packages/languagetool-libs/languagetool-server.subpackage.sh create mode 100644 packages/languagetool-libs/languagetool.sh create mode 100644 packages/languagetool-libs/languagetool.subpackage.sh create mode 100644 x11-packages/languagetool-gui/build.sh diff --git a/packages/languagetool-libs/build.sh b/packages/languagetool-libs/build.sh new file mode 100644 index 000000000000000..226dd470abc29ac --- /dev/null +++ b/packages/languagetool-libs/build.sh @@ -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_PKG_PLATFORM_INDEPENDENT=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/languagetool/libs" + + for pair in \ + "languagetool org.languagetool.commandline.Main" \ + "languagetool-http-server org.languagetool.server.HTTPServer" \ + "languagetool-https-server org.languagetool.server.HTTPSServer"; do + read -r -d' ' package bin <<<"$pair" + sed "s|@MAIN@|$package|g" "${TERMUX_PKG_BUILDER_DIR}/languagetool.sh" > "${TERMUX_PREFIX}/bin/$bin" + chmod 700 "${TERMUX_PREFIX}/bin/$bin" + done +} diff --git a/packages/languagetool-libs/languagetool-server.subpackage.sh b/packages/languagetool-libs/languagetool-server.subpackage.sh new file mode 100644 index 000000000000000..05589fc57bc4474 --- /dev/null +++ b/packages/languagetool-libs/languagetool-server.subpackage.sh @@ -0,0 +1,3 @@ +TERMUX_SUBPKG_INCLUDE="bin/languagetool-http-server bin/languagetool-https-server share/java/languagetool/languagetool-server.jar" +TERMUX_SUBPKG_DEPENDS="openjdk-17" +TERMUX_SUBPKG_DESCRIPTION="Server for languagetool" diff --git a/packages/languagetool-libs/languagetool.sh b/packages/languagetool-libs/languagetool.sh new file mode 100644 index 000000000000000..9743195de4c844e --- /dev/null +++ b/packages/languagetool-libs/languagetool.sh @@ -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" "$@" diff --git a/packages/languagetool-libs/languagetool.subpackage.sh b/packages/languagetool-libs/languagetool.subpackage.sh new file mode 100644 index 000000000000000..94910296520003f --- /dev/null +++ b/packages/languagetool-libs/languagetool.subpackage.sh @@ -0,0 +1,3 @@ +TERMUX_SUBPKG_INCLUDE="bin/languagetool share/java/languagetool/languagetool-commandline.jar" +TERMUX_SUBPKGS_DEPENDS="openjdk-17" +TERMUX_SUBPKG_DESCRIPTION="Style and Grammar Checker for 25+ Languages" diff --git a/x11-packages/languagetool-gui/build.sh b/x11-packages/languagetool-gui/build.sh new file mode 100644 index 000000000000000..9833c727fbd4d23 --- /dev/null +++ b/x11-packages/languagetool-gui/build.sh @@ -0,0 +1,25 @@ +TERMUX_PKG_HOMEPAGE=https://languagetool.org +TERMUX_PKG_DESCRIPTION="GUI version of languagetool" +TERMUX_PKG_LICENSE="LGPL-2.1" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="$( + source "${TERMUX_SCRIPTDIR}/packages/languagetool-libs/build.sh" + echo "${TERMUX_PKG_VERSION}" +)" +TERMUX_PKG_SRCURL="$( + source "${TERMUX_SCRIPTDIR}/packages/languagetool-libs/build.sh" + echo "${TERMUX_PKG_SRCURL}" +)" +TERMUX_PKG_SHA256="$( + source "${TERMUX_SCRIPTDIR}/packages/languagetool-libs/build.sh" + echo "${TERMUX_PKG_SHA256}" +)" +TERMUX_PKG_DEPENDS="openjdk-17, openjdk-17-x, languagetool-libs" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_PLATFORM_INDEPENDENT=true + +termux_step_make_install() { + mv ./languagetool.jar "${TERMUX_PREFIX}/share/java/languagetool" + sed "s|@MAIN@|org.languagetool.gui.Main|g" "${TERMUX_SCRIPTDIR}/packages/languagetool-libs/languagetool.sh" > "${TERMUX_PREFIX}/bin/languagetool-gui" + chmod 700 "${TERMUX_PREFIX}/bin/languagetool-gui" +}