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.

79 lines
1.6 KiB
Nix
Raw Normal View History

2021-01-15 05:42:41 +00:00
{ lib
2022-05-10 23:10:13 +00:00
, stdenv
2022-05-19 13:33:25 +00:00
, fetchzip
2020-11-29 22:17:24 +00:00
, substituteAll
, cmake
, extra-cmake-modules
, qttools
2022-05-19 13:33:25 +00:00
, kwayland
2020-11-29 22:17:24 +00:00
, leptonica
, tesseract4
, qtmultimedia
, qtx11extras
, qttranslations
2022-05-10 23:10:13 +00:00
, wrapQtAppsHook
2022-09-05 17:29:13 +00:00
, gst_all_1
, testers
, crow-translate
2020-11-29 22:17:24 +00:00
}:
2022-05-10 23:10:13 +00:00
stdenv.mkDerivation rec {
2020-11-29 22:17:24 +00:00
pname = "crow-translate";
2023-05-22 06:16:14 +00:00
version = "2.10.5";
2020-11-29 22:17:24 +00:00
2022-05-19 13:33:25 +00:00
src = fetchzip {
url = "https://github.com/${pname}/${pname}/releases/download/${version}/${pname}-${version}-source.tar.gz";
2023-05-22 06:16:14 +00:00
hash = "sha256-sAjgG2f0rAWakPd2cZNGXkooIxQQM5OPHm11ahyY1WU=";
2020-11-29 22:17:24 +00:00
};
patches = [
(substituteAll {
# See https://github.com/NixOS/nixpkgs/issues/86054
src = ./fix-qttranslations-path.patch;
inherit qttranslations;
})
];
2022-09-05 17:29:13 +00:00
postPatch = ''
substituteInPlace data/io.crow_translate.CrowTranslate.desktop \
--replace "Exec=qdbus" "Exec=${lib.getBin qttools}/bin/qdbus"
'';
2022-05-19 13:33:25 +00:00
nativeBuildInputs = [
cmake
extra-cmake-modules
qttools
wrapQtAppsHook
];
2020-11-29 22:17:24 +00:00
2022-05-19 13:33:25 +00:00
buildInputs = [
kwayland
leptonica
tesseract4
qtmultimedia
qtx11extras
2022-09-05 17:29:13 +00:00
] ++ (with gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
]);
2020-11-29 22:17:24 +00:00
2022-09-05 17:29:13 +00:00
preFixup = ''
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
2021-02-04 23:02:12 +00:00
'';
2022-09-05 17:29:13 +00:00
passthru.tests.version = testers.testVersion {
package = crow-translate;
};
2021-01-15 05:42:41 +00:00
meta = with lib; {
2020-11-29 22:17:24 +00: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;
2022-09-05 17:29:13 +00:00
mainProgram = "crow";
2020-11-29 22:17:24 +00:00
};
}