addpkg(x11/crow-translate): 4.0.2

This commit is contained in:
termux-pacman-bot
2026-02-03 11:47:34 +00:00
parent 998219b45e
commit 749efcfa4c
3 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
TERMUX_PKG_HOMEPAGE=https://apps.kde.org/crowtranslate/
TERMUX_PKG_DESCRIPTION="Application that allows you to translate and speak text"
TERMUX_PKG_LICENSE="CC0-1.0, GPL-3.0-or-later, custom"
TERMUX_PKG_LICENSE_FILE="
LICENSES/CC0-1.0.txt
LICENSES/GPL-3.0-or-later.txt
LICENSES/CC-BY-SA-4.0.txt
"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="4.0.2"
TERMUX_PKG_SRCURL="https://download.kde.org/stable/crow-translate/$TERMUX_PKG_VERSION/crow-translate-$TERMUX_PKG_VERSION.tar.gz"
TERMUX_PKG_SHA256=e24b8e78b0bffa5dd02875e25126c371967f53729102c784e4e02d165feb3753
TERMUX_PKG_DEPENDS="libc++, hicolor-icon-theme, kwayland, libx11, libxcb, onnxruntime, qt6-qtbase, qt6-qtmultimedia, qt6-qtscxml, qt6-qtspeech, tesseract"
TERMUX_PKG_BUILD_DEPENDS="extra-cmake-modules, protobuf, qt6-qttools, qt6-qttools-cross-tools"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DCMAKE_SYSTEM_NAME=Linux
-DKDE_INSTALL_QMLDIR=lib/qt6/qml
-DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins
"
termux_step_post_get_source() {
# convert CRLF to LF like in libpluto package
if [[ "$TERMUX_ON_DEVICE_BUILD" == "false" ]]; then
DOS2UNIX="$TERMUX_PKG_TMPDIR/dos2unix"
(. "$TERMUX_SCRIPTDIR/packages/dos2unix/build.sh"; TERMUX_PKG_SRCDIR="$DOS2UNIX" termux_step_get_source)
pushd "$DOS2UNIX"
make dos2unix
popd # DOS2UNIX
export PATH="$DOS2UNIX:$PATH"
fi
find "$TERMUX_PKG_SRCDIR" -type f -print0 | xargs -0 dos2unix
}
termux_step_host_build() {
if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
return
fi
termux_setup_cmake
termux_setup_ninja
cmake -G Ninja \
"$TERMUX_PKG_SRCDIR/src/3rdparty/espeak-ng" \
-DCMAKE_INSTALL_PREFIX="$TERMUX_PKG_HOSTBUILD_DIR/espeak-ng_installation"
ninja
ninja install
}
termux_step_pre_configure() {
if [[ "$TERMUX_ON_DEVICE_BUILD" == "false" ]]; then
local patch="$TERMUX_PKG_BUILDER_DIR/espeakng-hostbuild.diff"
echo "Applying patch: $patch"
sed -e "s%\@ESPEAKNG_DIR\@%${TERMUX_PKG_HOSTBUILD_DIR}/espeak-ng_installation/bin%g" \
"$patch" | patch --silent -p1
fi
}

View File

@@ -0,0 +1,20 @@
From ed07479782f8ae9ea7e97b0c0945efb8b6686b34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
Date: Thu, 22 Jan 2026 23:04:48 +0100
Subject: [PATCH] Set window icon
This is commonly used by desktop environments on Xorg.
---
src/main.cpp | 1 +
1 file changed, 1 insertion(+)
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -41,6 +41,7 @@ int main(int argc, char *argv[])
int launchGui(int argc, char *argv[])
{
+ QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral(APPLICATION_ID)));
#if defined(Q_OS_WIN)
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif

View File

@@ -0,0 +1,12 @@
--- a/src/3rdparty/espeak-ng/CMakeLists.txt
+++ b/src/3rdparty/espeak-ng/CMakeLists.txt
@@ -18,7 +18,7 @@ add_subdirectory(src)
if (COMPILE_INTONATIONS)
- if (CMAKE_CROSSCOMPILING)
- find_program(NATIVEBUILD NAMES espeak-ng PATHS ${NativeBuild_DIR} NO_DEFAULT_PATH)
+ if (TRUE)
+ find_program(NATIVEBUILD NAMES espeak-ng PATHS @ESPEAKNG_DIR@ NO_DEFAULT_PATH)
if(NATIVEBUILD)
message(STATUS "Native build of espeak-ng is located at: ${NATIVEBUILD}")
include(cmake/data.cmake)