unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Hunspell dictionaries
@ 2020-10-31 20:03 paul
  2020-11-01  9:41 ` Jonathan Brielmaier
  0 siblings, 1 reply; 4+ messages in thread
From: paul @ 2020-10-31 20:03 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2957 bytes --]

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)
   (package
     (name (string-append
            "hunspell-dict-"
            ;; 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))
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
              (url (string-append "https://anongit.freedesktop.org/git/"
                                  "libreoffice/dictionaries.git/"))
             (commit
               (string-append "libreoffice-" version))))
        (file-name (git-file-name "libreoffice-dictionaries" version))
       (sha256
         (base32 "0vvxnjpm1322ahf9q8bqs1yhkn7krglw8c6yazcf7a3jljykd9k9"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
        (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")))
                (for-each
                 (lambda (ext)
                   (install-file (string-append ,dict-name "/" ,dict-name ext)
                                 hunspell))
                 '(".aff" ".dic"))
                (symlink hunspell myspell)
                #t))))
        #:tests? #f))                    ; no tests
     (synopsis
      (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?

Cheers,

Giacomo


[0]: https://cgit.freedesktop.org/libreoffice/dictionaries


[-- Attachment #2: Type: text/html, Size: 3406 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-05  1:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-31 20:03 Hunspell dictionaries paul
2020-11-01  9:41 ` Jonathan Brielmaier
2020-11-02 13:56   ` Bengt Richter
2020-11-05  1:20   ` paul

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).