From patchwork Wed Dec 23 19:15:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 25921 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 0483827BC06; Wed, 23 Dec 2020 19:17:01 +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=-0.3 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED,URIBL_SBL,URIBL_SBL_A 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 D73B827BC05 for ; Wed, 23 Dec 2020 19:16:59 +0000 (GMT) Received: from localhost ([::1]:51770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ks9d4-0007k3-It for patchwork@mira.cbaines.net; Wed, 23 Dec 2020 14:16:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ks9cA-0007jg-O1 for guix-patches@gnu.org; Wed, 23 Dec 2020 14:16:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ks9cA-0000M9-Fp for guix-patches@gnu.org; Wed, 23 Dec 2020 14:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ks9cA-00077D-9c for guix-patches@gnu.org; Wed, 23 Dec 2020 14:16:02 -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: Wed, 23 Dec 2020 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 44457-submit@debbugs.gnu.org id=B44457.160875092427300 (code B ref 44457); Wed, 23 Dec 2020 19:16:02 +0000 Received: (at 44457) by debbugs.gnu.org; 23 Dec 2020 19:15:24 +0000 Received: from localhost ([127.0.0.1]:54193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ks9bT-000768-P1 for submit@debbugs.gnu.org; Wed, 23 Dec 2020 14:15:24 -0500 Received: from latitanza.investici.org ([82.94.249.234]:29999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ks9bN-00075t-Tw for 44457@debbugs.gnu.org; Wed, 23 Dec 2020 14:15:17 -0500 Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4D1NFX4yMFz8sg6; Wed, 23 Dec 2020 19:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1608750912; bh=sysTDyHspV+GwICmRUnpPjFQjHIcgH2awncyWzhUjfc=; h=To:Cc:References:From:Subject:Date:In-Reply-To:From; b=MhBKlDW3wHamCjTH18YKf3m5coHpCaGUECtKek8CmeYMZreNwngjL+l/ciLoF7e9S O2RU+PxchUSg3A++1boFvZUwvHbiBemLSrnt2WLEPSbJRRXcekhfEWKUbDvbH1F1cS u7E/mWw1DU1vAAJvQXXF6LQZfsb6bDVYLstsD3Ig= Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4D1NFX3Bsvz8sfq; Wed, 23 Dec 2020 19:15:12 +0000 (UTC) References: <79f0de78-4d1f-7cae-3081-2581cafb51ee@autistici.org> <87tuscv62k.fsf@gnu.org> From: paul Message-ID: <9a6e026f-d5be-883f-f11b-b383ec858ec7@autistici.org> Date: Wed, 23 Dec 2020 20:15:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Icedove/78.6.0 MIME-Version: 1.0 In-Reply-To: <87tuscv62k.fsf@gnu.org> Content-Language: en-US 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: , Cc: 44457@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Ludo’ ! On 12/23/20 5:29 PM, Ludovic Courtès wrote: > Hi! > > paul skribis: > >> From 17a476dd234fa4a128eb90ccc8ac9a565045bfa1 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. > I’m picking up this patch as it seems to have fallen through the > cracks. :-) Definitely not a problem but still thanks a lot :) > > Overall it LGTM; a couple of comments below. > > Apparently this is different from the Hunspell dictionaries made from > Aspell word lists that appear in (gnu packages aspell), right? > > Should we name the packages differently to avoid collisions with the > existing ‘hunspell-dict-*’ packages? We definitely can but if I understood correctly they are generated from STOW wordlists [0] which seems to contain only variants of the English language. Since also the Libreoffice repository contains some of those variants, I was wondering, to achieve better consistency with future dictionaries, if it's worth either - to migrate the duplicates to use (hunspell-dictionary) from (gnu packages hunspell) - or just to use STOW for the English language and its variants and Libreoffice dictionaries for all the supported languages I believe either way we should be able to avoid collisions, but maybe I should just rename this one dictionary and, after we reach consensus, we can always decide to change it back. What do you think? Should I move this discussion to guix-devel? >> + (synopsis >> + (string-append "Hunspell dictionary for " full-name " (" dict-name ")")) > This is recommended against as this prevents i18n: > > https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html I apologize about this, I attached an updated patch. Thank you for your time, Cheers Giacomo [0]: http://wordlist.aspell.net/scowl-readme/ From be2124a82d8c2902a2031e4c6d89100b9fa42168 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 2f267e8aee..025fe88f36 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -277,6 +277,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..e36c1b6cc9 --- /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 trivial) + #: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 synopsis 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 trivial-build-system) + (native-inputs + `(("source" ,source))) + (arguments + `(#: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.") + (license license) + (home-page home-page))) + +(define-public hunspell-dict-it-it + (let ((synopsis identity)) + (hunspell-dictionary "it_IT" "Italian" + #:synopsis (synopsis "Hunspell dictionary for Italian") + #:home-page "https://libreitalia.org/" + #:license license:gpl3))) -- 2.29.2