[packages/scim-canna] - new

qboosh qboosh at pld-linux.org
Fri Apr 8 22:19:17 CEST 2016


commit b1510773ae85b3969e35b100b735286a08ce911c
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Apr 8 22:19:07 2016 +0200

    - new

 scim-canna-gtk3.patch     | 213 ++++++++++++++++++++++++++++++++++++++++++++++
 scim-canna-no-rpath.patch |  18 ++++
 scim-canna.spec           |  73 ++++++++++++++++
 3 files changed, 304 insertions(+)
---
diff --git a/scim-canna.spec b/scim-canna.spec
new file mode 100644
index 0000000..91e8788
--- /dev/null
+++ b/scim-canna.spec
@@ -0,0 +1,73 @@
+Summary:	SCIM IMEngine module using Canna for Japanese input
+Summary(pl.UTF-8):	Silnik IM SCIM dla metody wprowadzania znaków japońskich Canna
+Name:		scim-canna
+Version:	1.0.1
+Release:	1
+License:	GPL v2+
+Group:		Libraries
+#Source0Download: https://osdn.jp/projects/scim-imengine/releases/p3528
+Source0:	http://dl.osdn.jp/scim-imengine/29155/%{name}-%{version}.tar.gz
+# Source0-md5:	41bf2796c95689df740be07922c74f67
+Patch0:		%{name}-no-rpath.patch
+Patch1:		%{name}-gtk3.patch
+URL:		https://osdn.jp/projects/scim-imengine/
+BuildRequires:	Canna-devel
+BuildRequires:	autoconf >= 2.59
+BuildRequires:	automake >= 1:1.9
+BuildRequires:	gettext-devel
+BuildRequires:	libstdc++-devel
+BuildRequires:	libtool >= 2:1.5
+BuildRequires:	pkgconfig
+BuildRequires:	scim-devel >= 1.0
+Requires:	Canna
+Requires:	scim >= 1.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+scim-canna is a SCIM IMEngine module using Canna.
+
+Canna is a traditional Japanese conversion engine on UNIX like system.
+It converts key events to Kana Kanji mixed text.
+
+%description -l pl.UTF-8
+scim-canna to moduł silnika IM SCIM wykorzystujący metodę Canna.
+
+Cana to tradycyjny silnik konwersji języka japońskiego na systemach
+uniksowych. Zamienia zdarzenia klawiszy na mieszany tekst Kana Kanji.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__gettextize}
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	--disable-static
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/scim-1.0/*/*/*.la
+
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog NEWS README
+%attr(755,root,root) %{_libdir}/scim-1.0/*/IMEngine/canna.so
+%attr(755,root,root) %{_libdir}/scim-1.0/*/SetupUI/canna-imengine-setup.so
+%{_datadir}/scim/icons/scim-canna.png
diff --git a/scim-canna-gtk3.patch b/scim-canna-gtk3.patch
new file mode 100644
index 0000000..401402c
--- /dev/null
+++ b/scim-canna-gtk3.patch
@@ -0,0 +1,213 @@
+--- scim-canna-1.0.1/src/scim_canna_imengine_setup.cpp.orig	2008-01-23 07:07:41.000000000 +0100
++++ scim-canna-1.0.1/src/scim_canna_imengine_setup.cpp	2016-04-08 21:51:48.620947805 +0200
+@@ -152,7 +152,10 @@
+ // Internal data declaration.
+ static bool __have_changed    = true;
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ static GtkTooltips * __widget_tooltips = 0;
++#endif
+ 
+ static BoolConfigData __config_bool_common [] =
+ {
+@@ -284,11 +287,19 @@
+                       entry);
+     gtk_widget_show (entry->widget);
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+     if (!__widget_tooltips)
+         __widget_tooltips = gtk_tooltips_new();
++#endif
+     if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++        gtk_widget_set_tooltip_text (entry->widget,
++                              _(entry->tooltip));
++#else
+         gtk_tooltips_set_tip (__widget_tooltips, entry->widget,
+                               _(entry->tooltip), NULL);
++#endif
+ 
+     return entry->widget;
+ }
+@@ -324,11 +335,19 @@
+                       (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+                       (GtkAttachOptions) (GTK_FILL), 4, 4);
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+     if (!__widget_tooltips)
+         __widget_tooltips = gtk_tooltips_new();
++#endif
+     if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++        gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget),
++                              _(entry->tooltip));
++#else
+         gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+                               _(entry->tooltip), NULL);
++#endif
+ 
+     return GTK_WIDGET (entry->widget);
+ }
+@@ -351,12 +370,31 @@
+                       (GtkAttachOptions) (GTK_FILL), 4, 4);
+     gtk_widget_show (label);
+ 
++#if GTK_CHECK_VERSION(2, 24, 0)
++    entry->widget = gtk_combo_box_text_new_with_entry ();
++    GtkWidget *combo_box_entry = gtk_bin_get_child (GTK_BIN (entry->widget));
++    gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box_entry);
++    gtk_editable_set_editable (GTK_EDITABLE (combo_box_entry), FALSE);
++
++    gtk_widget_show (GTK_WIDGET (entry->widget));
++    gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
++                      1, 2, idx, idx + 1,
++                      (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
++                      (GtkAttachOptions) (GTK_FILL), 4, 4);
++    g_object_set_data (G_OBJECT (combo_box_entry),
++                       DATA_POINTER_KEY,
++                       (gpointer) candidates_p);
++
++    g_signal_connect (G_OBJECT (combo_box_entry), "changed",
++                      G_CALLBACK (on_default_combo_changed),
++                      entry);
++#else
+     entry->widget = gtk_combo_new ();
+     gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+                                    GTK_COMBO (entry->widget)->entry);
+     gtk_combo_set_value_in_list (GTK_COMBO (entry->widget), TRUE, FALSE);
+     gtk_combo_set_case_sensitive (GTK_COMBO (entry->widget), TRUE);
+-    gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (entry->widget)->entry),
++    gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (entry->widget)->entry),
+                             FALSE);
+     gtk_widget_show (GTK_WIDGET (entry->widget));
+     gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
+@@ -370,12 +408,21 @@
+     g_signal_connect ((gpointer) GTK_COMBO (entry->widget)->entry, "changed",
+                       G_CALLBACK (on_default_combo_changed),
+                       entry);
++#endif
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+     if (!__widget_tooltips)
+         __widget_tooltips = gtk_tooltips_new();
++#endif
+     if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++        gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget),
++                              _(entry->tooltip));
++#else
+         gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+                               _(entry->tooltip), NULL);
++#endif
+ 
+     return GTK_WIDGET (entry->widget);
+ }
+@@ -403,11 +450,18 @@
+ {
+     GtkWidget *vbox, *frame, *table, *check, *widget;
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+     vbox = gtk_vbox_new (FALSE, 0);
++#endif
+     gtk_widget_show (vbox);
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+     if (!__widget_tooltips)
+         __widget_tooltips = gtk_tooltips_new();
++#endif
+ 
+     /* specify initialize file name */
+     frame = gtk_frame_new ("");
+@@ -455,7 +509,11 @@
+ {
+     GtkWidget *vbox, *table;
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+     vbox = gtk_vbox_new (FALSE, 0);
++#endif
+     gtk_widget_show (vbox);
+ 
+     table = gtk_table_new (2, 2, FALSE);
+@@ -480,7 +538,11 @@
+     GtkWidget *vbox, *label;
+     gchar str[256];
+ 
++#if GTK_CHECK_VERSION(3, 0, 0)
++    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+     vbox = gtk_vbox_new (FALSE, 0);
++#endif
+     gtk_widget_show (vbox);
+ 
+     g_snprintf (
+@@ -547,8 +609,24 @@
+ }
+ 
+ static void
+-setup_combo_value (GtkCombo *combo, const String & str)
++setup_combo_value (GtkWidget *combo, const String & str)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++    ComboConfigCandidate *data
++        = static_cast<ComboConfigCandidate*>
++        (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (combo))),
++                            DATA_POINTER_KEY));
++
++    gint default_index = -1;
++    for (unsigned int i = 0; data[i].label; i++) {
++        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(data[i].label));
++        if (!strcmp (data[i].data, str.c_str ()))
++            default_index = i;
++    }
++
++    if (default_index != -1)
++        gtk_combo_box_set_active (GTK_COMBO_BOX (combo), default_index);
++#else
+     GList *list = NULL;
+     const char *defval = NULL;
+ 
+@@ -563,11 +641,12 @@
+             defval = _(data[i].label);
+     }
+ 
+-    gtk_combo_set_popdown_strings (combo, list);
++    gtk_combo_set_popdown_strings (GTK_COMBO (combo), list);
+     g_list_free (list);
+ 
+     if (defval)
+-        gtk_entry_set_text (GTK_ENTRY (combo->entry), defval);
++        gtk_entry_set_text (GTK_ENTRY (GTK_COMBO(combo)->entry), defval);
++#endif
+ }
+ 
+ static void
+@@ -582,11 +661,19 @@
+ 
+     for (unsigned int i = 0; i < __config_string_common_num; i++) {
+         StringConfigData &entry = __config_string_common[i];
++#if GTK_CHECK_VERSION(2, 24, 0)
++        if (entry.widget && GTK_IS_COMBO_BOX (entry.widget))
++            setup_combo_value (GTK_WIDGET (entry.widget), entry.value);
++        else if (entry.widget && GTK_IS_ENTRY (entry.widget))
++            gtk_entry_set_text (GTK_ENTRY (entry.widget),
++                                entry.value.c_str ());
++#else
+         if (entry.widget && GTK_IS_COMBO (entry.widget))
+-            setup_combo_value (GTK_COMBO (entry.widget), entry.value);
++            setup_combo_value (GTK_WIDGET (entry.widget), entry.value);
+         else if (entry.widget && GTK_IS_ENTRY (entry.widget))
+             gtk_entry_set_text (GTK_ENTRY (entry.widget),
+                                 entry.value.c_str ());
++#endif
+     }
+ }
+ 
diff --git a/scim-canna-no-rpath.patch b/scim-canna-no-rpath.patch
new file mode 100644
index 0000000..3235033
--- /dev/null
+++ b/scim-canna-no-rpath.patch
@@ -0,0 +1,18 @@
+--- scim-canna-1.0.1/src/Makefile.am.orig	2006-02-07 03:28:46.000000000 +0100
++++ scim-canna-1.0.1/src/Makefile.am	2016-04-08 21:18:47.147697627 +0200
+@@ -26,7 +26,6 @@
+ 
+ canna_la_LDFLAGS = \
+ 	-avoid-version \
+-	-rpath $(moduledir) \
+ 	-module \
+ 	@LIBTOOL_EXPORT_OPTIONS@ \
+ 	@SCIM_LIBS@ \
+@@ -46,7 +45,6 @@
+ canna_imengine_setup_la_CXXFLAGS= @SCIM_GTKUTILS_CFLAGS@ @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@
+ 
+ canna_imengine_setup_la_LDFLAGS = -avoid-version \
+-                                   -rpath $(setupmoduledir) \
+                                    -module \
+                                    @LIBTOOL_EXPORT_OPTIONS@ \
+                                    @SCIM_GTKUTILS_LIBS@ \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/scim-canna.git/commitdiff/b1510773ae85b3969e35b100b735286a08ce911c



More information about the pld-cvs-commit mailing list