all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#39086] [PATCH] Enable Emoji support in IBus
@ 2020-01-11 11:58 Leo Prikler
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
  2020-01-17  1:17 ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
  0 siblings, 2 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-11 11:58 UTC (permalink / raw)
  To: 39086

Hi Guix!

After ibus-enabling my GNOME Desktop, I dug up an ancient bug, which
causes Ctrl-Shift-u to no longer work.  It appears that in IBus both
this feature and Emoji typing are handled through the Emoji engine,
which is currently disabled in the Guix build of the ibus package. 
Hence I started working enabling emoji support.

I tested this specific series with a VM based on my own current
settings, i.e. with GNOME, GUIX_GTK3_IM_MODULE_FILE set to the system-
wide immodules-gtk.cache and with the ibus-anthy engine specifically. 
From what I can tell, it does not appear as if Emoji Typing is enabled
until an IBus method (e.g. anthy) is added to GNOME, but that appears
to be on the GNOME side of things and is perfectly fine by me.

Regards,
Leo

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

* [bug#39086] [PATCH 1/5] licenses: Add Unicode license.
  2020-01-11 11:58 [bug#39086] [PATCH] Enable Emoji support in IBus Leo Prikler
@ 2020-01-11 12:08 ` Leo Prikler
  2020-01-11 12:08   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
                     ` (7 more replies)
  2020-01-17  1:17 ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
  1 sibling, 8 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-11 12:08 UTC (permalink / raw)
  To: 39086

* guix/licenses.scm (unicode): New license.
---
 guix/licenses.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/guix/licenses.scm b/guix/licenses.scm
index 41d4fefad2..c5bf360e85 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -85,6 +85,7 @@
             silofl1.1
             sleepycat
             tcl/tk
+            unicode
             unlicense
             vim
             w3c
@@ -584,6 +585,11 @@ at URI, which may be a file:// URI pointing the package's tree."
            "http://directory.fsf.org/wiki/License:Vim7.2"
            "http://www.gnu.org/licenses/license-list.html#Vim"))
 
+(define unicode
+  (license "Unicode"
+           "https://directory.fsf.org/wiki/License:Unicode"
+           "http://www.gnu.org/licenses/license-list.html#Unicode"))
+
 (define unlicense
   (license "Unlicense"
            "https://unlicense.org/"
-- 
2.24.1

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

* [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
@ 2020-01-11 12:08   ` Leo Prikler
  2020-01-16 21:04     ` Ricardo Wurmus
  2020-01-11 12:08   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-01-11 12:08 UTC (permalink / raw)
  To: 39086

* gnu/packages/ibus.scm (unicode-emoji): New package.
---
 gnu/packages/ibus.scm | 59 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 512a1ff9ec..3d582fb935 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -30,6 +30,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system trivial)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages anthy)
@@ -55,6 +56,64 @@
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages xorg))
 
+(define-public unicode-emoji
+  (package
+    (name "unicode-emoji")
+    (version "12.0")
+    (source #f)
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/unicode/emoji")))
+         (use-modules (guix build utils))
+         (mkdir-p out)
+         (for-each
+          (lambda (input)
+            (copy-file
+             (cdr input)
+             (string-append out "/"
+                            (substring (car input) 8) ; strip "unicode-"
+                            ".txt")))
+          %build-inputs)
+         #t)))
+    (inputs
+     `(("unicode-emoji-data"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-data.txt")
+           (sha256
+            (base32 "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))))
+       ("unicode-emoji-sequences"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-sequences.txt")
+           (sha256
+            (base32 "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))))
+       ("unicode-emoji-test"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-test.txt")
+           (sha256
+            (base32 "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))))
+       ("unicode-emoji-variation-sequences"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-variation-sequences.txt")
+           (sha256
+            (base32 "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))))
+       ("unicode-emoji-zwj-sequences"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-zwj-sequences.txt")
+           (sha256
+            (base32 "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))))
+    (home-page "https://www.unicode.org")
+    (synopsis "Unicode Emoji data")
+    (description
+     "Data files for the Unicode Technological Standard #51 (Emoji).")
+    (license unicode)))
+
 (define-public ibus
   (package
     (name "ibus")
-- 
2.24.1

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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
  2020-01-11 12:08   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
@ 2020-01-11 12:08   ` Leo Prikler
  2020-01-16 21:08     ` Ricardo Wurmus
  2020-01-11 12:08   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
                     ` (5 subsequent siblings)
  7 siblings, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-01-11 12:08 UTC (permalink / raw)
  To: 39086

* gnu/packages/ibus (unicode-cldr-commmon): New package.
---
 gnu/packages/ibus.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 3d582fb935..87e086a458 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -114,6 +114,38 @@
      "Data files for the Unicode Technological Standard #51 (Emoji).")
     (license unicode)))
 
+(define-public unicode-cldr-common
+  (package
+    (name "unicode-cldr-common")
+    (version "36")
+    (source
+     (origin (method url-fetch/zipbomb)
+             (uri "https://unicode.org/Public/cldr/36/cldr-common-36.0.zip")
+             (sha256
+              (base32
+               "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/unicode/cldr/common")))
+         (use-modules (guix build utils))
+         (mkdir-p out)
+         (copy-recursively (string-append (assoc-ref %build-inputs "source")
+                                          "/common")
+                           out)
+         #t)))
+    (home-page "https://www.unicode.org")
+    (synopsis "Locale data repository")
+    (description
+     "The Unicode Common Locale Data Repository (CLDR) is a large repository of
+locale data, including among others
+- patterns for formatting and parsing,
+- name translations,
+- and various informations on languages, scripts and country-specific
+conventions.")
+    (license unicode)))
+
 (define-public ibus
   (package
     (name "ibus")
-- 
2.24.1

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

* [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
  2020-01-11 12:08   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
  2020-01-11 12:08   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
@ 2020-01-11 12:08   ` Leo Prikler
  2020-01-16 21:10     ` Ricardo Wurmus
  2020-01-11 12:08   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
                     ` (4 subsequent siblings)
  7 siblings, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-01-11 12:08 UTC (permalink / raw)
  To: 39086

* gnu/packages/ibus.scm (ibus) [inputs]: Add unicode-emoji and
unicode-cldr-common.
[configure-flags]: Add flags for emoji and annotations.
---
 gnu/packages/ibus.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 87e086a458..66cfb10068 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -161,8 +161,15 @@ conventions.")
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f  ; tests fail because there's no connection to dbus
-       #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
-                           "--enable-python-library"
+       #:configure-flags `("--enable-python-library"
+                           ,(string-append
+                             "--with-unicode-emoji-dir="
+                             (assoc-ref %build-inputs "unicode-emoji")
+                             "/share/unicode/emoji")
+                           ,(string-append
+                             "--with-emoji-annotation-dir="
+                             (assoc-ref %build-inputs "unicode-cldr-common")
+                             "/share/unicode/cldr/common/annotations")
                            ,(string-append "--with-ucd-dir="
                                            (getcwd) "/ucd")
                            "--enable-wayland")
@@ -241,6 +248,8 @@ conventions.")
      `(("glib" ,glib "bin") ; for glib-genmarshal
        ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
 
+       ("unicode-emoji" ,unicode-emoji)
+       ("unicode-cldr-common" ,unicode-cldr-common)
        ;; XXX TODO: Move Unicode data to its own (versioned) package.
        ("unicode-nameslist"
         ,(origin
-- 
2.24.1

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

* [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
                     ` (2 preceding siblings ...)
  2020-01-11 12:08   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
@ 2020-01-11 12:08   ` Leo Prikler
  2020-01-16 21:13     ` Ricardo Wurmus
  2020-01-17  0:19   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
                     ` (3 subsequent siblings)
  7 siblings, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-01-11 12:08 UTC (permalink / raw)
  To: 39086

* gnu/packages/ibus (arguments): Disable parallel build.
---
 gnu/packages/ibus.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 66cfb10068..2d60173c6b 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -161,6 +161,9 @@ conventions.")
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f  ; tests fail because there's no connection to dbus
+       ;; Parallel build would fail after I added Emoji support.  This appears
+       ;; to be a race condition, but I'm unsure what exactly triggers it.
+       #:parallel-build? #f
        #:configure-flags `("--enable-python-library"
                            ,(string-append
                              "--with-unicode-emoji-dir="
-- 
2.24.1

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

* [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
  2020-01-11 12:08   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
@ 2020-01-16 21:04     ` Ricardo Wurmus
  2020-01-16 22:49       ` Leo Prikler
  0 siblings, 1 reply; 24+ messages in thread
From: Ricardo Wurmus @ 2020-01-16 21:04 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086


Hi Leo,

> * gnu/packages/ibus.scm (unicode-emoji): New package.

Thank you for these patches!

> +(define-public unicode-emoji
> +  (package
> +    (name "unicode-emoji")
> +    (version "12.0")
> +    (source #f)

It’s pretty unusual to not provide a source.  This will also make “guix
build -S unicode-emoji” turn up nothing.  It may be a good idea to
elevate at least one of the inputs to “source” status.

Ideally, all of the inputs would be considered sources like we’re doing
it for texlive-* packages.  It’s a pity that we can’t express multiple
URLs for the url-fetch method.

> +    (build-system trivial-build-system)
> +    (arguments
> +     `(#:modules ((guix build utils))
> +       #:builder
> +       (let ((out (string-append %output "/share/unicode/emoji")))
> +         (use-modules (guix build utils))
> +         (mkdir-p out)
> +         (for-each
> +          (lambda (input)
> +            (copy-file
> +             (cdr input)
> +             (string-append out "/"
> +                            (substring (car input) 8) ; strip "unicode-"
> +                            ".txt")))

We don’t like to use CAR and CDR, because they feel so 80s… :) We prefer
to use MATCH instead, because that feels more like the 90s.  You could
also use MATCH-LAMBDA.

Using a magical 8 also doesn’t feel right.  You only need to strip the
“unicode-” prefix because you chose to use it in the labels of these
inputs.  I don’t know… I feel that there’s a prettier way to express
this, but perhaps there’s no *shorter* way.

> +    (inputs
> +     `(("unicode-emoji-data"
> +        ,(origin
> +           (method url-fetch)
> +           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-data.txt")
> +           (sha256
> +            (base32 "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))))
> +       ("unicode-emoji-sequences"
> +        ,(origin
> +           (method url-fetch)
> +           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-sequences.txt")
> +           (sha256
> +            (base32 "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))))
> +       ("unicode-emoji-test"
> +        ,(origin
> +           (method url-fetch)
> +           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-test.txt")
> +           (sha256
> +            (base32 "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))))
> +       ("unicode-emoji-variation-sequences"
> +        ,(origin
> +           (method url-fetch)
> +           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-variation-sequences.txt")
> +           (sha256
> +            (base32 "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))))
> +       ("unicode-emoji-zwj-sequences"
> +        ,(origin
> +           (method url-fetch)
> +           (uri "https://www.unicode.org/Public/emoji/12.0/emoji-zwj-sequences.txt")
> +           (sha256
> +            (base32 "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))))

Please use the version string from above in the URLs here.  It’s just a
little less to update when upgrading the package in the future.

> +    (description
> +     "Data files for the Unicode Technological Standard #51
> (Emoji).")

Please use a complete sentence here.

--
Ricardo

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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-11 12:08   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
@ 2020-01-16 21:08     ` Ricardo Wurmus
  2020-01-16 22:53       ` Leo Prikler
  0 siblings, 1 reply; 24+ messages in thread
From: Ricardo Wurmus @ 2020-01-16 21:08 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086


Leo Prikler <leo.prikler@student.tugraz.at> writes:

> * gnu/packages/ibus (unicode-cldr-commmon): New package.

This should be:

    * gnu/packages/ibus.scm (unicode-cldr-commmon): New variable.

You know, I wonder if these things really belong to ibus.scm.  I
remember a TODO somewhere in the code that bemoaned the lack of
versioned Unicode data files.  Perhaps we should just add a new module
(gnu packages unicode) — what do you think?

> +(define-public unicode-cldr-common
> +  (package
> +    (name "unicode-cldr-common")
> +    (version "36")
> +    (source
> +     (origin (method url-fetch/zipbomb)
> +             (uri "https://unicode.org/Public/cldr/36/cldr-common-36.0.zip")
> +             (sha256
> +              (base32
> +
> "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))

The version should be “36.0”.  The source URI should reference the
version field twice.

> +    (description
> +     "The Unicode Common Locale Data Repository (CLDR) is a large repository of
> +locale data, including among others
> +- patterns for formatting and parsing,
> +- name translations,
> +- and various informations on languages, scripts and country-specific
> +conventions.")
> +    (license unicode)))

Please use @enumerate or @itemize texinfo syntax here.

-- 
Ricardo

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

* [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support.
  2020-01-11 12:08   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
@ 2020-01-16 21:10     ` Ricardo Wurmus
  0 siblings, 0 replies; 24+ messages in thread
From: Ricardo Wurmus @ 2020-01-16 21:10 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086


Leo Prikler <leo.prikler@student.tugraz.at> writes:

> * gnu/packages/ibus.scm (ibus) [inputs]: Add unicode-emoji and
> unicode-cldr-common.
> [configure-flags]: Add flags for emoji and annotations.

This should be “arguments”, not “configure-flags”.  Also: please remove
the space between “(ibus)” and “[inputs]”.

>      (arguments
>       `(#:tests? #f  ; tests fail because there's no connection to dbus
> -       #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
> -                           "--enable-python-library"
> +       #:configure-flags `("--enable-python-library"
> +                           ,(string-append
> +                             "--with-unicode-emoji-dir="
> +                             (assoc-ref %build-inputs "unicode-emoji")
> +                             "/share/unicode/emoji")
> +                           ,(string-append
> +                             "--with-emoji-annotation-dir="
> +                             (assoc-ref %build-inputs "unicode-cldr-common")
> +                             "/share/unicode/cldr/common/annotations")
>                             ,(string-append "--with-ucd-dir="
>                                             (getcwd) "/ucd")
>                             "--enable-wayland")

Now that the configure flags are so long I have a preference for
dropping quoting and using (list …) instead.  All that unquoting looks a
little too noisy.

> @@ -241,6 +248,8 @@ conventions.")
>       `(("glib" ,glib "bin") ; for glib-genmarshal
>         ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
>  
> +       ("unicode-emoji" ,unicode-emoji)
> +       ("unicode-cldr-common" ,unicode-cldr-common)
>         ;; XXX TODO: Move Unicode data to its own (versioned) package.
>         ("unicode-nameslist"
>          ,(origin

Oh, here is the comment I mentioned earlier!

-- 
Ricardo

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

* [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build.
  2020-01-11 12:08   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
@ 2020-01-16 21:13     ` Ricardo Wurmus
  0 siblings, 0 replies; 24+ messages in thread
From: Ricardo Wurmus @ 2020-01-16 21:13 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086


Leo Prikler <leo.prikler@student.tugraz.at> writes:

> * gnu/packages/ibus (arguments): Disable parallel build.

This should be:

    * gnu/packages/ibus.scm (ibus)[arguments]: Disable parallel build.

Hint: if you’re using Emacs with Magit and Yasnippets you can cut down
on a few of these commit message errors (in simple cases).  The snippets
are not very helpful in this particular case, but at least they get the
file name right ;)

>      (arguments
>       `(#:tests? #f  ; tests fail because there's no connection to dbus
> +       ;; Parallel build would fail after I added Emoji support.  This appears
> +       ;; to be a race condition, but I'm unsure what exactly triggers it.
> +       #:parallel-build? #f

Please don’t use “I” because it isn’t obvious from the context who is
speaking.  It’s better to keep it short and impersonal.

-- 
Ricardo

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

* [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
  2020-01-16 21:04     ` Ricardo Wurmus
@ 2020-01-16 22:49       ` Leo Prikler
  0 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-16 22:49 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

Hi Ricardo,

Am Donnerstag, den 16.01.2020, 22:04 +0100 schrieb Ricardo Wurmus:
> Hi Leo,
> 
> > * gnu/packages/ibus.scm (unicode-emoji): New package.
> 
> Thank you for these patches!
> 
> > +(define-public unicode-emoji
> > +  (package
> > +    (name "unicode-emoji")
> > +    (version "12.0")
> > +    (source #f)
> 
> It’s pretty unusual to not provide a source.  This will also make
> “guix
> build -S unicode-emoji” turn up nothing.  It may be a good idea to
> elevate at least one of the inputs to “source” status.
> 
> Ideally, all of the inputs would be considered sources like we’re
> doing
> it for texlive-* packages.  It’s a pity that we can’t express
> multiple
> URLs for the url-fetch method.
I'm somewhat confused by this comment.  While some of the texlive
packages do have actual sources, the big ones (texlive, texlive-union,
...) don't.  I know that computed-origin is a thing that exists, but
this would really have been overkill for me.

> > +    (build-system trivial-build-system)
> > +    (arguments
> > +     `(#:modules ((guix build utils))
> > +       #:builder
> > +       (let ((out (string-append %output "/share/unicode/emoji")))
> > +         (use-modules (guix build utils))
> > +         (mkdir-p out)
> > +         (for-each
> > +          (lambda (input)
> > +            (copy-file
> > +             (cdr input)
> > +             (string-append out "/"
> > +                            (substring (car input) 8) ; strip
> > "unicode-"
> > +                            ".txt")))
> 
> We don’t like to use CAR and CDR, because they feel so 80s… :) We
> prefer
> to use MATCH instead, because that feels more like the 90s.  You
> could
> also use MATCH-LAMBDA.
Will do.

> Using a magical 8 also doesn’t feel right.  You only need to strip
> the
> “unicode-” prefix because you chose to use it in the labels of these
> inputs.  I don’t know… I feel that there’s a prettier way to express
> this, but perhaps there’s no *shorter* way.
The thing is, I kinda do need those prefixes, because otherwise those
files will be stored as gnu/store/<hash>-emoji-<whatever>.txt, which
feels wrong.  AFAIK Guile has no string-remove-prefix.

> > +    (inputs
> > +     `(("unicode-emoji-data"
> > +        ,(origin
> > +           (method url-fetch)
> > +           (uri "
> > https://www.unicode.org/Public/emoji/12.0/emoji-data.txt")
> > +           (sha256
> > +            (base32
> > "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))))
> > +       ("unicode-emoji-sequences"
> > +        ,(origin
> > +           (method url-fetch)
> > +           (uri "
> > https://www.unicode.org/Public/emoji/12.0/emoji-sequences.txt")
> > +           (sha256
> > +            (base32
> > "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))))
> > +       ("unicode-emoji-test"
> > +        ,(origin
> > +           (method url-fetch)
> > +           (uri "
> > https://www.unicode.org/Public/emoji/12.0/emoji-test.txt")
> > +           (sha256
> > +            (base32
> > "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))))
> > +       ("unicode-emoji-variation-sequences"
> > +        ,(origin
> > +           (method url-fetch)
> > +           (uri "
> > https://www.unicode.org/Public/emoji/12.0/emoji-variation-sequences.txt
> > ")
> > +           (sha256
> > +            (base32
> > "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))))
> > +       ("unicode-emoji-zwj-sequences"
> > +        ,(origin
> > +           (method url-fetch)
> > +           (uri "
> > https://www.unicode.org/Public/emoji/12.0/emoji-zwj-sequences.txt")
> > +           (sha256
> > +            (base32
> > "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))))
> 
> Please use the version string from above in the URLs here.  It’s just
> a
> little less to update when upgrading the package in the future.
Will do.

> > +    (description
> > +     "Data files for the Unicode Technological Standard #51
> > (Emoji).")
> 
> Please use a complete sentence here.
I doubt the nature of this package will allow me to be more
descriptive, but I'll try.

Regards, Leo

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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-16 21:08     ` Ricardo Wurmus
@ 2020-01-16 22:53       ` Leo Prikler
  2020-01-17  7:41         ` Ricardo Wurmus
  0 siblings, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-01-16 22:53 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

Am Donnerstag, den 16.01.2020, 22:08 +0100 schrieb Ricardo Wurmus:
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
> 
> > * gnu/packages/ibus (unicode-cldr-commmon): New package.
> 
> This should be:
> 
>     * gnu/packages/ibus.scm (unicode-cldr-commmon): New variable.
> 
> You know, I wonder if these things really belong to ibus.scm.  I
> remember a TODO somewhere in the code that bemoaned the lack of
> versioned Unicode data files.  Perhaps we should just add a new
> module
> (gnu packages unicode) — what do you think?
I don't mind either way, but these packages don't fix the TODO.  They
add yet unseen features.

> > +(define-public unicode-cldr-common
> > +  (package
> > +    (name "unicode-cldr-common")
> > +    (version "36")
> > +    (source
> > +     (origin (method url-fetch/zipbomb)
> > +             (uri "
> > https://unicode.org/Public/cldr/36/cldr-common-36.0.zip")
> > +             (sha256
> > +              (base32
> > +
> > "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))
> 
> The version should be “36.0”.  The source URI should reference the
> version field twice.
The thing is, the Unicode people are really messy with their
versioning, so I feel safer if I at least just use version once. 
Basically, they have 36/36.0, but 36.1/36.1, which makes no sense
whatsoever.

> 
> > +    (description
> > +     "The Unicode Common Locale Data Repository (CLDR) is a large
> > repository of
> > +locale data, including among others
> > +- patterns for formatting and parsing,
> > +- name translations,
> > +- and various informations on languages, scripts and country-
> > specific
> > +conventions.")
> > +    (license unicode)))
> 
> Please use @enumerate or @itemize texinfo syntax here.
Will do.

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

* [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
                     ` (3 preceding siblings ...)
  2020-01-11 12:08   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
@ 2020-01-17  0:19   ` Leo Prikler
  2020-01-17  0:19   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-17  0:19 UTC (permalink / raw)
  To: 39086; +Cc: Ricardo Wurmus

* gnu/packages/unicode.scm: New file.
(unicode-emoji-file): New procedure.
(unicode-emoji): New variable.
* gnu/local.mk: Add unicode.scm to build.
---
 gnu/local.mk             |  1 +
 gnu/packages/unicode.scm | 81 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)
 create mode 100644 gnu/packages/unicode.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index cb46ee7880..f61a67a1ce 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -497,6 +497,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/tor.scm				\
   %D%/packages/tv.scm				\
   %D%/packages/uml.scm				\
+  %D%/packages/unicode.scm			\
   %D%/packages/unrtf.scm			\
   %D%/packages/upnp.scm				\
   %D%/packages/usb-modeswitch.scm		\
diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
new file mode 100644
index 0000000000..ab64827a0c
--- /dev/null
+++ b/gnu/packages/unicode.scm
@@ -0,0 +1,81 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages unicode)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system trivial))
+
+(define (unicode-emoji-file name version hash)
+  (origin
+    (method url-fetch)
+    (uri (string-append "https://www.unicode.org/Public/emoji/"
+                        version
+                        "/emoji-" name ".txt"))
+    (sha256 (base32 hash))))
+
+(define-public unicode-emoji
+  (package
+    (name "unicode-emoji")
+    (version "12.0")
+    (source #f)
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/unicode/emoji")))
+         (use-modules (guix build utils))
+         (mkdir-p out)
+         (for-each
+          (lambda (input)
+            (copy-file
+             (cdr input)
+             (string-append out "/"
+                            (substring (car input) 8) ; strip "unicode-"
+                            ".txt")))
+          %build-inputs)
+         #t)))
+    (inputs
+     `(("unicode-emoji-data"
+        ,(unicode-emoji-file
+          "data" version
+          "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))
+       ("unicode-emoji-sequences"
+        ,(unicode-emoji-file
+          "sequences" version
+          "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))
+       ("unicode-emoji-test"
+        ,(unicode-emoji-file
+          "test" version
+          "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))
+       ("unicode-emoji-variation-sequences"
+        ,(unicode-emoji-file
+          "variation-sequences" version
+          "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))
+       ("unicode-emoji-zwj-sequences"
+        ,(unicode-emoji-file
+          "zwj-sequences" version
+          "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))
+    (home-page "https://www.unicode.org")
+    (synopsis "Unicode Emoji data")
+    (description
+     "This package includes data files listing characters and sequences, that
+Unicode emoji supporting fonts or keyboards should support according to the
+Unicode Technological Standard #51.")
+    (license unicode)))
-- 
2.25.0

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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
                     ` (4 preceding siblings ...)
  2020-01-17  0:19   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
@ 2020-01-17  0:19   ` Leo Prikler
  2020-01-17  0:19   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
  2020-01-17  0:19   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
  7 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-17  0:19 UTC (permalink / raw)
  To: 39086; +Cc: Ricardo Wurmus

* gnu/packages/unicode.scm (unicode-cldr-commmon): New variable.
---
 gnu/packages/unicode.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
index ab64827a0c..e50f71a4be 100644
--- a/gnu/packages/unicode.scm
+++ b/gnu/packages/unicode.scm
@@ -79,3 +79,41 @@
 Unicode emoji supporting fonts or keyboards should support according to the
 Unicode Technological Standard #51.")
     (license unicode)))
+
+(define-public unicode-cldr-common
+  (let ((short-version "36")
+        (long-version "36.0"))
+   (package
+    (name "unicode-cldr-common")
+    (version long-version)
+    (source
+     (origin
+       (method url-fetch/zipbomb)
+       (uri (string-append "https://unicode.org/Public/cldr/" short-version
+                           "/cldr-common-" long-version ".zip"))
+       (sha256
+        (base32
+         "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/unicode/cldr/common")))
+         (use-modules (guix build utils))
+         (mkdir-p out)
+         (copy-recursively (string-append (assoc-ref %build-inputs "source")
+                                          "/common")
+                           out)
+         #t)))
+    (home-page "https://www.unicode.org")
+    (synopsis "Locale data repository")
+    (description
+     "The Unicode Common Locale Data Repository (CLDR) is a large repository of
+locale data, including among others
+@itemize
+@item patterns for formatting and parsing,
+@item name translations,
+@item and various informations on languages, scripts and country-specific
+@end itemize
+conventions.")
+    (license unicode))))
-- 
2.25.0

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

* [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
                     ` (5 preceding siblings ...)
  2020-01-17  0:19   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
@ 2020-01-17  0:19   ` Leo Prikler
  2020-01-17  0:19   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
  7 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-17  0:19 UTC (permalink / raw)
  To: 39086; +Cc: Ricardo Wurmus

* gnu/packages/ibus.scm (ibus)[inputs]: Add unicode-emoji and
unicode-cldr-common.
[arguments]<configure-flags>: Use list instead of quote.
Add flags for unicode-emoji-dir and emoji-annotation-dir.
---
 gnu/packages/ibus.scm | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 512a1ff9ec..1e8b441301 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -53,6 +53,7 @@
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages textutils)
+  #:use-module (gnu packages unicode)
   #:use-module (gnu packages xorg))
 
 (define-public ibus
@@ -70,11 +71,18 @@
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f  ; tests fail because there's no connection to dbus
-       #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
-                           "--enable-python-library"
-                           ,(string-append "--with-ucd-dir="
-                                           (getcwd) "/ucd")
-                           "--enable-wayland")
+       #:configure-flags (list "--enable-python-library"
+                               (string-append
+                                "--with-unicode-emoji-dir="
+                                (assoc-ref %build-inputs "unicode-emoji")
+                                "/share/unicode/emoji")
+                               (string-append
+                                "--with-emoji-annotation-dir="
+                                (assoc-ref %build-inputs "unicode-cldr-common")
+                                "/share/unicode/cldr/common/annotations")
+                               (string-append "--with-ucd-dir="
+                                              (getcwd) "/ucd")
+                               "--enable-wayland")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'prepare-ucd-dir
@@ -150,6 +158,8 @@
      `(("glib" ,glib "bin") ; for glib-genmarshal
        ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
 
+       ("unicode-emoji" ,unicode-emoji)
+       ("unicode-cldr-common" ,unicode-cldr-common)
        ;; XXX TODO: Move Unicode data to its own (versioned) package.
        ("unicode-nameslist"
         ,(origin
-- 
2.25.0

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

* [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build.
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
                     ` (6 preceding siblings ...)
  2020-01-17  0:19   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
@ 2020-01-17  0:19   ` Leo Prikler
  7 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-17  0:19 UTC (permalink / raw)
  To: 39086; +Cc: Ricardo Wurmus

* gnu/packages/ibus.scm (ibus)[arguments]: Disable parallel build.
---
 gnu/packages/ibus.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 1e8b441301..16dfbf4888 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -71,6 +71,7 @@
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f  ; tests fail because there's no connection to dbus
+       #:parallel-build? #f ; race condition discovered with emoji support
        #:configure-flags (list "--enable-python-library"
                                (string-append
                                 "--with-unicode-emoji-dir="
-- 
2.25.0

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

* [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
  2020-01-11 11:58 [bug#39086] [PATCH] Enable Emoji support in IBus Leo Prikler
  2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
@ 2020-01-17  1:17 ` Leo Prikler
  2020-01-17 10:37   ` Leo Prikler
  1 sibling, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-01-17  1:17 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

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

In my haste, I seriously forgot about match-lambda and prefix strips. 
This one should be better.

[-- Attachment #2: 0002-gnu-Add-unicode-emoji.patch --]
[-- Type: text/x-patch, Size: 4357 bytes --]

From 3a1d1b2e1b3563f820c153b07693cc7496ae7c7c Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Sat, 11 Jan 2020 02:12:18 +0100
Subject: [PATCH] gnu: Add unicode-emoji.

* gnu/packages/unicode.scm: New file.
(unicode-emoji-file): New procedure.
(unicode-emoji): New variable.
* gnu/local.mk: Add unicode.scm to build.
---
 gnu/local.mk             |  1 +
 gnu/packages/unicode.scm | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 gnu/packages/unicode.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index cb46ee7..f61a67a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -497,6 +497,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/tor.scm				\
   %D%/packages/tv.scm				\
   %D%/packages/uml.scm				\
+  %D%/packages/unicode.scm			\
   %D%/packages/unrtf.scm			\
   %D%/packages/upnp.scm				\
   %D%/packages/usb-modeswitch.scm		\
diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
new file mode 100644
index 0000000..4c8298e
--- /dev/null
+++ b/gnu/packages/unicode.scm
@@ -0,0 +1,84 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages unicode)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system trivial))
+
+(define (unicode-emoji-file name version hash)
+  (origin
+    (method url-fetch)
+    (uri (string-append "https://www.unicode.org/Public/emoji/"
+                        version
+                        "/emoji-" name ".txt"))
+    (sha256 (base32 hash))))
+
+(define-public unicode-emoji
+  (package
+    (name "unicode-emoji")
+    (version "12.0")
+    (source #f)
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/unicode/emoji")))
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (mkdir-p out)
+         (for-each
+          (match-lambda
+            ((file . dest)
+             (and (string-prefix? dest "unicode-")
+                  (copy-file
+                   file
+                   (string-append out "/"
+                                  (substring dest (length "unicode-"))
+                                  ".txt")))))
+          %build-inputs)
+         #t)))
+    (inputs
+     `(("unicode-emoji-data"
+        ,(unicode-emoji-file
+          "data" version
+          "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))
+       ("unicode-emoji-sequences"
+        ,(unicode-emoji-file
+          "sequences" version
+          "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))
+       ("unicode-emoji-test"
+        ,(unicode-emoji-file
+          "test" version
+          "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))
+       ("unicode-emoji-variation-sequences"
+        ,(unicode-emoji-file
+          "variation-sequences" version
+          "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))
+       ("unicode-emoji-zwj-sequences"
+        ,(unicode-emoji-file
+          "zwj-sequences" version
+          "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))
+    (home-page "https://www.unicode.org")
+    (synopsis "Unicode Emoji data")
+    (description
+     "This package includes data files listing characters and sequences, that
+Unicode emoji supporting fonts or keyboards should support according to the
+Unicode Technological Standard #51.")
+    (license unicode)))
--
libgit2 0.28.4


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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-16 22:53       ` Leo Prikler
@ 2020-01-17  7:41         ` Ricardo Wurmus
  2020-01-17 10:41           ` Leo Prikler
  0 siblings, 1 reply; 24+ messages in thread
From: Ricardo Wurmus @ 2020-01-17  7:41 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086


Leo Prikler <leo.prikler@student.tugraz.at> writes:

> Am Donnerstag, den 16.01.2020, 22:08 +0100 schrieb Ricardo Wurmus:
>> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>> 
>> > * gnu/packages/ibus (unicode-cldr-commmon): New package.
>> 
>> This should be:
>> 
>>     * gnu/packages/ibus.scm (unicode-cldr-commmon): New variable.
>> 
>> You know, I wonder if these things really belong to ibus.scm.  I
>> remember a TODO somewhere in the code that bemoaned the lack of
>> versioned Unicode data files.  Perhaps we should just add a new
>> module
>> (gnu packages unicode) — what do you think?
> I don't mind either way, but these packages don't fix the TODO.  They
> add yet unseen features.

That’s okay.  I just think we should start that new unicode.scm module
to finally have a place for these data files.  That would be a more
appropriate place than ibus.scm.

-- 
Ricardo

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

* [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
  2020-01-17  1:17 ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
@ 2020-01-17 10:37   ` Leo Prikler
  0 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-17 10:37 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

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

Am Freitag, den 17.01.2020, 02:17 +0100 schrieb Leo Prikler:
> In my haste, I seriously forgot about match-lambda and prefix
> strips. 
> This one should be better.
I seriously should not update my patches at 2AM.  I only verified that
the package itself builds, not that its outputs are correct.  *sigh*
Anyway, here is the real updated version.

[-- Attachment #2: 0002-gnu-Add-unicode-emoji.patch --]
[-- Type: text/x-patch, Size: 4329 bytes --]

From 6e92356aecb105886885de79b6a1e51c58f522a2 Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Sat, 11 Jan 2020 02:12:18 +0100
Subject: [PATCH 2/7] gnu: Add unicode-emoji.

* gnu/packages/unicode.scm: New file.
(unicode-emoji-file): New procedure.
(unicode-emoji): New variable.
* gnu/local.mk: Add unicode.scm to build.
---
 gnu/local.mk             |  1 +
 gnu/packages/unicode.scm | 84 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 gnu/packages/unicode.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index cb46ee7880..f61a67a1ce 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -497,6 +497,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/tor.scm				\
   %D%/packages/tv.scm				\
   %D%/packages/uml.scm				\
+  %D%/packages/unicode.scm			\
   %D%/packages/unrtf.scm			\
   %D%/packages/upnp.scm				\
   %D%/packages/usb-modeswitch.scm		\
diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
new file mode 100644
index 0000000000..d125415f66
--- /dev/null
+++ b/gnu/packages/unicode.scm
@@ -0,0 +1,84 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages unicode)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system trivial))
+
+(define (unicode-emoji-file name version hash)
+  (origin
+    (method url-fetch)
+    (uri (string-append "https://www.unicode.org/Public/emoji/"
+                        version
+                        "/emoji-" name ".txt"))
+    (sha256 (base32 hash))))
+
+(define-public unicode-emoji
+  (package
+    (name "unicode-emoji")
+    (version "12.0")
+    (source #f)
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/unicode/emoji")))
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (mkdir-p out)
+         (for-each
+          (match-lambda
+            ((dest . file)
+             (and (string-prefix? "unicode-" dest)
+                  (copy-file
+                   file
+                   (string-append out "/"
+                                  (substring dest (string-length "unicode-"))
+                                  ".txt")))))
+          %build-inputs)
+         #t)))
+    (inputs
+     `(("unicode-emoji-data"
+        ,(unicode-emoji-file
+          "data" version
+          "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))
+       ("unicode-emoji-sequences"
+        ,(unicode-emoji-file
+          "sequences" version
+          "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))
+       ("unicode-emoji-test"
+        ,(unicode-emoji-file
+          "test" version
+          "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))
+       ("unicode-emoji-variation-sequences"
+        ,(unicode-emoji-file
+          "variation-sequences" version
+          "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))
+       ("unicode-emoji-zwj-sequences"
+        ,(unicode-emoji-file
+          "zwj-sequences" version
+          "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))
+    (home-page "https://www.unicode.org")
+    (synopsis "Unicode Emoji data")
+    (description
+     "This package includes data files listing characters and sequences, that
+Unicode emoji supporting fonts or keyboards should support according to the
+Unicode Technological Standard #51.")
+    (license unicode)))
-- 
2.25.0


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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-17  7:41         ` Ricardo Wurmus
@ 2020-01-17 10:41           ` Leo Prikler
  2020-02-03  9:49             ` Leo Prikler
  2020-02-03 16:06             ` Ricardo Wurmus
  0 siblings, 2 replies; 24+ messages in thread
From: Leo Prikler @ 2020-01-17 10:41 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

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

Am Freitag, den 17.01.2020, 08:41 +0100 schrieb Ricardo Wurmus:
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
> 
> > Am Donnerstag, den 16.01.2020, 22:08 +0100 schrieb Ricardo Wurmus:
> > > Leo Prikler <leo.prikler@student.tugraz.at> writes:
> > > 
> > > > * gnu/packages/ibus (unicode-cldr-commmon): New package.
> > > 
> > > This should be:
> > > 
> > >     * gnu/packages/ibus.scm (unicode-cldr-commmon): New variable.
> > > 
> > > You know, I wonder if these things really belong to ibus.scm.  I
> > > remember a TODO somewhere in the code that bemoaned the lack of
> > > versioned Unicode data files.  Perhaps we should just add a new
> > > module
> > > (gnu packages unicode) — what do you think?
> > I don't mind either way, but these packages don't fix the
> > TODO.  They
> > add yet unseen features.
> 
> That’s okay.  I just think we should start that new unicode.scm
> module
> to finally have a place for these data files.  That would be a more
> appropriate place than ibus.scm.
I agree.  Incidentally, I just coded up a ucd package to use with ibus
or other packages that need the database.  I copied some of the recipe
from the gentoo ebuild, specifically the idea to use the zipped
sources.

[-- Attachment #2: 0006-gnu-Add-ucd.patch --]
[-- Type: text/x-patch, Size: 1734 bytes --]

From 1c660d4c18aaee9046b958ce05d50c142f0767f7 Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Fri, 17 Jan 2020 11:20:46 +0100
Subject: [PATCH 6/7] gnu: Add ucd.

* gnu/packages/unicode.scm (ucd): New variable.
---
 gnu/packages/unicode.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
index 4206d0db2e..39f2548317 100644
--- a/gnu/packages/unicode.scm
+++ b/gnu/packages/unicode.scm
@@ -22,6 +22,35 @@
   #:use-module (guix download)
   #:use-module (guix build-system trivial))
 
+(define-public ucd
+  (package
+    (name "ucd")
+    (version "12.0.0")
+    (source
+     (origin
+       (method url-fetch/zipbomb)
+       (uri (string-append "https://www.unicode.org/Public/zipped/" version
+                           "/UCD.zip"))
+       (sha256
+        (base32
+         "1ighy39cjkmqnv1797wrxjz76mv1fdw7zp5j04q55bkwxsdkvrmh"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((out (string-append %output "/share/ucd")))
+         (use-modules (guix build utils))
+         (mkdir-p out)
+         (copy-recursively (assoc-ref %build-inputs "source") out)
+         #t)))
+    (home-page "https://www.unicode.org")
+    (synopsis "Unicode Character Database")
+    (description
+     "The Unicode Character Database (UCD) consists of a number of data files
+listing Unicode character properties and related data.  It also includes test
+data for conformance to several important Unicode algorithms.")
+    (license unicode)))
+
 (define (unicode-emoji-file name version hash)
   (origin
     (method url-fetch)
-- 
2.25.0


[-- Attachment #3: 0007-gnu-Use-new-ucd-package-in-ibus.patch --]
[-- Type: text/x-patch, Size: 2681 bytes --]

From 20c30687c1ae0623232bd8fc41566fe271c5c20a Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Fri, 17 Jan 2020 11:35:24 +0100
Subject: [PATCH 7/7] gnu: Use new ucd package in ibus.

* gnu/packages/ibus.scm (ibus)[native-inputs]: Add ucd.
Remove unicode-nameslist and unicode-blocks.
(arguments)[configure-flags]: Update accordingly.
(phases)<prepare-ucd-dir>: Remove phase.
---
 gnu/packages/ibus.scm | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 16dfbf4888..c0766c06bd 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -82,16 +82,11 @@
                                 (assoc-ref %build-inputs "unicode-cldr-common")
                                 "/share/unicode/cldr/common/annotations")
                                (string-append "--with-ucd-dir="
-                                              (getcwd) "/ucd")
+                                              (assoc-ref %build-inputs "ucd")
+                                              "/share/ucd")
                                "--enable-wayland")
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'prepare-ucd-dir
-           (lambda* (#:key inputs #:allow-other-keys)
-             (mkdir-p "../ucd")
-             (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
-             (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
-             #t))
          (add-after 'unpack 'patch-python-target-directories
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((root (string-append (assoc-ref outputs "out")
@@ -158,22 +153,9 @@
     (native-inputs
      `(("glib" ,glib "bin") ; for glib-genmarshal
        ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
-
+       ("ucd" ,ucd)
        ("unicode-emoji" ,unicode-emoji)
        ("unicode-cldr-common" ,unicode-cldr-common)
-       ;; XXX TODO: Move Unicode data to its own (versioned) package.
-       ("unicode-nameslist"
-        ,(origin
-           (method url-fetch)
-           (uri "https://www.unicode.org/Public/12.0.0/ucd/NamesList.txt")
-           (sha256
-            (base32 "0vsq8gx7hws8mvxy3nlglpwxw7ky57q0fs09d7w9xgb2ylk7fz61"))))
-       ("unicode-blocks"
-        ,(origin
-           (method url-fetch)
-           (uri "https://www.unicode.org/Public/12.0.0/ucd/Blocks.txt")
-           (sha256
-            (base32 "041sk54v6rjzb23b9x7yjdwzdp2wc7gvfz7ybavgg4gbh51wm8x1"))))
        ("vala" ,vala)
        ("pkg-config" ,pkg-config)))
     (native-search-paths
-- 
2.25.0


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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-17 10:41           ` Leo Prikler
@ 2020-02-03  9:49             ` Leo Prikler
  2020-02-03 15:33               ` bug#39086: " Ricardo Wurmus
  2020-02-03 16:06             ` Ricardo Wurmus
  1 sibling, 1 reply; 24+ messages in thread
From: Leo Prikler @ 2020-02-03  9:49 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

Bumping this for review.

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

* bug#39086: [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-02-03  9:49             ` Leo Prikler
@ 2020-02-03 15:33               ` Ricardo Wurmus
  2020-02-03 15:46                 ` [bug#39086] " Leo Prikler
  0 siblings, 1 reply; 24+ messages in thread
From: Ricardo Wurmus @ 2020-02-03 15:33 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086-done


Leo Prikler <leo.prikler@student.tugraz.at> writes:

> Bumping this for review.

Sorry for the delay.

I’ve made a few minor changes and pushed the patches to the master
branch (last commit 933bb1acdb).

Thank you!

--
Ricardo

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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-02-03 15:33               ` bug#39086: " Ricardo Wurmus
@ 2020-02-03 15:46                 ` Leo Prikler
  0 siblings, 0 replies; 24+ messages in thread
From: Leo Prikler @ 2020-02-03 15:46 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39086

Am Montag, den 03.02.2020, 16:33 +0100 schrieb Ricardo Wurmus:
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
> 
> > Bumping this for review.
> 
> Sorry for the delay.
> 
> I’ve made a few minor changes and pushed the patches to the master
> branch (last commit 933bb1acdb).
> 
> Thank you!
> 
> --
> Ricardo
Thanks.

With 0001-0005 pushed and the bug marked as done, should I open another
one for 0006-0007, or is there a reason to keep those inputs as they
currently are on master?

Regards,
Leo

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

* [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
  2020-01-17 10:41           ` Leo Prikler
  2020-02-03  9:49             ` Leo Prikler
@ 2020-02-03 16:06             ` Ricardo Wurmus
  1 sibling, 0 replies; 24+ messages in thread
From: Ricardo Wurmus @ 2020-02-03 16:06 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39086


Leo Prikler <leo.prikler@student.tugraz.at> writes:

> Am Freitag, den 17.01.2020, 08:41 +0100 schrieb Ricardo Wurmus:
>> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>>
>> > Am Donnerstag, den 16.01.2020, 22:08 +0100 schrieb Ricardo Wurmus:
>> > > Leo Prikler <leo.prikler@student.tugraz.at> writes:
>> > >
>> > > > * gnu/packages/ibus (unicode-cldr-commmon): New package.
>> > >
>> > > This should be:
>> > >
>> > >     * gnu/packages/ibus.scm (unicode-cldr-commmon): New variable.
>> > >
>> > > You know, I wonder if these things really belong to ibus.scm.  I
>> > > remember a TODO somewhere in the code that bemoaned the lack of
>> > > versioned Unicode data files.  Perhaps we should just add a new
>> > > module
>> > > (gnu packages unicode) — what do you think?
>> > I don't mind either way, but these packages don't fix the
>> > TODO.  They
>> > add yet unseen features.
>>
>> That’s okay.  I just think we should start that new unicode.scm
>> module
>> to finally have a place for these data files.  That would be a more
>> appropriate place than ibus.scm.
> I agree.  Incidentally, I just coded up a ucd package to use with ibus
> or other packages that need the database.  I copied some of the recipe
> from the gentoo ebuild, specifically the idea to use the zipped
> sources.

Thanks, I just pushed those two patches to the master branch (commit
a9e5e6497a).

--
Ricardo

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

end of thread, other threads:[~2020-02-03 16:07 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-11 11:58 [bug#39086] [PATCH] Enable Emoji support in IBus Leo Prikler
2020-01-11 12:08 ` [bug#39086] [PATCH 1/5] licenses: Add Unicode license Leo Prikler
2020-01-11 12:08   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
2020-01-16 21:04     ` Ricardo Wurmus
2020-01-16 22:49       ` Leo Prikler
2020-01-11 12:08   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
2020-01-16 21:08     ` Ricardo Wurmus
2020-01-16 22:53       ` Leo Prikler
2020-01-17  7:41         ` Ricardo Wurmus
2020-01-17 10:41           ` Leo Prikler
2020-02-03  9:49             ` Leo Prikler
2020-02-03 15:33               ` bug#39086: " Ricardo Wurmus
2020-02-03 15:46                 ` [bug#39086] " Leo Prikler
2020-02-03 16:06             ` Ricardo Wurmus
2020-01-11 12:08   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
2020-01-16 21:10     ` Ricardo Wurmus
2020-01-11 12:08   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
2020-01-16 21:13     ` Ricardo Wurmus
2020-01-17  0:19   ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
2020-01-17  0:19   ` [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common Leo Prikler
2020-01-17  0:19   ` [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support Leo Prikler
2020-01-17  0:19   ` [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build Leo Prikler
2020-01-17  1:17 ` [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji Leo Prikler
2020-01-17 10:37   ` Leo Prikler

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.