Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: app-i18n/scim-canna/, app-i18n/scim-canna/files/
Date: Wed, 06 Jul 2022 00:10:36
Message-Id: 1657066229.25c5b1a9955e0d6679301c75cc50ed868bab037f.Alessandro-Barbieri@gentoo
1 commit: 25c5b1a9955e0d6679301c75cc50ed868bab037f
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Fri Jul 1 01:17:14 2022 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Wed Jul 6 00:10:29 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=25c5b1a9
7
8 app-i18n/scim-canna: new package, add 1.0.1
9
10 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
11
12 app-i18n/scim-canna/Manifest | 1 +
13 .../files/scim-canna-1.0.1-fix_ftbfs_gtk3.patch | 201 +++++++++++++++++++++
14 app-i18n/scim-canna/metadata.xml | 8 +
15 app-i18n/scim-canna/scim-canna-1.0.1.ebuild | 54 ++++++
16 4 files changed, 264 insertions(+)
17
18 diff --git a/app-i18n/scim-canna/Manifest b/app-i18n/scim-canna/Manifest
19 new file mode 100644
20 index 000000000..d2bfe27c3
21 --- /dev/null
22 +++ b/app-i18n/scim-canna/Manifest
23 @@ -0,0 +1 @@
24 +DIST scim-canna-1.0.1.tar.gz 516186 BLAKE2B 03b977e841d6263f6c980e8e729122ca4ff7c9a0966f6f9daf57543250e7119a84ddfb7805804e3c5afaecba91d50d21448f49335d5a28cb967de8370b9f5dd9 SHA512 711b67211c9d1f4cb8ca09b88d455718607aa2d99e47a753fa8d71d2e1f0df8c649b64d08149785eeaa98d1399b9ca92e3df7e1be8f150ce99f28f82491b8bc1
25
26 diff --git a/app-i18n/scim-canna/files/scim-canna-1.0.1-fix_ftbfs_gtk3.patch b/app-i18n/scim-canna/files/scim-canna-1.0.1-fix_ftbfs_gtk3.patch
27 new file mode 100644
28 index 000000000..d9a99010a
29 --- /dev/null
30 +++ b/app-i18n/scim-canna/files/scim-canna-1.0.1-fix_ftbfs_gtk3.patch
31 @@ -0,0 +1,201 @@
32 +--- a/src/scim_canna_imengine_setup.cpp
33 ++++ b/src/scim_canna_imengine_setup.cpp
34 +@@ -152,7 +152,9 @@
35 + // Internal data declaration.
36 + static bool __have_changed = true;
37 +
38 ++#if !GTK_CHECK_VERSION(2, 12, 0)
39 + static GtkTooltips * __widget_tooltips = 0;
40 ++#endif
41 +
42 + static BoolConfigData __config_bool_common [] =
43 + {
44 +@@ -284,11 +286,17 @@
45 + entry);
46 + gtk_widget_show (entry->widget);
47 +
48 ++#if !GTK_CHECK_VERSION(2, 12, 0)
49 + if (!__widget_tooltips)
50 + __widget_tooltips = gtk_tooltips_new();
51 ++#endif
52 + if (entry->tooltip)
53 ++#if GTK_CHECK_VERSION(2, 12, 0)
54 ++ gtk_widget_set_tooltip_text (entry->widget, _(entry->tooltip));
55 ++#else
56 + gtk_tooltips_set_tip (__widget_tooltips, entry->widget,
57 + _(entry->tooltip), NULL);
58 ++#endif
59 +
60 + return entry->widget;
61 + }
62 +@@ -324,11 +332,17 @@
63 + (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
64 + (GtkAttachOptions) (GTK_FILL), 4, 4);
65 +
66 ++#if !GTK_CHECK_VERSION(2, 12, 0)
67 + if (!__widget_tooltips)
68 + __widget_tooltips = gtk_tooltips_new();
69 ++#endif
70 + if (entry->tooltip)
71 ++#if GTK_CHECK_VERSION(2, 12, 0)
72 ++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget), _(entry->tooltip));
73 ++#else
74 + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
75 + _(entry->tooltip), NULL);
76 ++#endif
77 +
78 + return GTK_WIDGET (entry->widget);
79 + }
80 +@@ -351,31 +365,53 @@
81 + (GtkAttachOptions) (GTK_FILL), 4, 4);
82 + gtk_widget_show (label);
83 +
84 ++#if GTK_CHECK_VERSION(2, 4, 0)
85 ++ entry->widget = gtk_combo_box_text_new_with_entry ();
86 ++ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
87 ++ gtk_bin_get_child (GTK_BIN (entry->widget)));
88 ++ gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (entry->widget))), FALSE);
89 ++#else
90 + entry->widget = gtk_combo_new ();
91 + gtk_label_set_mnemonic_widget (GTK_LABEL (label),
92 + GTK_COMBO (entry->widget)->entry);
93 + gtk_combo_set_value_in_list (GTK_COMBO (entry->widget), TRUE, FALSE);
94 + gtk_combo_set_case_sensitive (GTK_COMBO (entry->widget), TRUE);
95 +- gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (entry->widget)->entry),
96 ++ gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (entry->widget)->entry),
97 + FALSE);
98 ++#endif
99 + gtk_widget_show (GTK_WIDGET (entry->widget));
100 + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
101 + 1, 2, idx, idx + 1,
102 + (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
103 + (GtkAttachOptions) (GTK_FILL), 4, 4);
104 ++#if GTK_CHECK_VERSION(2, 4, 0)
105 ++ g_object_set_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (entry->widget))),
106 ++ DATA_POINTER_KEY,
107 ++ (gpointer) candidates_p);
108 ++ g_signal_connect ((gpointer) gtk_bin_get_child (GTK_BIN (entry->widget)), "changed",
109 ++ G_CALLBACK (on_default_combo_changed),
110 ++ entry);
111 ++#else
112 + g_object_set_data (G_OBJECT (GTK_COMBO (entry->widget)->entry),
113 + DATA_POINTER_KEY,
114 + (gpointer) candidates_p);
115 +-
116 + g_signal_connect ((gpointer) GTK_COMBO (entry->widget)->entry, "changed",
117 + G_CALLBACK (on_default_combo_changed),
118 + entry);
119 ++#endif
120 ++
121 +
122 ++#if !GTK_CHECK_VERSION(2, 12, 0)
123 + if (!__widget_tooltips)
124 + __widget_tooltips = gtk_tooltips_new();
125 ++#endif
126 + if (entry->tooltip)
127 ++#if GTK_CHECK_VERSION(2, 12, 0)
128 ++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget), _(entry->tooltip));
129 ++#else
130 + gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
131 + _(entry->tooltip), NULL);
132 ++#endif
133 +
134 + return GTK_WIDGET (entry->widget);
135 + }
136 +@@ -403,11 +439,17 @@
137 + {
138 + GtkWidget *vbox, *frame, *table, *check, *widget;
139 +
140 ++#if GTK_CHECK_VERSION(3, 0, 0)
141 ++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
142 ++#else
143 + vbox = gtk_vbox_new (FALSE, 0);
144 ++#endif
145 + gtk_widget_show (vbox);
146 +
147 ++#if !GTK_CHECK_VERSION(2, 12, 0)
148 + if (!__widget_tooltips)
149 + __widget_tooltips = gtk_tooltips_new();
150 ++#endif
151 +
152 + /* specify initialize file name */
153 + frame = gtk_frame_new ("");
154 +@@ -455,7 +497,11 @@
155 + {
156 + GtkWidget *vbox, *table;
157 +
158 ++#if GTK_CHECK_VERSION(3, 0, 0)
159 ++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
160 ++#else
161 + vbox = gtk_vbox_new (FALSE, 0);
162 ++#endif
163 + gtk_widget_show (vbox);
164 +
165 + table = gtk_table_new (2, 2, FALSE);
166 +@@ -480,7 +526,11 @@
167 + GtkWidget *vbox, *label;
168 + gchar str[256];
169 +
170 ++#if GTK_CHECK_VERSION(3, 0, 0)
171 ++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
172 ++#else
173 + vbox = gtk_vbox_new (FALSE, 0);
174 ++#endif
175 + gtk_widget_show (vbox);
176 +
177 + g_snprintf (
178 +@@ -547,8 +597,23 @@
179 + }
180 +
181 + static void
182 +-setup_combo_value (GtkCombo *combo, const String & str)
183 ++setup_combo_value (GtkWidget *combo, const String & str)
184 + {
185 ++#if GTK_CHECK_VERSION(2, 4, 0)
186 ++ ComboConfigCandidate *data
187 ++ = static_cast<ComboConfigCandidate*>
188 ++ (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (combo))),
189 ++ DATA_POINTER_KEY));
190 ++
191 ++ gint default_index = -1;
192 ++ for (unsigned int i = 0; data[i].label; i++) {
193 ++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(data[i].label));
194 ++ if (!strcmp (data[i].data, str.c_str ()))
195 ++ default_index = i;
196 ++ }
197 ++ if (default_index != -1)
198 ++ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), default_index);
199 ++#else
200 + GList *list = NULL;
201 + const char *defval = NULL;
202 +
203 +@@ -563,11 +628,12 @@
204 + defval = _(data[i].label);
205 + }
206 +
207 +- gtk_combo_set_popdown_strings (combo, list);
208 ++ gtk_combo_set_popdown_strings (GTK_COMBO (combo), list);
209 + g_list_free (list);
210 +
211 + if (defval)
212 +- gtk_entry_set_text (GTK_ENTRY (combo->entry), defval);
213 ++ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combo)->entry), defval);
214 ++#endif
215 + }
216 +
217 + static void
218 +@@ -582,8 +648,13 @@
219 +
220 + for (unsigned int i = 0; i < __config_string_common_num; i++) {
221 + StringConfigData &entry = __config_string_common[i];
222 ++#if GTK_CHECK_VERSION(2, 12, 0)
223 ++ if (entry.widget && GTK_IS_COMBO_BOX (entry.widget))
224 ++ setup_combo_value (entry.widget, entry.value);
225 ++#else
226 + if (entry.widget && GTK_IS_COMBO (entry.widget))
227 +- setup_combo_value (GTK_COMBO (entry.widget), entry.value);
228 ++ setup_combo_value (entry.widget, entry.value);
229 ++#endif
230 + else if (entry.widget && GTK_IS_ENTRY (entry.widget))
231 + gtk_entry_set_text (GTK_ENTRY (entry.widget),
232 + entry.value.c_str ());
233
234 diff --git a/app-i18n/scim-canna/metadata.xml b/app-i18n/scim-canna/metadata.xml
235 new file mode 100644
236 index 000000000..0433bcab3
237 --- /dev/null
238 +++ b/app-i18n/scim-canna/metadata.xml
239 @@ -0,0 +1,8 @@
240 +<?xml version="1.0" encoding="UTF-8"?>
241 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
242 +<pkgmetadata>
243 + <maintainer type="person">
244 + <name>Alessandro Barbieri</name>
245 + <email>lssndrbarbieri@×××××.com</email>
246 + </maintainer>
247 +</pkgmetadata>
248
249 diff --git a/app-i18n/scim-canna/scim-canna-1.0.1.ebuild b/app-i18n/scim-canna/scim-canna-1.0.1.ebuild
250 new file mode 100644
251 index 000000000..242827847
252 --- /dev/null
253 +++ b/app-i18n/scim-canna/scim-canna-1.0.1.ebuild
254 @@ -0,0 +1,54 @@
255 +# Copyright 1999-2022 Gentoo Authors
256 +# Distributed under the terms of the GNU General Public License v2
257 +
258 +EAPI=8
259 +
260 +inherit autotools
261 +
262 +DESCRIPTION="SCIM IMEngine module using Canna"
263 +HOMEPAGE="https://osdn.net/projects/scim-imengine"
264 +SRC_URI="https://free.nchc.org.tw/osdn//scim-imengine/29155/${P}.tar.gz"
265 +
266 +LICENSE="GPL-2+"
267 +SLOT="0"
268 +KEYWORDS="~amd64"
269 +IUSE="debug"
270 +
271 +RDEPEND="
272 + app-i18n/canna
273 + app-i18n/scim
274 + dev-libs/atk
275 + dev-libs/glib:2
276 + dev-libs/libltdl
277 + media-libs/fontconfig
278 + media-libs/freetype
279 + media-libs/harfbuzz:=
280 + x11-libs/cairo
281 + x11-libs/gdk-pixbuf:2
282 + x11-libs/gtk+:2
283 + x11-libs/libX11
284 + x11-libs/pango
285 +"
286 +DEPEND="${RDEPEND}"
287 +BDEPEND="virtual/pkgconfig"
288 +
289 +PATCHES=( "${FILESDIR}/${P}-fix_ftbfs_gtk3.patch" )
290 +
291 +src_prepare() {
292 + default
293 + eautoreconf
294 +}
295 +
296 +src_configure() {
297 + local myargs=(
298 + --disable-static
299 + --enable-shared
300 + $(use_enable debug)
301 + )
302 + econf "${myargs[@]}"
303 +}
304 +
305 +src_install() {
306 + default
307 + find "${ED}" -name '*.la' -delete || die
308 +}