From patchwork Thu Nov 5 01:22:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 24995 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 91E1A27BBF4; Thu, 5 Nov 2020 01:23:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, T_DKIM_INVALID,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DAF7327BBF3 for ; Thu, 5 Nov 2020 01:23:24 +0000 (GMT) Received: from localhost ([::1]:49642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaTzn-00018S-Qf for patchwork@mira.cbaines.net; Wed, 04 Nov 2020 20:23:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaTzS-00018L-9U for guix-patches@gnu.org; Wed, 04 Nov 2020 20:23:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaTzS-0008UT-0S for guix-patches@gnu.org; Wed, 04 Nov 2020 20:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kaTzR-0005Ra-Rl for guix-patches@gnu.org; Wed, 04 Nov 2020 20:23:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44457] [PATCH]: gnu: Add hunspell-dict-it-it. Resent-From: paul Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Nov 2020 01:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44457@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160453937420912 (code B ref -1); Thu, 05 Nov 2020 01:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Nov 2020 01:22:54 +0000 Received: from localhost ([127.0.0.1]:51047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaTzE-0005R8-PI for submit@debbugs.gnu.org; Wed, 04 Nov 2020 20:22:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:38410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaTz9-0005Qv-V4 for submit@debbugs.gnu.org; Wed, 04 Nov 2020 20:22:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaTz9-00017h-Pp for guix-patches@gnu.org; Wed, 04 Nov 2020 20:22:43 -0500 Received: from latitanza.investici.org ([82.94.249.234]:46945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaTz5-0008RJ-3M for guix-patches@gnu.org; Wed, 04 Nov 2020 20:22:43 -0500 Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4CRQk40y3bz8sgP for ; Thu, 5 Nov 2020 01:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1604539356; bh=VaYS64UicGG137uNUMC9reDstUVon3uoRCbWlU4YA84=; h=To:From:Subject:Date:From; b=sti8URnV8Mas9OO5fcWgpyEpz1CB+ceI8b++HZS1sN+/A0iF9hAP6S9wzc2b/ZqaJ VLxCIV2x/ZeyS11PUmUwAMHRXZVbYoLknDkvLlB42Zqb9hitmka4n55B8ffBJ6YrN9 8EM4kN8mUv6E6gi6i4hFOP8hUytYMh+2Naq3yVoc= Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4CRQk32gMhz8sfr for ; Thu, 5 Nov 2020 01:22:35 +0000 (UTC) From: paul Message-ID: Date: Thu, 5 Nov 2020 02:22:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Icedove/78.3.3 MIME-Version: 1.0 Content-Language: en-US Received-SPF: pass client-ip=82.94.249.234; envelope-from=goodoldpaul@autistici.org; helo=latitanza.investici.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 20:20:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Dear Guixers, as discussed here [0] and [1], I'm sending a patch to add a new hunspell.scm file to store hunspell dictionaries and an Italian dictionary. I tried to make my implementation reusable by other languages by defining a function that produces dictionary packages. If there is consensus I can move other hunspell dictionaries to the new file and/or convert them to use the new function. Thank you for your review. Cheers, Giacomo [0]: https://issues.guix.gnu.org/42474 [1]: https://lists.nongnu.org/archive/html/guix-devel/2020-11/msg00000.html From e5db7d7e9c66fa105966fe88d18a40d8075b9f61 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Thu, 5 Nov 2020 02:04:20 +0100 Subject: [PATCH] gnu: Add hunspell-dict-it-it. * gnu/packages/hunspell.scm: New file; (hunspell-dictionary): New variable; (hunspell-dict-it-it): New variable. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/hunspell.scm | 81 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 gnu/packages/hunspell.scm diff --git a/gnu/local.mk b/gnu/local.mk index 2a994bd3b9..510687e714 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -273,6 +273,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/heads.scm \ %D%/packages/hexedit.scm \ %D%/packages/hugs.scm \ + %D%/packages/hunspell.scm \ %D%/packages/hurd.scm \ %D%/packages/hyperledger.scm \ %D%/packages/i2p.scm \ diff --git a/gnu/packages/hunspell.scm b/gnu/packages/hunspell.scm new file mode 100644 index 0000000000..1340ecee7b --- /dev/null +++ b/gnu/packages/hunspell.scm @@ -0,0 +1,81 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Giacomo Leidi +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages hunspell) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (ice-9 match) + #:use-module (gnu packages libreoffice)) + +(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))) + +(define-public hunspell-dict-it-it + (let ((home-page "https://libreitalia.org/") + (license license:gpl3)) + (hunspell-dictionary "it_IT" "Italian" + #:home-page home-page + #:license license))) -- 2.29.1