all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 70884@debbugs.gnu.org
Subject: [bug#70884] [PATCH 1/2] gnu: Add hunspell-bdic-en*.
Date: Sat, 11 May 2024 21:57:52 +0200	[thread overview]
Message-ID: <15b7554f7b3f45c2b184778faf1891d93e038426.1715456480.git.herman@rimm.ee> (raw)
In-Reply-To: <cover.1715456480.git.herman@rimm.ee>

* gnu/packages/aspell.scm (aspell-compiled-word-list): New procedure.
(define-compiled-word-list-dictionary): New macro.
(hunspell-bdic-en, hunspell-bdic-en-au, hunspell-bdic-en-ca,
hunspell-bdic-en-gb, hunspell-bdic-en-gb-ize, hunspell-bdic-en-us): New
variables.

Change-Id: I4f02295add9803aefe7687b11d2bcbcb21cdd6b1
---
 gnu/packages/hunspell.scm | 82 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/hunspell.scm b/gnu/packages/hunspell.scm
index 7163358260..782292c79f 100644
--- a/gnu/packages/hunspell.scm
+++ b/gnu/packages/hunspell.scm
@@ -32,6 +32,7 @@ (define-module (gnu packages hunspell)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages textutils))
 
 (define-public hunspell
@@ -445,3 +446,84 @@ (define-word-list-dictionary hunspell-dict-en-us
   "en_US"
   (synopsis "Hunspell dictionary for United States English"))
 
+(define* (aspell-compiled-word-list
+           language
+           synopsis
+           #:optional
+           (nick (string-map (lambda (chr)
+                               (if (char=? #\_ chr)
+                                   #\-
+                                   chr))
+                             (string-downcase language))))
+  (package
+    (inherit (aspell-word-list language synopsis nick))
+    (name (string-append "hunspell-bdic-" nick))
+    (version "2018.04.16")
+    (native-inputs
+     (list (aspell-word-list language synopsis nick) qtwebengine))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let ((dictionary
+                (string-append
+                  (assoc-ref %build-inputs
+                             (string-append "hunspell-dict-" ,nick))
+                  "/share/hunspell/" ,language ".dic"))
+               (convert-dict
+                (string-append
+                  (assoc-ref %build-inputs "qtwebengine")
+                  "/lib/qt6/libexec/qwebengine_convert_dict"))
+               (qtwebengine-dictionaries
+                 (string-append %output
+                                "/share/qtwebengine_dictionaries"))
+               (bdic (string-append (string-map (lambda (chr)
+                                                  (if (char=? #\_ chr)
+                                                      #\-
+                                                      chr))
+                                                ,language)
+                                    ".bdic")))
+           (invoke convert-dict dictionary bdic)
+           (install-file bdic qtwebengine-dictionaries)
+           #t))))
+    (description
+     "This package provides a compiled dictionary for the Hunspell
+spell-checking library.")))
+
+(define-syntax define-compiled-word-list-dictionary
+  (syntax-rules (synopsis)
+    ((_ name language (synopsis text))
+     (define-public name
+       (aspell-compiled-word-list language text)))
+    ((_ name language nick (synopsis text))
+     (define-public name
+       (aspell-compiled-word-list language text nick)))))
+
+(define-compiled-word-list-dictionary hunspell-bdic-en
+  "en"
+  (synopsis "Compiled Hunspell dictionary for English"))
+
+(define-compiled-word-list-dictionary hunspell-bdic-en-au
+  "en_AU"
+  (synopsis "Compiled Hunspell dictionary for Australian English"))
+
+(define-compiled-word-list-dictionary hunspell-bdic-en-ca
+  "en_CA"
+  (synopsis "Compiled Hunspell dictionary for Canadian English"))
+
+(define-compiled-word-list-dictionary hunspell-bdic-en-gb
+  "en_GB-ise" "en-gb"
+  (synopsis
+    "Compiled Hunspell dictionary for British English, with -ise endings"))
+
+(define-compiled-word-list-dictionary hunspell-bdic-en-gb-ize
+  "en_GB-ize"
+  (synopsis
+    "Compiled Hunspell dictionary for British English, with -ize endings"))
+
+(define-compiled-word-list-dictionary hunspell-bdic-en-us
+  "en_US"
+  (synopsis "Compiled Hunspell dictionary for United States English"))
+
-- 
2.41.0





  reply	other threads:[~2024-05-11 19:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 19:51 [bug#70884] [PATCH 0/2] Package qutebrowser spellcheck files Herman Rimm via Guix-patches via
2024-05-11 19:57 ` Herman Rimm via Guix-patches via [this message]
2024-05-11 19:57 ` [bug#70884] [PATCH 2/2] gnu: qutebrowser: Warn about missing .bdic files and ignore version Herman Rimm via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15b7554f7b3f45c2b184778faf1891d93e038426.1715456480.git.herman@rimm.ee \
    --to=guix-patches@gnu.org \
    --cc=70884@debbugs.gnu.org \
    --cc=herman@rimm.ee \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.