Subject: bug#41550: closed (Re: [bug#41550] [PATCH v4] gnu: Add Polish hunspell dictionary.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 03 Jun 2020 15:58:02 +0000

Your bug report

#41550: [PATCH] gnu: Add Polish hunspell dictionary.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
41550: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=41550
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#41550] [PATCH v4] gnu: Add Polish hunspell dictionary.
From: Ludovic Courtès <[email-masked]>
To: Marcin Karpezo <[email-masked]>
Cc: [email-masked]
Date: Wed, 03 Jun 2020 17:57:11 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Marcin Karpezo <[email-masked]> skribis:

> * gnu/packages/libreoffice.scm (hunspell-dict-pl): New variable.
> ---
> Based on Leo's suggestion I've changed source to last version mirrored
> by Arch Linux and version number accordingly.

Perfect.  Applied, thanks!

Ludo’.

Subject: [PATCH] gnu: Add Polish hunspell dictionary.
From: Marcin Karpezo <[email-masked]>
To: [email-masked]
Cc: Marcin Karpezo <[email-masked]>
Date: Wed, 27 May 2020 01:35:03 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/libreoffice.scm (hunspell-dict-pl): New variable.
---
 gnu/packages/libreoffice.scm | 47 ++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index a3a6ea5d1a..6c1ce2a0f9 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2018 Jonathan Brielmaier <[email-masked]>
 ;;; Copyright © 2019 Chris Marusich <[email-masked]>
+;;; Copyright © 2020 Marcin Karpezo <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -920,6 +921,52 @@ library.")
   "toutesvariantes"
   (synopsis "Hunspell dictionary for all variants of French"))
 
+(define-public hunspell-dict-pl
+  (package
+    (name "hunspell-dict-pl")
+    (version "20200526")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://sjp.pl/slownik/ort/sjp-myspell-pl-"
+                           version ".zip"))
+       (sha256 (base32
+                "1v8fc9ka18hs5vl7d515kgd0r4lcxl3pyk5075c5pg8ix9krzs4j"))))
+
+    (build-system trivial-build-system)
+    (native-inputs `(("unzip" ,unzip)))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder (begin
+                   (use-modules (guix build utils)
+                                (srfi srfi-26))
+
+                   (let* ((out      (assoc-ref %outputs "out"))
+                          (hunspell (string-append out "/share/hunspell"))
+                          (myspell  (string-append out "/share/myspell"))
+                          (doc      (string-append out "/share/doc/"
+                                                   ,name))
+                          (unzip (string-append (assoc-ref %build-inputs "unzip")
+                                                "/bin/unzip")))
+                     (invoke unzip "-j" "-o" (assoc-ref %build-inputs "source"))
+                     (invoke unzip "-j" "-o" "pl_PL.zip")
+                     (for-each (cut install-file <> hunspell)
+                               (find-files "."
+                                           ,(string-append "pl_PL"
+                                                           "\\.(dic|aff)$")))
+                     (mkdir-p myspell)
+                     (symlink hunspell (string-append myspell "/dicts"))
+                     (for-each (cut install-file <> doc)
+                               (find-files "." "\\.(txt|org|md)$"))
+                     #t))))
+    (synopsis "Hunspell dictionary for Polish")
+    (description
+     "This package provides a dictionary for the Hunspell spell-checking
+library.")
+    (home-page "https://qsjp.pl/slownik/ort/")
+    (license
+     (list license:gpl2 license:mpl1.1 license:cc-by4.0 license:lgpl2.1 license:asl2.0))))
+
 (define-public hyphen
   (package
     (name "hyphen")
-- 
2.26.2