[packages/scim-ccinput] - new - sh patch to kill bashism - gettext patch to fix issues with non-standard gettext usage - gtk

qboosh qboosh at pld-linux.org
Tue Nov 27 21:19:37 CET 2012


commit 97f3f63650a09e49609baa018af42e2e980e79c0
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Nov 27 21:19:49 2012 +0100

    - new
    - sh patch to kill bashism
    - gettext patch to fix issues with non-standard gettext usage
    - gtk3 patch to make setup module compatible with gtk+ 3.x

 scim-ccinput-gettext.patch |  41 +++++++++++
 scim-ccinput-gtk3.patch    | 174 +++++++++++++++++++++++++++++++++++++++++++++
 scim-ccinput-sh.patch      |  11 +++
 scim-ccinput.spec          |  71 ++++++++++++++++++
 4 files changed, 297 insertions(+)
---
diff --git a/scim-ccinput.spec b/scim-ccinput.spec
new file mode 100644
index 0000000..3e4baff
--- /dev/null
+++ b/scim-ccinput.spec
@@ -0,0 +1,71 @@
+Summary:	SCIM IMEngine module for CCInput method
+Summary(pl.UTF-8):	Moduł silnika IM platformy SCIM dla metody CCInput
+Name:		scim-ccinput
+Version:	0.3.1
+Release:	1
+License:	GPL v2+
+Group:		Libraries
+Source0:	http://downloads.sourceforge.net/scim/%{name}-%{version}.tar.bz2
+# Source0-md5:	8859f934d874852ec13e47d6e67ed144
+Patch0:		%{name}-sh.patch
+Patch1:		%{name}-gettext.patch
+Patch2:		%{name}-gtk3.patch
+URL:		http://www.scim-im.org/
+BuildRequires:	autoconf >= 2.59
+BuildRequires:	automake
+BuildRequires:	gettext-devel
+BuildRequires:	libstdc++-devel
+BuildRequires:	libtool >= 2:1.5
+BuildRequires:	pkgconfig
+BuildRequires:	scim-devel >= 1.2.0
+Requires:	scim >= 1.2.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+SCIM IMEngine module for CCInput method.
+
+%description -l pl.UTF-8
+Moduł silnika IM platformy SCIM dla metody CCInput.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__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 ccinput
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f ccinput.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog README
+%attr(755,root,root) %{_libdir}/scim-1.0/*/IMEngine/ccin.so
+%attr(755,root,root) %{_libdir}/scim-1.0/*/SetupUI/ccin-imengine-setup.so
+%{_datadir}/scim/ccinput
+%{_datadir}/scim/icons/ccinput.png
+%{_datadir}/scim/icons/sp_ls.png
+%{_datadir}/scim/icons/sp_ms.png
+%{_datadir}/scim/icons/sp_st.png
+%{_datadir}/scim/icons/sp_zg.png
+%{_datadir}/scim/icons/sp_zn.png
+%{_datadir}/scim/icons/sp_zr.png
diff --git a/scim-ccinput-gettext.patch b/scim-ccinput-gettext.patch
new file mode 100644
index 0000000..657012b
--- /dev/null
+++ b/scim-ccinput-gettext.patch
@@ -0,0 +1,41 @@
+--- scim-ccinput-0.3.1/scim/IMEngine/scim_ccin_imengine.cpp.orig	2005-06-09 18:36:30.000000000 +0200
++++ scim-ccinput-0.3.1/scim/IMEngine/scim_ccin_imengine.cpp	2012-11-25 21:23:39.931583598 +0100
+@@ -54,6 +54,7 @@
+ #endif
+ 
+ #include <scim.h>
++#include <libintl.h>
+ using namespace scim;
+ using namespace std;
+ 
+--- scim-ccinput-0.3.1/scim/IMEngine/Makefile.am.orig	2005-05-25 21:58:56.000000000 +0200
++++ scim-ccinput-0.3.1/scim/IMEngine/Makefile.am	2012-11-27 17:17:53.891622595 +0100
+@@ -36,8 +36,6 @@
+ ccin_la_LDFLAGS        = -avoid-version -no-undefined\
+                           -rpath $(moduledir) \
+                           -module\
+-                          @LIBTOOL_EXPORT_OPTIONS@ \
+-                          @INTLLIBS@ \
+                           @SCIM_LIBS@
+ 
+ ccin_la_LIBADD         = libgenerictable.la \
+--- scim-ccinput-0.3.1/scim/SetupUI/Makefile.am.orig	2005-05-25 22:43:32.000000000 +0200
++++ scim-ccinput-0.3.1/scim/SetupUI/Makefile.am	2012-11-27 17:18:19.671622058 +0100
+@@ -35,6 +35,4 @@
+ ccin_imengine_setup_la_LDFLAGS = -avoid-version \
+ 			     	-rpath $(setupmoduledir) \
+ 				-module \
+-				@LIBTOOL_EXPORT_OPTIONS@ \
+-				@INTLLIBS@ \
+ 				@SCIM_LIBS@
+--- scim-ccinput-0.3.1/scim/SetupUI/scim_ccin_imengine_setup.cpp.orig	2005-06-03 06:22:17.000000000 +0200
++++ scim-ccinput-0.3.1/scim/SetupUI/scim_ccin_imengine_setup.cpp	2012-11-27 17:27:00.781611196 +0100
+@@ -45,6 +45,8 @@
+ #define N_(String) (String)
+ 
+ #include <scim.h>
++#include <libintl.h>
++
+ using namespace scim;
+ using namespace std;
+ 
diff --git a/scim-ccinput-gtk3.patch b/scim-ccinput-gtk3.patch
new file mode 100644
index 0000000..6f47da7
--- /dev/null
+++ b/scim-ccinput-gtk3.patch
@@ -0,0 +1,174 @@
+--- scim-ccinput-0.3.1/scim/SetupUI/scim_ccin_imengine_setup.cpp.orig	2012-11-27 17:27:33.834943841 +0100
++++ scim-ccinput-0.3.1/scim/SetupUI/scim_ccin_imengine_setup.cpp	2012-11-27 19:57:51.871422545 +0100
+@@ -31,6 +31,7 @@
+ #include <gtk/scimkeyselection.h>
+ 
+ #include <stdio.h>
++#include <cstring>
+ #include <iostream>
+ 
+ #ifndef INPUT_METHOD_NAME 
+@@ -205,7 +206,7 @@ static GtkWidget * __widget_show_shuangp
+ 
+ static bool is_shuangpin = true;  
+ static bool is_not_shuangpin = false;  
+-static GtkTooltips * __widget_tooltips            = 0;
++//static GtkTooltip * __widget_tooltips            = 0;
+ 
+ 
+ // Declaration of internal functions.
+@@ -426,7 +427,7 @@ load_config (const ConfigPointer &config
+ 		}else if (!strcmp (str.c_str(), "liu")){
+ 			__config_Shuangpin_Kind = _("liu");
+ 		}
+-		gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (__widget_combo)->entry), (const char*)(__config_Shuangpin_Kind.c_str()) );
++		gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child(GTK_BIN(__widget_combo))), (const char*)(__config_Shuangpin_Kind.c_str()) );
+ 
+         __have_changed = false;
+     }
+@@ -461,8 +462,8 @@ save_config (const ConfigPointer &config
+                           __config_Fuzzy_R_L);
+         config->write (String (SCIM_CONFIG_IMENGINE_CCIN_SHUANGPIN_KEY),
+                           __config_shuangpin);
+-//        __config_Shuangpin_Kind = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (__widget_combo)->entry));
+-		String str	= gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (__widget_combo)->entry));
++//        __config_Shuangpin_Kind = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(__widget_combo));
++		String str	= gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(__widget_combo));
+ 		if (!strcmp (str.c_str(), _("chinesestar"))){
+ 			__config_Shuangpin_Kind = "chinesestar";
+ 		}else if (!strcmp (str.c_str(), _("nature"))){
+@@ -585,7 +586,7 @@ show_shuangpin_code(){
+ 
+ 	gtk_widget_show (__widget_show_shuangpin);
+ 
+-	String str	= gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (__widget_combo)->entry));
++	String str	= gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(__widget_combo));
+ 	if (!strcmp (str.c_str(), _("chinesestar"))){
+ 		str = "sp_st.png";
+ 		pinyin_setup_str = _("chinesestar");
+@@ -612,7 +613,7 @@ show_shuangpin_code(){
+ 	frame = gtk_frame_new (pinyin_setup_str.c_str());
+     gtk_widget_show (frame);
+     gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
+-    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (__widget_show_shuangpin)->vbox),
++    gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(__widget_show_shuangpin))),
+                         frame, TRUE, TRUE, 0);
+ 
+     vbox = gtk_vbox_new (FALSE, 0);
+@@ -624,15 +625,15 @@ show_shuangpin_code(){
+     gtk_box_pack_start (GTK_BOX (vbox), image, TRUE, TRUE, 0);
+     gtk_widget_show (image);    
+ 
+-    g_signal_connect_swapped (GTK_OBJECT (__widget_show_shuangpin), 
++    g_signal_connect_swapped (G_OBJECT (__widget_show_shuangpin), 
+                                   "response", 
+                                   G_CALLBACK (gtk_widget_hide),
+-                                  GTK_OBJECT (__widget_show_shuangpin));
++                                  G_OBJECT (__widget_show_shuangpin));
+ 
+-    g_signal_connect_swapped (GTK_OBJECT (__widget_show_shuangpin), 
++    g_signal_connect_swapped (G_OBJECT (__widget_show_shuangpin), 
+                                   "delete_event", 
+                                   G_CALLBACK (gtk_widget_hide_on_delete),
+-                                  GTK_OBJECT (__widget_show_shuangpin));
++                                  G_OBJECT (__widget_show_shuangpin));
+ 
+ 	gtk_widget_show (__widget_show_shuangpin);
+ 
+@@ -643,10 +644,10 @@ show_shuangpin_code(){
+ }
+ 
+ static void
+-on_combo_activate (GtkCombo *combo,
++on_combo_activate (GtkComboBox *combo,
+                    gpointer         user_data)
+ {
+-//	__config_Shuangpin_Kind = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (__widget_combo)->entry));
++//	__config_Shuangpin_Kind = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(__widget_combo));
+ //    __have_changed = true;
+ }
+ 
+@@ -664,8 +665,6 @@ create_setup_fuzzy_window(GtkWidget *not
+     GtkWidget *label;
+     int i;
+ 
+-    __widget_tooltips = gtk_tooltips_new ();
+-
+     hbox = gtk_hbox_new (FALSE, 8);
+     gtk_widget_show (hbox);
+     gtk_container_add (GTK_CONTAINER (notebook), hbox);
+@@ -815,25 +814,25 @@ create_setup_fuzzy_window(GtkWidget *not
+                           &__config_Fuzzy_R_L);
+ 
+     // Set all tooltips.
+-    gtk_tooltips_set_tip (__widget_tooltips, __widget_show_prompt,
++    gtk_widget_set_tooltip_text (__widget_show_prompt,
+                               _("If this option is checked, "
+                                 "the key prompt of the currently selected phrase "
+-                                "will be shown."), NULL);
++                                "will be shown."));
+ 
+-    gtk_tooltips_set_tip (__widget_tooltips, __widget_show_key_hint,
++    gtk_widget_set_tooltip_text (__widget_show_key_hint,
+                               _("If this option is checked, "
+                                 "the remaining keystrokes of the phrases"
+-                                "will be shown on the lookup table."), NULL);
++                                "will be shown on the lookup table."));
+ 
+-    gtk_tooltips_set_tip (__widget_tooltips, __widget_user_table_binary,
++    gtk_widget_set_tooltip_text (__widget_user_table_binary,
+                               _("If this option is checked, "
+                                 "the user table will be stored with binary format, "
+-                                "this will increase the loading speed."), NULL);
++                                "this will increase the loading speed."));
+ 
+-    gtk_tooltips_set_tip (__widget_tooltips, __widget_long_phrase_first,
++    gtk_widget_set_tooltip_text (__widget_long_phrase_first,
+                               _("If this option is checked, "
+                                 "the longer phrase will be shown "
+-                                "in front of others. "), NULL);
++                                "in front of others. "));
+ 
+ 
+ }
+@@ -886,16 +885,15 @@ create_setup_sp_window(GtkWidget *notebo
+     gtk_widget_show (hbox);
+     gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ 
+-	__widget_combo = gtk_combo_new ();
++	__widget_combo = gtk_combo_box_text_new_with_entry ();
+ 	gtk_widget_show (__widget_combo);
+ 	GList *glist = NULL;
+-	glist = g_list_append (glist, _("chinesestar"));
+-    glist = g_list_append (glist, _("nature"));
+-    glist = g_list_append (glist, _("microsoft")); 
+-    glist = g_list_append (glist, _("ziguang")); 
+-    glist = g_list_append (glist, _("abc"));
+-    glist = g_list_append (glist, _("liu"));
+-    gtk_combo_set_popdown_strings (GTK_COMBO (__widget_combo), glist);
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_combo), _("chinesestar"));
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_combo), _("nature"));
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_combo), _("microsoft")); 
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_combo), _("ziguang")); 
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_combo), _("abc"));
++    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__widget_combo), _("liu"));
+     gtk_container_add (GTK_CONTAINER (hbox), __widget_combo);
+ 
+ 	__widget_shuangpin_code_command = gtk_button_new_with_label (_("Show ..."));
+@@ -914,7 +912,7 @@ create_setup_sp_window(GtkWidget *notebo
+ 	}
+ 
+ // Connect all signals.
+-	g_signal_connect (G_OBJECT (GTK_COMBO (__widget_combo)), "activate",
++	g_signal_connect (G_OBJECT (GTK_COMBO_BOX (__widget_combo)), "activate",
+     	                  G_CALLBACK (on_combo_activate), NULL);
+ 	
+     g_signal_connect ((gpointer) __widget_quanpin_setup, "toggled",
+--- scim-ccinput-0.3.1/scim/SetupUI/Makefile.am.orig	2012-11-27 17:27:33.831610508 +0100
++++ scim-ccinput-0.3.1/scim/SetupUI/Makefile.am	2012-11-27 20:20:40.828060677 +0100
+@@ -35,4 +35,4 @@
+ ccin_imengine_setup_la_LDFLAGS = -avoid-version \
+ 			     	-rpath $(setupmoduledir) \
+ 				-module \
+-				@SCIM_LIBS@
++				@SCIM_GTKUTILS_LIBS@
diff --git a/scim-ccinput-sh.patch b/scim-ccinput-sh.patch
new file mode 100644
index 0000000..2dcd38f
--- /dev/null
+++ b/scim-ccinput-sh.patch
@@ -0,0 +1,11 @@
+--- scim-ccinput-0.3.1/configure.ac.orig	2005-06-02 02:22:49.000000000 +0200
++++ scim-ccinput-0.3.1/configure.ac	2012-11-25 19:14:13.051745486 +0100
+@@ -134,7 +134,7 @@
+ 
+ install_scim_version=`$PKG_CONFIG --modversion scim`
+ 
+-if [test "x${install_scim_version:0:3}" = "x1.2"]; then
++if echo "x${install_scim_version}" | grep -q '^x1\.2' ; then
+   AC_DEFINE(SCIM_1_2_API,1,[Whether the current scim is 1.2.x])
+ else
+   AC_DEFINE(SCIM_1_2_API,0)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/scim-ccinput.git/commitdiff/97f3f63650a09e49609baa018af42e2e980e79c0



More information about the pld-cvs-commit mailing list