diff mbox series

[bug#57172] gnu: Add crow-translate.

Message ID tencent_76187516A70650354F0F6942A68C06F14108@qq.com
State New
Headers show
Series [bug#57172] gnu: Add crow-translate. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

tiantian Aug. 13, 2022, 12:18 p.m. UTC
From: tiantian <typ22@foxmail.com>

* gnu/packages/dictionaries.scm (crow-translate): New variable.
---
 gnu/packages/dictionaries.scm | 49 +++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)


base-commit: bf35cded1837a97be93524046e4c9cc63f3b85f5
diff mbox series

Patch

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index f9d6e57877..d2f422dbc8 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -27,6 +27,7 @@ 
 (define-module (gnu packages dictionaries)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
@@ -38,16 +39,21 @@  (define-module (gnu packages dictionaries)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages ocr)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages compression)
@@ -431,3 +437,46 @@  (define-public sdcv
     (description "sdcv is simple text-based utility for work with dictionaries
 in StarDict's format.")
     (license license:gpl2+)))
+
+(define-public crow-translate
+  (package
+    (name "crow-translate")
+    (version "2.9.12")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/crow-translate/crow-translate")
+                    (commit version)
+                    (recursive? #t)))
+              (sha256
+               (base32
+                "0xvw81wlgymj2cvjia1xfhgdl5x9fjxzy698fc15jpk6ilfk6s9l"))
+              (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:tests? #f
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'patch-dot-desktop-files)
+                        (add-after 'unpack 'patch-desktop-file
+                          (lambda _
+                            (let ((file
+                                   "data/io.crow_translate.CrowTranslate.desktop")
+                                  (exec-program #$(file-append qttools-5
+                                                               "/bin/qdbus")))
+                              (substitute* file
+                                (("Exec=qdbus")
+                                 (string-append "Exec=" exec-program)))))))))
+    (inputs (list kwayland
+                  leptonica
+                  qtbase-5
+                  qttools-5
+                  qtx11extras
+                  qtmultimedia-5
+                  tesseract-ocr))
+    (native-inputs (list doxygen extra-cmake-modules pkg-config))
+    (synopsis "Simple and lightweight translator")
+    (description "@code{Crow Translate} is a simple and lightweight translator
+written in C++/Qt that allows you to translate and speak text using Google,
+Yandex Bing, LibreTranslate and Lingva.")
+    (home-page "https://crow-translate.github.io/")
+    (license license:gpl3)))