2021-01-15 06:42:41 +01:00
|
|
|
{ lib
|
2020-11-29 23:17:24 +01:00
|
|
|
, mkDerivation
|
2021-02-05 00:02:12 +01:00
|
|
|
, nix-update-script
|
2020-11-29 23:17:24 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, substituteAll
|
|
|
|
, cmake
|
|
|
|
, extra-cmake-modules
|
|
|
|
, qttools
|
|
|
|
, leptonica
|
|
|
|
, tesseract4
|
|
|
|
, qtmultimedia
|
|
|
|
, qtx11extras
|
|
|
|
, qttranslations
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
singleapplication = fetchFromGitHub {
|
|
|
|
owner = "itay-grudev";
|
|
|
|
repo = "SingleApplication";
|
|
|
|
rev = "v3.2.0";
|
|
|
|
sha256 = "0w3z97dcqcz3bf7w6fja4smkafmx9kvhzb9px4k2nfmmyxh4yfma";
|
|
|
|
};
|
|
|
|
qtaskbarcontrol = fetchFromGitHub {
|
|
|
|
owner = "Skycoder42";
|
|
|
|
repo = "QTaskbarControl";
|
|
|
|
rev = "2.0.2";
|
|
|
|
sha256 = "0iymcvq3pv07fs9l4kh6hi1igqr7957iqndhsmg9fqkalf8nqyad";
|
|
|
|
};
|
|
|
|
qhotkey = fetchFromGitHub {
|
|
|
|
owner = "Skycoder42";
|
|
|
|
repo = "QHotkey";
|
|
|
|
rev = "1.4.2";
|
|
|
|
sha256 = "0391fkqrxqmzpvms4rk06aq05l308k6sadp6y3czq0gx2kng8mn9";
|
|
|
|
};
|
|
|
|
qonlinetranslator = fetchFromGitHub {
|
|
|
|
owner = "crow-translate";
|
|
|
|
repo = "QOnlineTranslator";
|
2022-03-12 10:08:21 +01:00
|
|
|
rev = "1.5.3";
|
|
|
|
sha256 = "sha256-L8y4vazbWD5SC7itxQOjEcX10w0laewxTOGz+Yd+kVM=";
|
2020-11-29 23:17:24 +01:00
|
|
|
};
|
2021-02-05 00:02:12 +01:00
|
|
|
circleflags = fetchFromGitHub {
|
|
|
|
owner = "HatScripts";
|
|
|
|
repo = "circle-flags";
|
2021-10-04 09:39:18 +02:00
|
|
|
rev = "v2.3.0";
|
|
|
|
sha256 = "sha256-KabmewF1Xf/1JQuzolrlRyLJR8O5j+/iT+29/QtOQVE=";
|
2021-06-01 01:20:13 +02:00
|
|
|
};
|
2021-10-04 09:39:18 +02:00
|
|
|
fluent = fetchFromGitHub {
|
|
|
|
owner = "vinceliuice";
|
|
|
|
repo = "Fluent-icon-theme";
|
|
|
|
rev = "2021-08-15";
|
|
|
|
sha256 = "sha256-uBu0vbKfhhnPKGwrnSBjPwS9ncH1iAlmeefAcpckOm4=";
|
2021-02-05 00:02:12 +01:00
|
|
|
};
|
2020-11-29 23:17:24 +01:00
|
|
|
in
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "crow-translate";
|
2022-03-12 10:08:21 +01:00
|
|
|
version = "2.9.2";
|
2020-11-29 23:17:24 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crow-translate";
|
2021-06-01 01:20:13 +02:00
|
|
|
repo = pname;
|
2020-11-29 23:17:24 +01:00
|
|
|
rev = version;
|
2022-03-12 10:08:21 +01:00
|
|
|
sha256 = "sha256-cxfBdoqGVmtCaXyw6QzXj2V44wKyVal/uqsddwIdvjw=";
|
2020-11-29 23:17:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./dont-fetch-external-libs.patch;
|
2021-10-04 09:39:18 +02:00
|
|
|
inherit singleapplication qtaskbarcontrol qhotkey qonlinetranslator circleflags fluent;
|
2020-11-29 23:17:24 +01:00
|
|
|
})
|
|
|
|
(substituteAll {
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/86054
|
|
|
|
src = ./fix-qttranslations-path.patch;
|
|
|
|
inherit qttranslations;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-06-01 01:20:13 +02:00
|
|
|
postPatch = ''
|
|
|
|
cp -r ${circleflags}/flags/* data/icons
|
2021-10-04 09:39:18 +02:00
|
|
|
cp -r ${fluent}/src/* data/icons
|
2021-06-01 01:20:13 +02:00
|
|
|
'';
|
2021-02-05 00:02:12 +01:00
|
|
|
|
2020-11-29 23:17:24 +01:00
|
|
|
nativeBuildInputs = [ cmake extra-cmake-modules qttools ];
|
|
|
|
|
|
|
|
buildInputs = [ leptonica tesseract4 qtmultimedia qtx11extras ];
|
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|