[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hunspell dictionaries

From: paul
Subject: Hunspell dictionaries
Date: Sat, 31 Oct 2020 21:03:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Icedove/78.3.3

Dear Guixers,

I was packaging an Italian dictionary for Hunspell, when I found this link listing all the Hunspell dictionaries supported by Libreoffice [0].

This lead me to think about a function for defining dictionary packages (very much based on aspell-dictionary from (gnu packages aspell)).

(define* (hunspell-dictionary dict-name full-name #:key home-page license)
    (name (string-append
           ;; Downcase and replace underscore in package names
           ;; to follow Guix naming conventions.
           (string-map (match-lambda
                         (#\_ #\-)
                         (chr chr))
                       (string-downcase dict-name))))
    (version (package-version libreoffice))
       (method git-fetch)
       (uri (git-reference
             (url (string-append ""
              (string-append "libreoffice-" version))))
       (file-name (git-file-name "libreoffice-dictionaries" version))
        (base32 "0vvxnjpm1322ahf9q8bqs1yhkn7krglw8c6yazcf7a3jljykd9k9"))))
    (build-system gnu-build-system)
       (modify-phases %standard-phases
         (delete 'configure)
         (delete 'build)
         (replace 'install              ;no install target
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (hunspell (string-append out "/share/hunspell/"))
                    (myspell (string-append out "/share/myspell")))
                (lambda (ext)
                  (install-file (string-append ,dict-name "/" ,dict-name ext)
                '(".aff" ".dic"))
               (symlink hunspell myspell)
       #:tests? #f))                    ; no tests
     (string-append "Hunspell dictionary for " full-name " (" dict-name ")"))
    (description "This package provides a dictionary for the Hunspell
spell-checking library.")
    (license license)
    (home-page home-page)))

Do you think it would be worth to add it to (gnu packages libreoffice) to define dictionaries?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]