Subject: [PATCH] gnu: Add goldendict.

From: Sergey Trofimov <[email-masked]>
Date: Mon, 7 Jun 2021 22:05:32 +0200

---
 gnu/packages/dictionaries.scm | 63 +++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 2b1f7f0ad1..74e15b884b 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -52,6 +52,12 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages xml))

@@ -398,6 +404,63 @@ intelligible and easily correctable.")
     (license (list license:gpl2 ; main license
                    license:expat)))) ; utf8/*
 
+(define-public goldendict
+  (package
+    (name "goldendict")
+    (version "2020-12-09")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/goldendict/goldendict.git")
+             (commit "261e45a5d79f9df2fbc050292410bed0f4ef3132")))
+
+       (sha256
+        (base32 "01pny06d4cmwf998hpqd7xx7mccbbasb8js1bv3rkdi1ljg01f7n"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (invoke "qmake" "goldendict.pro"
+                     "CONFIG+=no_epwing_support"
+                     (string-append "QMAKE_LRELEASE="
+                                    (assoc-ref inputs "qttools")
+                                    "/bin/lrelease")
+                     (string-append "PREFIX="
+                                    (assoc-ref outputs "out"))))))))
+
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libvorbis" ,libvorbis)
+       ("zlib" ,zlib)
+       ("hunspell" ,hunspell)
+       ("x11proto-record-x11" ,xproto)
+       ("libtiff" ,libtiff)
+       ("qtbase" ,qtbase)
+       ("qtmultimedia" ,qtmultimedia)
+       ("qtsvg" ,qtsvg)
+       ("qttools" ,qttools)
+       ("qtwebkit" ,qtwebkit)
+       ("qtwebview" ,qtwebview)
+       ("qtx11extras" ,qtx11extras)
+       ("libxtst" ,libxtst)
+       ("lzo" ,lzo)
+       ("bzip2" ,bzip2)
+       ("ao" ,ao)
+       ("ffmpeg" ,ffmpeg)))
+    (synopsis "A feature-rich dictionary lookup program")
+    (description
+     "GoldenDict is a feature-rich dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo, Dictd, AARD,
+MDict, SDict) and online dictionaries, featuring perfect article rendering with
+the complete markup, illustrations and other content retained, and allowing you
+to type in words without any accents or correct case.")
+    (home-page "http://goldendict.org/")
+    (license license:gpl3+)))
+
 (define-public sdcv
   (package
     (name "sdcv")
-- 
2.31.1