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
|
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-08-21 13:32:41 +00:00
|
|
|
version = "2.9.12";
|
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-08-21 13:32:41 +00:00
|
|
|
hash = "sha256-JkAykc5j5HMkK48qAm876A2zBD095CG/yR4TyXAdevM=";
|
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-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
|
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace $out/share/applications/io.crow_translate.CrowTranslate.desktop \
|
|
|
|
--replace "Exec=qdbus" "Exec=${lib.getBin qttools}/bin/qdbus"
|
|
|
|
'';
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|