1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages hunspell)
20 #:use-module (guix build-system trivial)
21 #:use-module (guix download)
22 #:use-module (guix git-download)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (ice-9 match)
26 #:use-module (gnu packages libreoffice))
28 (define* (hunspell-dictionary dict-name full-name #:key synopsis home-page license)
32 ;; Downcase and replace underscore in package names
33 ;; to follow Guix naming conventions.
34 (string-map (match-lambda
37 (string-downcase dict-name))))
38 (version (package-version libreoffice))
43 (url (string-append "https://anongit.freedesktop.org/git/"
44 "libreoffice/dictionaries.git/"))
46 (string-append "libreoffice-" version))))
47 (file-name (git-file-name "libreoffice-dictionaries" version))
49 (base32 "0vvxnjpm1322ahf9q8bqs1yhkn7krglw8c6yazcf7a3jljykd9k9"))))
50 (build-system trivial-build-system)
52 `(("source" ,source)))
54 `(#:modules ((guix build utils))
56 (use-modules (guix build utils))
58 (string-append (assoc-ref %build-inputs "source")
61 (hunspell (string-append %output "/share/hunspell/"))
62 (myspell (string-append %output "/share/myspell")))
65 (install-file (string-append dictionary ext)
68 (symlink hunspell myspell)
71 (description "This package provides a dictionary for the Hunspell
72 spell-checking library.")
74 (home-page home-page)))
76 (define-public hunspell-dict-it-it
77 (let ((synopsis identity))
78 (hunspell-dictionary "it_IT" "Italian"
79 #:synopsis (synopsis "Hunspell dictionary for Italian")
80 #:home-page "https://www.libreitalia.org/"
81 #:license license:gpl3)))