Merge pull request #113302 from sikmir/crow-translate
crow-translate: 2.6.2 → 2.7.1
This commit is contained in:
commit
42a33fa59f
@ -1,6 +1,6 @@
|
||||
{ lib
|
||||
|
||||
, mkDerivation
|
||||
, nix-update-script
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
, cmake
|
||||
@ -37,22 +37,28 @@ let
|
||||
rev = "1.4.1";
|
||||
sha256 = "1c6a8mdxms5vh8l7shi2kqdhafbzm50pbz6g1hhgg6qslla0vfn0";
|
||||
};
|
||||
circleflags = fetchFromGitHub {
|
||||
owner = "HatScripts";
|
||||
repo = "circle-flags";
|
||||
rev = "v2.0.0";
|
||||
sha256 = "1xz5b6nhcxxzalcgwnw36npap71i70s50g6b63avjgjkwz1ys5j4";
|
||||
};
|
||||
in
|
||||
mkDerivation rec {
|
||||
pname = "crow-translate";
|
||||
version = "2.6.2";
|
||||
version = "2.7.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "crow-translate";
|
||||
repo = "crow-translate";
|
||||
rev = version;
|
||||
sha256 = "1jgpqynmxmh6mrknpk5fh96lbdg799axp4cyn5rvalg3sdxajmqc";
|
||||
sha256 = "sha256-YOsp/noGsYthre18fMyBj9s+YFzdHJfIJzJSm43wiZ0=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./dont-fetch-external-libs.patch;
|
||||
inherit singleapplication qtaskbarcontrol qhotkey qonlinetranslator;
|
||||
inherit singleapplication qtaskbarcontrol qhotkey qonlinetranslator circleflags;
|
||||
})
|
||||
(substituteAll {
|
||||
# See https://github.com/NixOS/nixpkgs/issues/86054
|
||||
@ -61,10 +67,23 @@ mkDerivation rec {
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = "cp -r ${circleflags}/flags/* data/icons";
|
||||
|
||||
nativeBuildInputs = [ cmake extra-cmake-modules qttools ];
|
||||
|
||||
buildInputs = [ leptonica tesseract4 qtmultimedia qtx11extras ];
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace $out/share/applications/io.crow_translate.CrowTranslate.desktop \
|
||||
--replace "Exec=qdbus" "Exec=${lib.getBin qttools}/bin/qdbus"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script {
|
||||
attrPath = pname;
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple and lightweight translator that allows to translate and speak text using Google, Yandex and Bing";
|
||||
homepage = "https://crow-translate.github.io/";
|
||||
|
@ -1,8 +1,26 @@
|
||||
diff --git i/CMakeLists.txt w/CMakeLists.txt
|
||||
index 2576203..26162a0 100644
|
||||
--- i/CMakeLists.txt
|
||||
+++ w/CMakeLists.txt
|
||||
@@ -91,12 +91,11 @@ qt5_add_translation(QM_FILES
|
||||
)
|
||||
|
||||
configure_file(src/cmake.h.in cmake.h)
|
||||
-configure_file(data/icons/flags.qrc ${CircleFlags_SOURCE_DIR}/flags/flags.qrc COPYONLY)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
${QM_FILES}
|
||||
data/icons/engines/engines.qrc
|
||||
- ${CircleFlags_SOURCE_DIR}/flags/flags.qrc
|
||||
+ data/icons/flags.qrc
|
||||
src/addlanguagedialog.cpp
|
||||
src/addlanguagedialog.ui
|
||||
src/cli.cpp
|
||||
diff --git i/cmake/ExternalLibraries.cmake w/cmake/ExternalLibraries.cmake
|
||||
index d8c88ae..47a12c0 100644
|
||||
index 21eba0a..b613d3e 100644
|
||||
--- i/cmake/ExternalLibraries.cmake
|
||||
+++ w/cmake/ExternalLibraries.cmake
|
||||
@@ -2,24 +2,20 @@ include(FetchContent)
|
||||
@@ -2,29 +2,24 @@ include(FetchContent)
|
||||
|
||||
set(QAPPLICATION_CLASS QApplication)
|
||||
FetchContent_Declare(SingleApplication
|
||||
@ -30,4 +48,10 @@ index d8c88ae..47a12c0 100644
|
||||
+ SOURCE_DIR @qonlinetranslator@
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(SingleApplication QTaskbarControl QHotkey QOnlineTranslator)
|
||||
FetchContent_Declare(CircleFlags
|
||||
- GIT_REPOSITORY https://github.com/HatScripts/circle-flags
|
||||
- GIT_TAG v2.0.0
|
||||
+ SOURCE_DIR @circleflags@
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(SingleApplication QTaskbarControl QHotkey QOnlineTranslator CircleFlags)
|
||||
|
@ -1,13 +1,13 @@
|
||||
diff --git i/src/settings/appsettings.cpp w/src/settings/appsettings.cpp
|
||||
index 7be4573..e65994e 100644
|
||||
--- i/src/settings/appsettings.cpp
|
||||
+++ w/src/settings/appsettings.cpp
|
||||
@@ -82,7 +82,7 @@ void AppSettings::applyLanguage(QLocale::Language lang)
|
||||
QLocale::setDefault(QLocale(lang));
|
||||
diff --git c/src/settings/appsettings.cpp i/src/settings/appsettings.cpp
|
||||
index ff99f64..fa929ae 100644
|
||||
--- c/src/settings/appsettings.cpp
|
||||
+++ i/src/settings/appsettings.cpp
|
||||
@@ -80,7 +80,7 @@ void AppSettings::applyLanguage(QLocale::Language lang)
|
||||
QLocale::setDefault(locale);
|
||||
|
||||
s_appTranslator.load(QLocale(), QStringLiteral(PROJECT_NAME), QStringLiteral("_"), QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("translations"), QStandardPaths::LocateDirectory));
|
||||
- s_qtTranslator.load(QLocale(), QStringLiteral("qt"), QStringLiteral("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
+ s_qtTranslator.load(QLocale(), QStringLiteral("qt"), QStringLiteral("_"), QLatin1String("@qttranslations@/translations"));
|
||||
s_appTranslator.load(locale, QStringLiteral(PROJECT_NAME), QStringLiteral("_"), QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("translations"), QStandardPaths::LocateDirectory));
|
||||
- s_qtTranslator.load(locale, QStringLiteral("qtbase"), QStringLiteral("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
+ s_qtTranslator.load(locale, QStringLiteral("qtbase"), QStringLiteral("_"), QLatin1String("@qttranslations@/translations"));
|
||||
}
|
||||
|
||||
QLocale::Language AppSettings::defaultLanguage()
|
||||
|
Loading…
Reference in New Issue
Block a user