nixpkgs/pkgs/applications/misc/crow-translate/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.3 KiB
Nix
Raw Normal View History

2021-01-15 06:42:41 +01:00
{ lib
2022-05-11 01:10:13 +02:00
, stdenv
2022-05-19 15:33:25 +02:00
, fetchzip
2020-11-29 23:17:24 +01:00
, substituteAll
, cmake
, extra-cmake-modules
, qttools
2022-05-19 15:33:25 +02:00
, kwayland
2020-11-29 23:17:24 +01:00
, leptonica
, tesseract4
, qtmultimedia
, qtx11extras
, qttranslations
2022-05-11 01:10:13 +02:00
, wrapQtAppsHook
2020-11-29 23:17:24 +01:00
}:
2022-05-11 01:10:13 +02:00
stdenv.mkDerivation rec {
2020-11-29 23:17:24 +01:00
pname = "crow-translate";
2022-08-13 07:32:02 +02:00
version = "2.9.12";
2020-11-29 23:17:24 +01:00
2022-05-19 15:33:25 +02:00
src = fetchzip {
url = "https://github.com/${pname}/${pname}/releases/download/${version}/${pname}-${version}-source.tar.gz";
2022-08-13 07:32:02 +02:00
hash = "sha256-JkAykc5j5HMkK48qAm876A2zBD095CG/yR4TyXAdevM=";
2020-11-29 23:17:24 +01:00
};
patches = [
(substituteAll {
# See https://github.com/NixOS/nixpkgs/issues/86054
src = ./fix-qttranslations-path.patch;
inherit qttranslations;
})
];
2022-05-19 15:33:25 +02:00
nativeBuildInputs = [
cmake
extra-cmake-modules
qttools
wrapQtAppsHook
];
2020-11-29 23:17:24 +01:00
2022-05-19 15:33:25 +02:00
buildInputs = [
kwayland
leptonica
tesseract4
qtmultimedia
qtx11extras
];
2020-11-29 23:17:24 +01:00
2021-02-05 00:02:12 +01:00
postInstall = ''
substituteInPlace $out/share/applications/io.crow_translate.CrowTranslate.desktop \
--replace "Exec=qdbus" "Exec=${lib.getBin qttools}/bin/qdbus"
'';
2021-01-15 06:42:41 +01:00
meta = with lib; {
2020-11-29 23:17:24 +01:00
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;
};
}