[bug#74411,v3,4/5] gnu: Add freedict-dictionaries.

Message ID ffe546d4c8d7c98e1b8b8791aa182e50647de856.1733086737.git.runciter@whispers-vpn.org
State New
Headers
Series [bug#74411,v3,1/5] gnu: Add (gnu packages dictd). |

Commit Message

Runciter Dec. 1, 2024, 9 p.m. UTC
  * gnu/packages/dictionaries (freedict-dictionaries): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictionaries.scm | 42 +++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
  

Patch

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 3141d6d46d..e6f9f7f5a8 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -9,6 +9,7 @@ 
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2020 Lu hux <luhux@outlook.com>
 ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com>
+;;; Copyright © 2022 Runciter <runciter@whispers-vpn.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -518,3 +519,44 @@  (define-public freedict-tools
 Guix package is installed.")
     (home-page "https://freedict.org")
     (license license:gpl2+)))
+
+(define-public freedict-dictionaries
+  (package
+    (name "freedict-dictionaries")
+    (version "914b5f7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/freedict/fd-dictionaries")
+             (commit "914b5f754b695e9422bf951837b0682a077e244e")))
+       (sha256
+        (base32 "0a8k5rq94rl1nmz0354sx2gmyqica0yjavirh5v5wdybkfq8nv83"))))
+    (inputs (list espeak-ng libxslt dictd perl-libxml freedict-tools))
+    (native-inputs (list python perl))
+    (arguments
+     (list
+      ;; "validation" target fails because of hardcoded
+      ;; path /usr/bin/xmllint in freedict-tools
+      #:tests? #f
+      #:make-flags #~(list (string-append "PREFIX="
+                                          #$output))
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (add-before 'build 'set-tools-prefix-in-makefile
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "Makefile"
+                         (("FREEDICT_TOOLS \\?= ../tools")
+                          (string-append "export FREEDICT_TOOLS = "
+                                         #$(file-append
+                                            freedict-tools
+                                            "/share/freedict")))))))))
+    (build-system gnu-build-system)
+    (synopsis "Multilingual dictionaries compiled to the DICT format")
+    (description
+     "FreeDict is a project that offers over 140 free
+ dictionaries in about 45 languages, with the right to study, change and
+ modify them.  You can use them offline on your computer or mobile phone
+ and export them to any format and application.")
+    (home-page "https://freedict.org")
+    (license license:gpl2+)))