[PATCH] Enable Emoji support in IBus

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Prikler
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal

Debbugs page

Leo Prikler wrote 5 years ago
(address . guix-patches@gnu.org)
e6f63e2866334acd829a9eb5e5de8af30e4f11d0.camel@student.tugraz.at
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
Leo Prikler wrote 5 years ago
[PATCH 1/5] licenses: Add Unicode license.
(address . 39086@debbugs.gnu.org)
20200111120829.29821-1-leo.prikler@student.tugraz.at
* guix/licenses.scm (unicode): New license.
---
guix/licenses.scm | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (26 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 2/5] gnu: Add unicode-emoji.
(address . 39086@debbugs.gnu.org)
20200111120829.29821-2-leo.prikler@student.tugraz.at
* gnu/packages/ibus.scm (unicode-emoji): New package.
---
gnu/packages/ibus.scm | 59 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)

Toggle diff (79 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 3/5] gnu: Add unicode-cldr-common.
(address . 39086@debbugs.gnu.org)
20200111120829.29821-3-leo.prikler@student.tugraz.at
* gnu/packages/ibus (unicode-cldr-commmon): New package.
---
gnu/packages/ibus.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (45 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 4/5] gnu: ibus: Build with emoji support.
(address . 39086@debbugs.gnu.org)
20200111120829.29821-4-leo.prikler@student.tugraz.at
* 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(-)

Toggle diff (33 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 5/5] gnu: ibus: Disable parallel build.
(address . 39086@debbugs.gnu.org)
20200111120829.29821-5-leo.prikler@student.tugraz.at
* gnu/packages/ibus (arguments): Disable parallel build.
---
gnu/packages/ibus.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (16 lines)
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
Ricardo Wurmus wrote 5 years ago
Re: [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086@debbugs.gnu.org)
87k15rxgcz.fsf@elephly.net
Hi Leo,

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

Thank you for these patches!

Toggle quote (6 lines)
> +(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.

Toggle quote (15 lines)
> + (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.

Toggle quote (32 lines)
> + (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.

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

Please use a complete sentence here.

--
Ricardo
Ricardo Wurmus wrote 5 years ago
Re: [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086@debbugs.gnu.org)
87imlbxg7a.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (2 lines)
> * 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?

Toggle quote (12 lines)
> +(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.

Toggle quote (9 lines)
> + (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
Ricardo Wurmus wrote 5 years ago
Re: [bug#39086] [PATCH 4/5] gnu: ibus: Build with emoji support.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086@debbugs.gnu.org)
87h80vxg36.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (4 lines)
> * 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]”.

Toggle quote (17 lines)
> (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.

Toggle quote (10 lines)
> @@ -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
Ricardo Wurmus wrote 5 years ago
Re: [bug#39086] [PATCH 5/5] gnu: ibus: Disable parallel build.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086@debbugs.gnu.org)
87ftgfxfyj.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (2 lines)
> * 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 ;)

Toggle quote (6 lines)
> (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
Leo Prikler wrote 5 years ago
Re: [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
24b49d2a2cef963826d44db2229ed120f4a40362.camel@student.tugraz.at
Hi Ricardo,

Am Donnerstag, den 16.01.2020, 22:04 +0100 schrieb Ricardo Wurmus:
Toggle quote (22 lines)
> 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.

Toggle quote (21 lines)
> > + (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.

Toggle quote (5 lines)
> 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.

Toggle quote (46 lines)
> > + (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.

Toggle quote (5 lines)
> > + (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
Leo Prikler wrote 5 years ago
Re: [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
51f014f61bee4c453c50d954b501a3b1dc17370e.camel@student.tugraz.at
Am Donnerstag, den 16.01.2020, 22:08 +0100 schrieb Ricardo Wurmus:
Toggle quote (13 lines)
> 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.

Toggle quote (15 lines)
> > +(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.

Toggle quote (13 lines)
>
> > + (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.
Leo Prikler wrote 5 years ago
[PATCH 2/5] gnu: Add unicode-emoji.
(address . 39086@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20200117001905.21023-2-leo.prikler@student.tugraz.at
* 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

Toggle diff (101 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 3/5] gnu: Add unicode-cldr-common.
(address . 39086@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20200117001905.21023-3-leo.prikler@student.tugraz.at
* gnu/packages/unicode.scm (unicode-cldr-commmon): New variable.
---
gnu/packages/unicode.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (48 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 4/5] gnu: ibus: Build with emoji support.
(address . 39086@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20200117001905.21023-4-leo.prikler@student.tugraz.at
* 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(-)

Toggle diff (47 lines)
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
Leo Prikler wrote 5 years ago
[PATCH 5/5] gnu: ibus: Disable parallel build.
(address . 39086@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20200117001905.21023-5-leo.prikler@student.tugraz.at
* gnu/packages/ibus.scm (ibus)[arguments]: Disable parallel build.
---
gnu/packages/ibus.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
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
Leo Prikler wrote 5 years ago
[bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
a9985730473b92872445f56e7c90840017e8af14.camel@student.tugraz.at
In my haste, I seriously forgot about match-lambda and prefix strips.
This one should be better.
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

Toggle diff (102 lines)
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
Ricardo Wurmus wrote 5 years ago
Re: [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086@debbugs.gnu.org)
87eevyy1g5.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (17 lines)
> 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
Leo Prikler wrote 5 years ago
Re: [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji.
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
8212020a503143b359bb9e7f1ab3808c18bfbdd2.camel@student.tugraz.at
Am Freitag, den 17.01.2020, 02:17 +0100 schrieb Leo Prikler:
Toggle quote (3 lines)
> 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.
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

Toggle diff (104 lines)
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
Leo Prikler wrote 5 years ago
Re: [bug#39086] [PATCH 3/5] gnu: Add unicode-cldr-common.
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
3f376d87e5377a04f460f51257780c2988817ec9.camel@student.tugraz.at
Am Freitag, den 17.01.2020, 08:41 +0100 schrieb Ricardo Wurmus:
Toggle quote (24 lines)
> 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.
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(+)

Toggle diff (42 lines)
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
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(-)

Toggle diff (49 lines)
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
Leo Prikler wrote 5 years ago
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
14b45185014c562704cd03621caf69419e98c040.camel@student.tugraz.at
Bumping this for review.
Ricardo Wurmus wrote 5 years ago
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086-done@debbugs.gnu.org)
87ftfrsn1r.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (2 lines)
> 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
Closed
Leo Prikler wrote 5 years ago
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 39086@debbugs.gnu.org)
760c517c8cca0c43c12be83341600972d3c124dc.camel@student.tugraz.at
Am Montag, den 03.02.2020, 16:33 +0100 schrieb Ricardo Wurmus:
Toggle quote (13 lines)
> 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
Ricardo Wurmus wrote 5 years ago
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39086@debbugs.gnu.org)
87d0avslih.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (30 lines)
> 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
?
Your comment

This issue is archived.

To comment on this conversation send an email to 39086@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 39086
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help