2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
2022-05-18 14:49:53 +00:00
|
|
|
, stdenv
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchzip
|
2021-01-15 22:18:51 +00:00
|
|
|
, substituteAll
|
|
|
|
, cmake
|
|
|
|
, extra-cmake-modules
|
|
|
|
, qttools
|
2022-06-16 17:23:12 +00:00
|
|
|
, kwayland
|
2021-01-15 22:18:51 +00:00
|
|
|
, leptonica
|
|
|
|
, tesseract4
|
|
|
|
, qtmultimedia
|
|
|
|
, qtx11extras
|
|
|
|
, qttranslations
|
2022-05-18 14:49:53 +00:00
|
|
|
, wrapQtAppsHook
|
2022-09-30 11:47:45 +00:00
|
|
|
, gst_all_1
|
|
|
|
, testers
|
|
|
|
, crow-translate
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-01-15 22:18:51 +00:00
|
|
|
pname = "crow-translate";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "2.10.1";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/${pname}/${pname}/releases/download/${version}/${pname}-${version}-source.tar.gz";
|
2022-10-30 15:09:59 +00:00
|
|
|
hash = "sha256-xRXNT/IybcynS5S71XFFsx3PoLXDBcKuz81ybxoVtV4=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/86054
|
|
|
|
src = ./fix-qttranslations-path.patch;
|
|
|
|
inherit qttranslations;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace data/io.crow_translate.CrowTranslate.desktop \
|
|
|
|
--replace "Exec=qdbus" "Exec=${lib.getBin qttools}/bin/qdbus"
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
extra-cmake-modules
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildInputs = [
|
|
|
|
kwayland
|
|
|
|
leptonica
|
|
|
|
tesseract4
|
|
|
|
qtmultimedia
|
|
|
|
qtx11extras
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ (with gst_all_1; [
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-bad
|
|
|
|
]);
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
preFixup = ''
|
|
|
|
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
|
2021-02-17 17:02:09 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = crow-translate;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
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/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
platforms = platforms.linux;
|
2022-09-30 11:47:45 +00:00
|
|
|
mainProgram = "crow";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
}
|