all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#36112] [PATCH] gnu: aspell.scm: Fix dictionaries with underscore/uppercase in name.
@ 2019-06-06  5:44 Jens Mølgaard
  2019-06-06 15:41 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Mølgaard @ 2019-06-06  5:44 UTC (permalink / raw)
  To: 36112


[-- Attachment #1.1: Type: text/plain, Size: 670 bytes --]

Salut Guix!

Since the same string is used to generate both the package names and
source URLs of Aspell dictionaries, dictionaries pt-pt and pt-br have
been producing invalid URLs. Their upstream names are pt_PT and pt_BR.

This could be fixed by changing either the way package names or URLs are
generated. Rather than adapting URLs to special cases, it seems more
straightforward to let the dict-name string represent upstream name, and
then downcase and replace underscores to produce a package name in
accordance with the naming conventions.

This was the simplest/easiest thing I could come up with. Do let me know
if there is a smarter way!

Kind regards,
Jens M


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-aspell.scm-Fix-dictionaries-with-underscore-uppe.patch --]
[-- Type: text/x-patch, Size: 2232 bytes --]

From 2bc4b7b31004642fcf300fe49f7b27ebd0353774 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= <jens@zete.tk>
Date: Thu, 6 Jun 2019 17:06:56 +1200
Subject: [PATCH] gnu: aspell.scm: Fix dictionaries with underscore/uppercase
 in name.

---
 gnu/packages/aspell.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/aspell.scm b/gnu/packages/aspell.scm
index 1bbe57a4ef..19b22c11eb 100644
--- a/gnu/packages/aspell.scm
+++ b/gnu/packages/aspell.scm
@@ -32,7 +32,8 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
-  #:use-module (gnu packages perl))
+  #:use-module (gnu packages perl)
+  #:use-module (ice-9 regex))
 
 (define-public aspell
   (package
@@ -102,7 +103,12 @@ dictionaries, including personal ones.")
 (define* (aspell-dictionary dict-name full-name
                             #:key version sha256 (prefix "aspell6-"))
   (package
-    (name (string-append "aspell-dict-" dict-name))
+    (name (string-append
+           "aspell-dict-"
+           (regexp-substitute/global
+            ;; Downcase and replace underscore in package names 
+            ;; to follow Guix naming conventions.
+            #f "_" (string-downcase dict-name) 'pre "-" 'post)))
     (version version)
     (source (origin
               (method url-fetch)
@@ -281,7 +287,7 @@ dictionaries, including personal ones.")
                       "0w2k5l5rbqpliripgqwiqixz5ghnjf7i9ggbrc4ly4vy1ia10rmc")))
 
 (define-public aspell-dict-pt-br
-  (aspell-dictionary "pt-br" "Brazilian Portuguese"
+  (aspell-dictionary "pt_BR" "Brazilian Portuguese"
                      #:version "20090702-0"
                      #:prefix "aspell6-"
                      #:sha256
@@ -289,7 +295,7 @@ dictionaries, including personal ones.")
                       "1y09lx9zf2rnp55r16b2vgj953l3538z1vaqgflg9mdvm555bz3p")))
 
 (define-public aspell-dict-pt-pt
-  (aspell-dictionary "pt-pt" "Portuguese"
+  (aspell-dictionary "pt_PT" "Portuguese"
                      #:version "20070510-0"
                      #:prefix "aspell6-"
                      #:sha256
-- 
2.21.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

end of thread, other threads:[~2019-06-07  7:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06  5:44 [bug#36112] [PATCH] gnu: aspell.scm: Fix dictionaries with underscore/uppercase in name Jens Mølgaard
2019-06-06 15:41 ` Ludovic Courtès
2019-06-07  4:56   ` Jens Mølgaard
2019-06-07  7:32     ` bug#36112: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.