diff options
author | EuAndreh <eu@euandre.org> | 2021-06-24 19:05:41 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-24 19:05:41 -0300 |
commit | a5ef546a30f6a0c98fe7ba712f56a257df843ac9 (patch) | |
tree | 54cafb2ac52cdeb6f4d19a82b12740662e5a4fa6 /src | |
parent | src/xyz/euandreh/queue.scm: Add version to hunspell-dict-pt-br (diff) | |
download | package-repository-a5ef546a30f6a0c98fe7ba712f56a257df843ac9.tar.gz package-repository-a5ef546a30f6a0c98fe7ba712f56a257df843ac9.tar.xz |
src/xyz/euandreh/queue.scm: Use hunspell function instead of aspell function to build dicts
Diffstat (limited to 'src')
-rw-r--r-- | src/xyz/euandreh/queue.scm | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/xyz/euandreh/queue.scm b/src/xyz/euandreh/queue.scm index b327ee7..f30a799 100644 --- a/src/xyz/euandreh/queue.scm +++ b/src/xyz/euandreh/queue.scm @@ -1,14 +1,18 @@ (define-module (xyz euandreh queue) #:use-module (srfi srfi-26) + #:use-module (ice-9 match) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) + #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages aspell) #:use-module (gnu packages base) #:use-module (gnu packages compression) + #:use-module (gnu packages libreoffice) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages language) @@ -425,68 +429,64 @@ Mustache templating language for Perl. This version of Template::Mustache conforms to v1.1.3 of the Mustache specs.") (license license:perl-license))) -(define* (aspell-word-list language synopsis - #:optional - (nick (string-map (lambda (chr) - (if (char=? #\_ chr) - #\- - chr)) - (string-downcase language)))) +(define* (hunspell-dictionary dict-name full-name #:key synopsis home-page license) (package - (name (string-append "hunspell-dict-" nick)) - (version "2018.04.16") - (source #f) + (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 "8cd38fb5138f2e456506aaa889ec2b7042a7439e"))) + (file-name (git-file-name "libreoffice-dictionaries" version)) + (sha256 + (base32 "0h2fmnzg6h4xnr7cil0i055d6ig5vcwnfli8vyflxm06dh6agwla")))) + (build-system trivial-build-system) (native-inputs - `(("tar" ,tar) - ("gzip" ,gzip) - ("perl" ,perl) - ("aspell" ,aspell) - ("which" ,which))) - (build-system gnu-build-system) + `(("source" ,source))) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (setenv "ASPELL_CONF" (string-append "dict-dir " out "/lib")) - (invoke "./configure")))) - (delete 'check)) - #:make-flags - (let ((out (assoc-ref %outputs "out"))) - (list (string-append "dictdir=" out "/share/locale") - (string-append "datadir=" out "/lib/aspell"))))) + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let* ((dictionary + (string-append (assoc-ref %build-inputs "source") + "/" ,dict-name + "/" ,dict-name)) + (hunspell (string-append %output "/share/hunspell/")) + (myspell (string-append %output "/share/myspell"))) + (for-each + (lambda (ext) + (install-file (string-append dictionary ext) + hunspell)) + '(".aff" ".dic")) + (symlink hunspell myspell) + #t)))) (synopsis synopsis) - (description - "This package provides a dictionary for the Hunspell spell-checking -library.") - (home-page "http://wordlist.aspell.net/") - (license (license:non-copyleft "file://Copyright" - "Word lists come from several sources, all -under permissive licensing terms. See the 'Copyright' file.")))) + (description "This package provides a dictionary for the Hunspell +spell-checking library.") + (license license) + (home-page home-page))) (define-public hunspell-dict-pt-br - (let ((s "Hunspell dictionary for Brazilian Portuguese")) - (package - (inherit (aspell-word-list "pt_BR" s)) - (version "2013.10.30") - (source (origin - (method url-fetch) - (uri "https://ftp.gnu.org/gnu/aspell/dict/pt_BR/aspell6-pt_BR-20131030-12-0.tar.bz2") - (sha256 - (base32 - "1xqlpk21s93c6blkdnpk7l62q9fxjvzdv2x86chl8p2x1gdrj3gb"))))))) + (hunspell-dictionary "pt_BR" "Brazilian Portuguese" + #:synopsis "Hunspell dictionary for Brazilian Portuguese" + #:home-page "http://pt-br.libreoffice.org/projetos/projeto-vero-verificador-ortografico/" + #:license license:lgpl3)) (define-public hunspell-dict-eo - (let ((s "Hunspell dictionary for Brazilian Portuguese")) - (package - (inherit (aspell-word-list "pt_BR" s)) - (source (origin - (method url-fetch) - (uri "https://ftp.gnu.org/gnu/aspell/dict/eo/aspell6-eo-2.1.20000225a-2.tar.bz2") - (sha256 - (base32 - "09vf0mbiicbmyb4bwb7v7lgpabnylg0wy7m3hlhl5rjdda6x3lj1"))))))) + (hunspell-dictionary "eo" "Esperanto" + #:synopsis "Hunspell dictionary for Esperanto" + #:home-page "https://eo.libreoffice.org/helpo/" + #:license license:gpl3)) (list perl-tidy |