app-i18n/ibus: fix build with >=dev-lang/vala-0.43.4
authorAkinori Hattori <hattya@gentoo.org>
Mon, 25 Feb 2019 12:43:07 +0000 (21:43 +0900)
committerAkinori Hattori <hattya@gentoo.org>
Mon, 25 Feb 2019 12:45:08 +0000 (21:45 +0900)
Bug: https://bugs.gentoo.org/677972
Signed-off-by: Akinori Hattori <hattya@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

app-i18n/ibus/files/ibus-1.5.19-vala-0.43.4.patch [new file with mode: 0644]
app-i18n/ibus/ibus-1.5.19.ebuild

diff --git a/app-i18n/ibus/files/ibus-1.5.19-vala-0.43.4.patch b/app-i18n/ibus/files/ibus-1.5.19-vala-0.43.4.patch
new file mode 100644 (file)
index 0000000..0ebb92c
--- /dev/null
@@ -0,0 +1,191 @@
+From 4d7c1e00e15921a0448947961183c1c124b6b49f Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Tue, 29 Jan 2019 17:57:16 +0900
+Subject: [PATCH] Delete weak pointer in GList.SList for vala 0.43.4
+
+Vala 0.43.4 does not allow to convert a weak pointer to the full one in SList.
+
+emojier.vala:424.36-425.73: error: Assignment: Cannot convert from
+`GLib.SList<weak IBus.EmojiData>' to `GLib.SList<IBus.EmojiData>?'
+emojier.vala:636.9-637.69: error: Assignment: Cannot convert from
+`GLib.SList<weak IBus.UnicodeBlock>' to `GLib.SList<IBus.UnicodeBlock>'
+panel.vala:526.36-526.65: error: Assignment: Cannot convert from
+`GLib.List<weak IBus.EngineDesc>' to `GLib.List<IBus.EngineDesc>?'
+---
+ src/ibusbus.h        | 11 ++++++-----
+ src/ibusemoji.h      |  6 +++---
+ src/ibusunicode.h    |  8 ++++----
+ ui/gtk3/emojier.vala | 24 ++++++++++++++++--------
+ 4 files changed, 29 insertions(+), 20 deletions(-)
+
+diff --git a/src/ibusbus.h b/src/ibusbus.h
+index dff3dfb7..fddcf5b2 100644
+--- a/src/ibusbus.h
++++ b/src/ibusbus.h
+@@ -2,7 +2,8 @@
+ /* vim:set et sts=4: */
+ /* ibus - The Input Bus
+  * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
+- * Copyright (C) 2008-2013 Red Hat, Inc.
++ * Copyright (C) 2013-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2008-2019 Red Hat, Inc.
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -692,7 +693,7 @@ gboolean     ibus_bus_register_component_async_finish
+  *
+  * List engines synchronously.
+  *
+- * Returns: (transfer container) (element-type IBusEngineDesc):
++ * Returns: (transfer full) (element-type IBusEngineDesc):
+  *         A List of engines.
+  */
+ GList       *ibus_bus_list_engines      (IBusBus        *bus);
+@@ -725,7 +726,7 @@ void         ibus_bus_list_engines_async
+  *
+  * Finishes an operation started with ibus_bus_list_engines_async().
+  *
+- * Returns: (transfer container) (element-type IBusEngineDesc):
++ * Returns: (transfer full) (element-type IBusEngineDesc):
+  *         A List of engines.
+  */
+ GList       *ibus_bus_list_engines_async_finish
+@@ -740,7 +741,7 @@ GList       *ibus_bus_list_engines_async_finish
+  *
+  * List active engines synchronously.
+  *
+- * Returns: (transfer container) (element-type IBusEngineDesc):
++ * Returns: (transfer full) (element-type IBusEngineDesc):
+  *        A List of active engines.
+  *
+  * Deprecated: 1.5.3: Read dconf value
+@@ -782,7 +783,7 @@ void         ibus_bus_list_active_engines_async
+  *
+  * Finishes an operation started with ibus_bus_list_active_engines_async().
+  *
+- * Returns: (transfer container) (element-type IBusEngineDesc):
++ * Returns: (transfer full) (element-type IBusEngineDesc):
+  *         A List of active engines.
+  *
+  * Deprecated: 1.5.3: Read dconf value
+diff --git a/src/ibusemoji.h b/src/ibusemoji.h
+index 4edee726..5e9fbcf4 100644
+--- a/src/ibusemoji.h
++++ b/src/ibusemoji.h
+@@ -1,8 +1,8 @@
+ /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+ /* vim:set et sts=4: */
+ /* bus - The Input Bus
+- * Copyright (C) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+- * Copyright (C) 2017 Red Hat, Inc.
++ * Copyright (C) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2017-2019 Red Hat, Inc.
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -209,7 +209,7 @@ void            ibus_emoji_data_save            (const gchar    *path,
+  * ibus_emoji_data_load:
+  * @path: A path of the saved dictionary file.
+  *
+- * Returns: (element-type IBusEmojiData) (transfer container):
++ * Returns: (element-type IBusEmojiData) (transfer full):
+  * An #IBusEmojiData list loaded from the saved cache file.
+  */
+ GSList *        ibus_emoji_data_load            (const gchar    *path);
+diff --git a/src/ibusunicode.h b/src/ibusunicode.h
+index 99de9451..473bdb19 100644
+--- a/src/ibusunicode.h
++++ b/src/ibusunicode.h
+@@ -1,8 +1,8 @@
+ /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+ /* vim:set et sts=4: */
+ /* bus - The Input Bus
+- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
+- * Copyright (C) 2018 Red Hat, Inc.
++ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2018-2019 Red Hat, Inc.
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -201,7 +201,7 @@ void              ibus_unicode_data_save      (const gchar        *path,
+  *    #IBusUnicodeData, * the total number of #IBusUnicodeData) of uint values
+  *    with that signal by 100 times. Otherwise %NULL.
+  *
+- * Returns: (element-type IBusUnicodeData) (transfer container):
++ * Returns: (element-type IBusUnicodeData) (transfer full):
+  * An #IBusUnicodeData list loaded from the saved cache file.
+  */
+ GSList *          ibus_unicode_data_load      (const gchar        *path,
+@@ -290,7 +290,7 @@ void              ibus_unicode_block_save     (const gchar        *path,
+  * ibus_unicode_block_load:
+  * @path: A path of the saved dictionary file.
+  *
+- * Returns: (element-type IBusUnicodeBlock) (transfer container):
++ * Returns: (element-type IBusUnicodeBlock) (transfer full):
+  * An #IBusUnicodeBlock list loaded from the saved cache file.
+  */
+ GSList *          ibus_unicode_block_load     (const gchar        *path);
+diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
+index 0b9b54a9..aedeb4cb 100644
+--- a/ui/gtk3/emojier.vala
++++ b/ui/gtk3/emojier.vala
+@@ -2,7 +2,7 @@
+  *
+  * ibus - The Input Bus
+  *
+- * Copyright (c) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (c) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -882,8 +882,13 @@ public class IBusEmojier : Gtk.ApplicationWindow {
+             update_unicode_blocks();
+             return;
+         } else {
+-            unowned GLib.SList<unowned string> emojis =
+-                    m_category_to_emojis_dict.lookup(category);
++            // Use copy_deep() since vala 0.43.4 does not allow to assign
++            // a weak pointer to the full one in SList:
++            // emojier.vala:885.48-886.62: error: Assignment: Cannot convert
++            // from `GLib.SList<string>' to `GLib.SList<weak string>?'
++            GLib.SList<string> emojis =
++                    m_category_to_emojis_dict.lookup(category).copy_deep(
++                            GLib.strdup);
+             m_lookup_table.clear();
+             m_candidate_panel_mode = true;
+             foreach (unowned string emoji in emojis) {
+@@ -1547,8 +1552,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
+             m_vbox.add(widget);
+             widget.show_all();
+         }
+-        unowned GLib.SList<unowned string>? annotations =
+-                data.get_annotations();
++        GLib.SList<string> annotations =
++                data.get_annotations().copy_deep(GLib.strdup);
+         var buff = new GLib.StringBuilder();
+         int i = 0;
+         foreach (unowned string annotation in annotations) {
+@@ -2001,17 +2006,20 @@ public class IBusEmojier : Gtk.ApplicationWindow {
+                     ) as IBus.EmojiData;
+                 m_emoji_to_data_dict.insert(favorite, new_data);
+             } else {
+-                unowned GLib.SList<string> annotations = data.get_annotations();
++                GLib.SList<string> annotations =
++                        data.get_annotations().copy_deep(GLib.strdup);
+                 if (annotations.find_custom(annotation, GLib.strcmp) == null) {
+                     annotations.append(annotation);
+-                    data.set_annotations(annotations.copy());
++                    data.set_annotations(annotations.copy_deep(GLib.strdup));
+                 }
+             }
+             unowned GLib.SList<string> emojis =
+                     m_annotation_to_emojis_dict.lookup(annotation);
+             if (emojis.find_custom(favorite, GLib.strcmp) == null) {
+                 emojis.append(favorite);
+-                m_annotation_to_emojis_dict.replace(annotation, emojis.copy());
++                m_annotation_to_emojis_dict.replace(
++                        annotation,
++                        emojis.copy_deep(GLib.strdup));
+             }
+         }
+     }
index d39593776ec0e2868a731481c2380a75e7599e1b..c04593084bc5d239697d51e1d049cab7c3acf2dc 100644 (file)
@@ -4,7 +4,6 @@
 EAPI="6"
 PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6,3_7} )
 VALA_MIN_API_VERSION="0.34"
-VALA_MAX_API_VERSION="0.36"
 VALA_USE_DEPEND="vapigen"
 
 inherit autotools bash-completion-r1 gnome2-utils python-r1 vala virtualx xdg-utils
@@ -74,7 +73,10 @@ DEPEND="${CDEPEND}
        nls? ( sys-devel/gettext )
        unicode? ( app-i18n/unicode-data )"
 
-PATCHES=( "${FILESDIR}"/${P}-gdk-wayland.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-gdk-wayland.patch
+       "${FILESDIR}"/${P}-vala-0.43.4.patch
+)
 
 src_prepare() {
        vala_src_prepare --ignore-use