From 6560897a2aaa0fae24a9540e07184ee4727ae38f Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 10 Apr 2016 20:15:46 +0200 Subject: [PATCH] - new --- scim-skk-gtk3.patch | 432 ++++++++++++++++++++++++++++++++++++++++ scim-skk-no-rpath.patch | 28 +++ scim-skk.spec | 66 ++++++ 3 files changed, 526 insertions(+) create mode 100644 scim-skk-gtk3.patch create mode 100644 scim-skk-no-rpath.patch create mode 100644 scim-skk.spec diff --git a/scim-skk-gtk3.patch b/scim-skk-gtk3.patch new file mode 100644 index 0000000..de697fa --- /dev/null +++ b/scim-skk-gtk3.patch @@ -0,0 +1,432 @@ +--- scim-skk-0.5.2/src/scim_skk_setup_dictionaries.cpp.orig 2005-12-18 12:36:36.000000000 +0100 ++++ scim-skk-0.5.2/src/scim_skk_setup_dictionaries.cpp 2016-04-10 13:18:16.024989156 +0200 +@@ -170,7 +170,11 @@ + dict_entry_widgets_dictfile_setup (DictionaryConfigWidgets *widgets) + { + GtkWidget *label; ++#if GTK_CHECK_VERSION(3, 0, 0) ++ widgets->widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); ++#else + widgets->widget = gtk_hbox_new(FALSE, 0); ++#endif + label = gtk_label_new(widgets->title); + widgets->entry = gtk_entry_new(); + widgets->button = gtk_button_new_with_label ("..."); +@@ -195,8 +199,13 @@ + { + GtkWidget *hbox, *label; + ++#if GTK_CHECK_VERSION(3, 0, 0) ++ widgets->widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); ++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); ++#else + widgets->widget = gtk_vbox_new(FALSE, 0); + hbox = gtk_hbox_new(FALSE, 0); ++#endif + gtk_widget_hide(widgets->widget); + label = gtk_label_new(_("Server Name:")); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 4); +@@ -205,7 +214,11 @@ + TRUE, TRUE, 4); + gtk_box_pack_start(GTK_BOX(widgets->widget), hbox, + FALSE, FALSE, 4); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); ++#else + hbox = gtk_hbox_new(FALSE, 0); ++#endif + label = gtk_label_new(_("Port Number:")); + widgets->entry2 = gtk_entry_new(); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 4); +@@ -224,7 +237,11 @@ + GtkWidget *button; + + /* edit buttons */ ++#if GTK_CHECK_VERSION(3, 0, 0) ++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); ++#else + hbox = gtk_hbox_new(FALSE, 0); ++#endif + button = gtk_button_new_with_label(_("Add")); + gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 4); + g_signal_connect((gpointer) button, "clicked", +@@ -245,7 +262,11 @@ + { + GtkWidget *tree; + ++#if GTK_CHECK_VERSION(3, 0, 0) ++ __widget_sysdicts = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); ++#else + __widget_sysdicts = gtk_vbox_new(FALSE, 0); ++#endif + dict_list_setup(__config_sysdicts); + + /* setup container for dictionaries selection */ +@@ -257,10 +278,18 @@ + + { + GtkWidget *hbox, *vbox, *button; ++#if GTK_CHECK_VERSION(3, 0, 0) ++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); ++#else + hbox = gtk_hbox_new(FALSE, 0); ++#endif + gtk_widget_show(hbox); + gtk_box_pack_start(GTK_BOX(hbox), tree, TRUE, TRUE, 4); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); ++#else + vbox = gtk_vbox_new(FALSE, 0); ++#endif + button = gtk_button_new_from_stock(GTK_STOCK_GO_UP); + gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, FALSE, 4); + g_signal_connect((gpointer) button, "clicked", +@@ -301,6 +330,30 @@ + DictionaryConfigWidgets *data = static_cast (user_data); + + if (data) { ++#if GTK_CHECK_VERSION(3, 0, 0) ++ GtkWidget *dialog = gtk_file_chooser_dialog_new (_(data->title), ++ NULL, ++ GTK_FILE_CHOOSER_ACTION_OPEN, ++ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, ++ GTK_STOCK_OPEN, GTK_RESPONSE_OK, ++ NULL); ++ gint result; ++ ++ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER (dialog), gtk_entry_get_text(GTK_ENTRY(data->entry))); ++ ++ result = gtk_dialog_run (GTK_DIALOG (dialog)); ++ ++ if (result == GTK_RESPONSE_OK) { ++ const gchar *fname = ++ gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); ++ ++ if (!fname) fname = ""; ++ ++ gtk_entry_set_text (GTK_ENTRY (data->entry), fname); ++ } ++ ++ gtk_widget_destroy (dialog); ++#else + GtkWidget *dialog = gtk_file_selection_new (_(data->title)); + gint result; + +@@ -318,6 +371,7 @@ + } + + gtk_widget_destroy (dialog); ++#endif + } + } + +@@ -325,12 +379,20 @@ + dict_type_changed_cb (GtkComboBox *combo, + gpointer userdata) + { +- gchar *typetext = gtk_combo_box_get_active_text(combo); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ const gchar *typetext = gtk_entry_get_text(GTK_ENTRY (gtk_bin_get_child(GTK_BIN (combo)))); ++#else ++ const gchar *typetext = gtk_combo_box_get_active_text(combo); ++#endif + for (int i = 0; __dict_type_names[i] != ""; i++) { + if (__dict_type_names[i] == typetext) { + gtk_widget_show_all(__widgets_dicts[i].widget); + } else { ++#if GTK_CHECK_VERSION(3, 0, 0) ++ gtk_widget_hide(__widgets_dicts[i].widget); ++#else + gtk_widget_hide_all(__widgets_dicts[i].widget); ++#endif + } + } + gtk_entry_set_text(GTK_ENTRY(__widgets_dicts[0].entry), ""); +@@ -351,37 +413,68 @@ + gtk_window_set_title(GTK_WINDOW(dialog), + _("Add new dictionary")); + ++#if GTK_CHECK_VERSION(3, 0, 0) ++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); ++#else + hbox = gtk_hbox_new(FALSE, 0); ++#endif + gtk_widget_show(hbox); + label = gtk_label_new(_("Dictionary Type: ")); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 4); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ __combo_box_dict_types = gtk_combo_box_text_new(); ++ for (int i = 0; !__dict_type_names[i].empty(); i++) { ++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(__combo_box_dict_types), ++ __dict_type_names[i].data()); ++ } ++#else + __combo_box_dict_types = gtk_combo_box_new_text(); + for (int i = 0; !__dict_type_names[i].empty(); i++) { + gtk_combo_box_append_text(GTK_COMBO_BOX(__combo_box_dict_types), + __dict_type_names[i].data()); + } ++#endif + g_signal_connect((gpointer) __combo_box_dict_types, "changed", + G_CALLBACK(dict_type_changed_cb), + NULL); + gtk_widget_show(__combo_box_dict_types); + gtk_box_pack_start(GTK_BOX(hbox), __combo_box_dict_types, FALSE, TRUE, 4); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox, FALSE, FALSE, 4); ++#else + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 4); ++#endif + + /* dictionary file widgets */ + dict_entry_widgets_dictfile_setup(&(__widgets_dicts[0])); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), __widgets_dicts[0].widget, ++ TRUE, FALSE, 4); ++#else + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), __widgets_dicts[0].widget, + TRUE, FALSE, 4); ++#endif + + /* skkserv widgets */ + dict_entry_widgets_skkserv_setup(&__widgets_dicts[1]); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), __widgets_dicts[1].widget, ++ TRUE, FALSE, 4); ++#else + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), __widgets_dicts[1].widget, + TRUE, FALSE, 4); ++#endif + + /* dictionary file widgets */ + dict_entry_widgets_dictfile_setup(&__widgets_dicts[2]); ++#if GTK_CHECK_VERSION(3, 0, 0) ++ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), __widgets_dicts[2].widget, ++ TRUE, FALSE, 4); ++#else + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), __widgets_dicts[2].widget, + TRUE, FALSE, 4); ++#endif + + gtk_combo_box_set_active(GTK_COMBO_BOX(__combo_box_dict_types), 0); + +@@ -392,12 +485,18 @@ + _("Add"), + GTK_RESPONSE_OK); + gtk_widget_grab_default(ok_button); ++#if !GTK_CHECK_VERSION(3, 0, 0) + gtk_dialog_set_has_separator(GTK_DIALOG(dialog), TRUE); ++#endif + gtk_widget_show(dialog); + + result = gtk_dialog_run(GTK_DIALOG(dialog)); + if (result == GTK_RESPONSE_OK) { ++#if GTK_CHECK_VERSION(3, 0, 0) ++ String dict_type = gtk_entry_get_text(GTK_ENTRY (gtk_bin_get_child(GTK_BIN (GTK_COMBO_BOX(__combo_box_dict_types))))); ++#else + String dict_type = gtk_combo_box_get_active_text(GTK_COMBO_BOX(__combo_box_dict_types)); ++#endif + String dict_name; + GtkTreeIter iter; + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(userdata)); +--- scim-skk-0.5.2/src/scim_skk_imengine_setup.cpp.orig 2005-12-18 13:15:53.000000000 +0100 ++++ scim-skk-0.5.2/src/scim_skk_imengine_setup.cpp 2016-04-10 19:12:05.354098248 +0200 +@@ -31,6 +31,7 @@ + # include + #endif + ++#include + #include + + #include +@@ -178,7 +179,10 @@ + static GtkWidget * __widget_annot_highlight = 0; + static GtkWidget * __widget_ignore_return = 0; + static GtkWidget * __widget_selection_style = 0; ++#if GTK_CHECK_VERSION(3, 0, 0) ++#else + static GtkTooltips * __widget_tooltips = 0; ++#endif + + static KeyboardConfigData __config_keyboards_common [] = + { +@@ -483,10 +487,24 @@ + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4); + ++#if GTK_CHECK_VERSION(2, 24, 0) ++ *widget = gtk_combo_box_text_new_with_entry (); ++ GtkWidget *combo_box_entry = gtk_bin_get_child (GTK_BIN (*widget)); ++ gtk_editable_set_editable (GTK_EDITABLE (combo_box_entry), FALSE); ++ ++ gtk_widget_show (*widget); ++ gtk_box_pack_start (GTK_BOX (hbox), *widget, FALSE, FALSE, 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), ++ data_p); ++#else + *widget = gtk_combo_new (); + gtk_combo_set_value_in_list (GTK_COMBO (*widget), TRUE, FALSE); + gtk_combo_set_case_sensitive (GTK_COMBO (*widget), TRUE); +- gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (*widget)->entry), FALSE); ++ gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (*widget)->entry), FALSE); + gtk_widget_show (*widget); + gtk_box_pack_start (GTK_BOX (hbox), *widget, FALSE, FALSE, 4); + g_object_set_data (G_OBJECT (GTK_COMBO (*widget)->entry), DATA_POINTER_KEY, +@@ -495,6 +513,7 @@ + g_signal_connect ((gpointer) GTK_COMBO (*widget)->entry, "changed", + G_CALLBACK (on_default_combo_changed), + data_p); ++#endif + + return hbox; + } +@@ -527,11 +546,19 @@ + if (label) + gtk_label_set_mnemonic_widget(GTK_LABEL(label), 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 (GTK_WIDGET (entry->widget), ++ _(entry->tooltip)); ++#else + gtk_tooltips_set_tip(__widget_tooltips, entry->widget, + _(entry->tooltip), NULL); ++#endif + + return hbox; + } +@@ -719,7 +746,7 @@ + // Create keyboard setting. + for (unsigned int i = 0; data[i].key; ++ i) { + APPEND_ENTRY(_(data[i].label), data[i].entry, i); +- gtk_entry_set_editable (GTK_ENTRY (data[i].entry), FALSE); ++ gtk_editable_set_editable (GTK_EDITABLE (data[i].entry), FALSE); + + data[i].button = gtk_button_new_with_label ("..."); + gtk_widget_show (data[i].button); +@@ -738,11 +765,19 @@ + &(data[i].data)); + } + ++#if GTK_CHECK_VERSION(3, 0, 0) ++#else + if (!__widget_tooltips) + __widget_tooltips = gtk_tooltips_new(); ++#endif + for (unsigned int i = 0; data[i].key; ++ i) { ++#if GTK_CHECK_VERSION(3, 0, 0) ++ gtk_widget_set_tooltip_text (GTK_WIDGET (data[i].entry), ++ _(data[i].tooltip)); ++#else + gtk_tooltips_set_tip (__widget_tooltips, data[i].entry, + _(data[i].tooltip), NULL); ++#endif + } + + return table; +@@ -792,9 +827,20 @@ + } + + static void +-setup_combo_value (GtkCombo *combo, ++setup_combo_value (GtkWidget *combo, + ComboConfigData *data, const String & str) + { ++#if GTK_CHECK_VERSION(2, 24, 0) ++ 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; + +@@ -804,28 +850,29 @@ + 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 + setup_widget_value () + { + if (__widget_selection_style) { +- setup_combo_value (GTK_COMBO (__widget_selection_style), ++ setup_combo_value (GTK_WIDGET (__widget_selection_style), + selection_style, __config_selection_style); + } + + if (__widget_annot_pos) { +- setup_combo_value (GTK_COMBO (__widget_annot_pos), ++ setup_combo_value (GTK_WIDGET (__widget_annot_pos), + annot_position, __config_annot_pos); + } + + if (__widget_annot_target) { +- setup_combo_value (GTK_COMBO (__widget_annot_target), ++ setup_combo_value (GTK_WIDGET (__widget_annot_target), + annot_target, __config_annot_target); + } + +@@ -1057,6 +1104,30 @@ + FileConfigData *data = static_cast (user_data); + + if (data) { ++#if GTK_CHECK_VERSION(3, 0, 0) ++ GtkWidget *dialog = gtk_file_chooser_dialog_new (_(data->title), ++ NULL, ++ GTK_FILE_CHOOSER_ACTION_OPEN, ++ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, ++ GTK_STOCK_OPEN, GTK_RESPONSE_OK, ++ NULL); ++ gint result; ++ ++ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER (dialog), gtk_entry_get_text(GTK_ENTRY(data->entry))); ++ ++ result = gtk_dialog_run (GTK_DIALOG (dialog)); ++ ++ if (result == GTK_RESPONSE_OK) { ++ const gchar *fname = ++ gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); ++ ++ if (!fname) fname = ""; ++ ++ gtk_entry_set_text (GTK_ENTRY (data->entry), fname); ++ } ++ ++ gtk_widget_destroy (dialog); ++#else + GtkWidget *dialog = gtk_file_selection_new (_(data->title)); + gint result; + +@@ -1076,6 +1147,7 @@ + } + + gtk_widget_destroy (dialog); ++#endif + } + } + diff --git a/scim-skk-no-rpath.patch b/scim-skk-no-rpath.patch new file mode 100644 index 0000000..6d76de8 --- /dev/null +++ b/scim-skk-no-rpath.patch @@ -0,0 +1,28 @@ +--- scim-skk-0.5.2/configure.ac.orig 2005-12-21 07:04:54.000000000 +0100 ++++ scim-skk-0.5.2/configure.ac 2016-04-10 10:27:43.302085252 +0200 +@@ -79,6 +79,7 @@ + # libtool option to control which symbols are exported + # right now, symbols starting with _ are not exported + LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"' ++AC_SUBST([LIBTOOL_EXPORT_OPTIONS]) + + # Extra args. + AC_ARG_ENABLE(debug, +--- scim-skk-0.5.2/src/Makefile.am.orig 2005-12-16 12:32:12.000000000 +0100 ++++ scim-skk-0.5.2/src/Makefile.am 2016-04-10 10:28:05.655417648 +0200 +@@ -43,7 +43,6 @@ + skk_la_LDFLAGS = \ + -avoid-version \ + -module \ +- -rpath $(moduledir) \ + @SCIM_LIBS@ + + +@@ -64,7 +63,6 @@ + skk_imengine_setup_la_CXXFLAGS= @SCIM_GTKUTILS_CFLAGS@ @SCIM_CFLAGS@ @SCIM_DEBUG_FLAGS@ + + skk_imengine_setup_la_LDFLAGS = -avoid-version \ +- -rpath $(setupmoduledir) \ + -module \ + @LIBTOOL_EXPORT_OPTIONS@ \ + @SCIM_GTKUTILS_LIBS@ \ diff --git a/scim-skk.spec b/scim-skk.spec new file mode 100644 index 0000000..2641092 --- /dev/null +++ b/scim-skk.spec @@ -0,0 +1,66 @@ +Summary: SCIM IMEngine module for SKK input +Summary(pl.UTF-8): Silnik IM SCIM dla metody wprowadzania znaków SKK +Name: scim-skk +Version: 0.5.2 +Release: 1 +License: GPL v2+ +Group: Libraries +#Source0Download: https://osdn.jp/projects/scim-imengine/releases/p3205 +Source0: http://dl.osdn.jp/scim-imengine/18121/%{name}-%{version}.tar.gz +# Source0-md5: 69d789660439c248e507da63c90ad70a +Patch0: %{name}-no-rpath.patch +Patch1: %{name}-gtk3.patch +URL: https://osdn.jp/projects/scim-imengine/ +BuildRequires: autoconf >= 2.50 +BuildRequires: automake +BuildRequires: gettext-devel +BuildRequires: libstdc++-devel +BuildRequires: libtool >= 2:1.5 +BuildRequires: pkgconfig +BuildRequires: scim-devel >= 1.0 +Requires: scim >= 1.0 +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +SCIM IMEngine module for SKK input. + +%description -l pl.UTF-8 +Silnik IM SCIM dla metody wprowadzania znaków SKK. + +%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 TODO +%lang(ja) %doc README.ja +%attr(755,root,root) %{_libdir}/scim-1.0/*/IMEngine/skk.so +%attr(755,root,root) %{_libdir}/scim-1.0/*/SetupUI/skk-imengine-setup.so +%{_datadir}/scim/icons/scim-skk.png -- 2.44.0