lol

crow-translate: 3.1.0 -> 4.0.2

Co-authored-by: Nikolay Korotkiy <sikmir@disroot.org>
Co-authored-by: Fedi Jamoussi <Fedi.Jamoussi@protonmail.ch>

+30 -26
+30 -26
pkgs/by-name/cr/crow-translate/package.nix
··· 5 5 cmake, 6 6 extra-cmake-modules, 7 7 leptonica, 8 - libsForQt5, 9 - qt5, 10 - tesseract4, 11 - gst_all_1, 8 + qt6, 9 + tesseract, 12 10 testers, 11 + kdePackages, 12 + onnxruntime, 13 + withPiper ? true, 13 14 }: 14 15 15 16 stdenv.mkDerivation (finalAttrs: { 16 17 pname = "crow-translate"; 17 - version = "3.1.0"; 18 + version = "4.0.2"; 18 19 19 20 src = fetchFromGitLab { 20 21 domain = "invent.kde.org"; 21 22 owner = "office"; 22 23 repo = "crow-translate"; 23 - rev = "v${finalAttrs.version}"; 24 - hash = "sha256-zL+Ucw6rzIoEaBHi/uqKQB0cnR6aAcF8MPOG3hwK3iA="; 24 + tag = "v${finalAttrs.version}"; 25 + hash = "sha256-hrxYC6zdh4aG9AkHZcnOE5jihJSo3xrq0hzBRE8NtRw="; 25 26 fetchSubmodules = true; 26 27 }; 27 28 28 29 postPatch = '' 29 30 substituteInPlace data/org.kde.CrowTranslate.desktop.in \ 30 - --subst-var-by QT_BIN_DIR ${lib.getBin qt5.qttools}/bin 31 + --subst-var-by QT_BIN_DIR ${lib.getBin qt6.qttools}/bin 31 32 ''; 32 33 33 34 nativeBuildInputs = [ 34 35 cmake 35 36 extra-cmake-modules 36 - qt5.qttools 37 - qt5.wrapQtAppsHook 37 + qt6.qttools 38 + qt6.wrapQtAppsHook 38 39 ]; 39 40 40 41 buildInputs = [ 41 - libsForQt5.kwayland 42 + kdePackages.kwayland 42 43 leptonica 43 - tesseract4 44 - qt5.qtmultimedia 45 - qt5.qtx11extras 44 + tesseract 45 + qt6.qtbase 46 + qt6.qtmultimedia 47 + qt6.qtscxml 48 + qt6.qtspeech 46 49 ] 47 - ++ (with gst_all_1; [ 48 - gstreamer 49 - gst-plugins-base 50 - gst-plugins-good 51 - gst-plugins-bad 52 - ]); 53 - 54 - preFixup = '' 55 - qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") 50 + ++ lib.optionals withPiper [ 51 + onnxruntime 52 + ]; 53 + cmakeFlags = [ 54 + (lib.cmakeBool "ONNXRuntime_USE_STATIC" false) 55 + (lib.cmakeBool "WITH_PIPER_TTS" withPiper) 56 + ]; 57 + # Necessary for KWin D-BUS authorization for taking screenshots, without 58 + # which the app falls back to interactive capture, which has some limitations. 59 + postInstall = '' 60 + substituteInPlace $out/share/applications/org.kde.CrowTranslate.desktop \ 61 + --replace-fail 'Exec=crow' "Exec=$out/bin/crow" 56 62 ''; 57 63 58 - passthru.tests.version = testers.testVersion { 59 - package = finalAttrs.finalPackage; 60 - }; 64 + passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; }; 61 65 62 66 meta = { 63 67 description = "Simple and lightweight translator that allows to translate and speak text using Google, Yandex and Bing";