diff --git a/SOURCES/gedit-plugins-disable-python3.patch b/SOURCES/gedit-plugins-disable-python3.patch index 86f2ca2..0bee806 100644 --- a/SOURCES/gedit-plugins-disable-python3.patch +++ b/SOURCES/gedit-plugins-disable-python3.patch @@ -279,3 +279,25 @@ self._sw.get_vscrollbar().get_style_context().add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) +--- a/plugins/multiedit/multiedit/signals.py ++++ b/plugins/multiedit/multiedit/signals.py +@@ -19,7 +19,7 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, + # Boston, MA 02110-1301, USA. + +-class Signals: ++class Signals(object): + def __init__(self): + self._signals = {} + +--- a/plugins/textsize/textsize/signals.py ++++ b/plugins/textsize/textsize/signals.py +@@ -19,7 +19,7 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, + # Boston, MA 02110-1301, USA. + +-class Signals: ++class Signals(object): + def __init__(self): + self._signals = {} + diff --git a/SOURCES/iter.get_char-returns-bytes-of-UTF-8-encoded-text.patch b/SOURCES/iter.get_char-returns-bytes-of-UTF-8-encoded-text.patch new file mode 100644 index 0000000..962f0d7 --- /dev/null +++ b/SOURCES/iter.get_char-returns-bytes-of-UTF-8-encoded-text.patch @@ -0,0 +1,91 @@ +From 8e1c0af770837ce9972b7024160d8880bfdc2c01 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= +Date: Sun, 15 Dec 2013 23:41:30 +0100 +Subject: [PATCH 1/2] iter.get_char() returns bytes of UTF-8 encoded text. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Make shell function which returns always one character long string, +either bytes() or unicode() (using py3k terminology). + +Fixes BGO# 720324 + +Signed-off-by: Matěj Cepl +--- + plugins/joinlines/joinlines.py | 31 ++++++++++++++++++++----------- + 1 file changed, 20 insertions(+), 11 deletions(-) + +--- a/plugins/joinlines/joinlines.py ++++ b/plugins/joinlines/joinlines.py +@@ -30,6 +30,13 @@ except: + _ = lambda s: s + + ++def iter_get_char(iter): ++ char = iter.get_char() ++ if len(char) > 1: ++ char = char.decode('utf8') ++ return char ++ ++ + class JoinLinesAppActivatable(GObject.Object, Gedit.AppActivatable): + app = GObject.property(type=Gedit.App) + +@@ -138,13 +145,13 @@ class JoinLinesViewActivatable(GObject.O + start.forward_to_line_end() + + # Include trailing spaces in the chunk to be removed +- while start.backward_char() and start.get_char() in ('\t', ' '): ++ while start.backward_char() and iter_get_char(start) in ('\t', ' '): + pass + start.forward_char() + + while doc.get_iter_at_mark(end_mark).compare(start) == 1: + end = start.copy() +- while end.get_char() in ('\r', '\n', ' ', '\t'): ++ while iter_get_char(end) in ('\r', '\n', ' ', '\t'): + end.forward_char() + doc.delete(start, end) + +@@ -173,7 +180,7 @@ class JoinLinesViewActivatable(GObject.O + indent_iter.set_line_offset(0) + indent = '' + while indent_iter.get_offset() != start.get_offset(): +- if indent_iter.get_char() == '\t': ++ if iter_get_char(indent_iter) == '\t': + indent = indent + '\t' + else: + indent = indent + ' ' +@@ -189,8 +196,8 @@ class JoinLinesViewActivatable(GObject.O + # measure indent of line + indent_iter = start.copy() + indent = '' +- while indent_iter.get_char() in (' ', '\t'): +- indent = indent + indent_iter.get_char() ++ while iter_get_char(indent_iter) in (' ', '\t'): ++ indent = indent + iter_get_char(indent_iter) + indent_iter.forward_char() + + end_mark = doc.create_mark(None, end) +@@ -231,16 +238,16 @@ class JoinLinesViewActivatable(GObject.O + + + def forward_to_word_start(text_iter): +- char = text_iter.get_char() ++ char = iter_get_char(text_iter) + while not text_iter.is_end() and char in (' ', '\t', '\n', '\r'): + text_iter.forward_char() +- char = text_iter.get_char() ++ char = iter_get_char(text_iter) + + + def forward_to_word_end(text_iter): +- char = text_iter.get_char() ++ char = iter_get_char(text_iter) + while not text_iter.is_end() and not (char in (' ', '\t', '\n', '\r')): + text_iter.forward_char() +- char = text_iter.get_char() ++ char = iter_get_char(text_iter) + + # ex:ts=4:et: diff --git a/SPECS/gedit-plugins.spec b/SPECS/gedit-plugins.spec index 5add7fa..fdab85e 100644 --- a/SPECS/gedit-plugins.spec +++ b/SPECS/gedit-plugins.spec @@ -12,7 +12,7 @@ Name: gedit-plugins Version: 3.14.1 -Release: 2%{?dist} +Release: 5%{?dist} Summary: Plugins for gedit Group: Applications/Editors @@ -21,6 +21,8 @@ URL: http://live.gnome.org/GeditPlugins Source0: http://download.gnome.org/sources/%{name}/3.14/%{name}-%{version}.tar.xz Patch0: gedit-plugins-disable-python3.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1239247 +Patch1: iter.get_char-returns-bytes-of-UTF-8-encoded-text.patch BuildRequires: gedit-devel BuildRequires: gnome-doc-utils BuildRequires: gucharmap-devel @@ -90,6 +92,7 @@ The gedit bookmarks plugin. %package -n gedit-plugin-bracketcompletion Summary: gedit bracketcompletion plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-bracketcompletion The gedit bracketcompletion plugin. @@ -97,30 +100,35 @@ The gedit bracketcompletion plugin. Summary: gedit charmap plugin Requires: %{name}-data = %{version}-%{release} Requires: gucharmap >= 2.33.2-6.fc15 +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-charmap The gedit charmap plugin. %package -n gedit-plugin-codecomment Summary: gedit codecomment plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-codecomment The gedit codecomment plugin. %package -n gedit-plugin-colorpicker Summary: gedit colorpicker plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-colorpicker The gedit colorpicker plugin. %package -n gedit-plugin-colorschemer Summary: gedit colorschemer plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-colorschemer The gedit colorschemer plugin. %package -n gedit-plugin-commander Summary: gedit commander plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-commander The gedit commander plugin. @@ -128,6 +136,7 @@ The gedit commander plugin. %package -n gedit-plugin-dashboard Summary: gedit dashboard plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-dashboard The gedit dashboard plugin. %endif @@ -141,24 +150,28 @@ The gedit drawspaces plugin. %package -n gedit-plugin-joinlines Summary: gedit joinlines plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-joinlines The gedit joinlines plugin. %package -n gedit-plugin-multiedit Summary: gedit multiedit plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-multiedit The gedit multiedit plugin. %package -n gedit-plugin-smartspaces Summary: gedit smartspaces plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-smartspaces The gedit smartspaces plugin. %package -n gedit-plugin-synctex Summary: gedit synctex plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-synctex The gedit synctex plugin. @@ -166,12 +179,14 @@ The gedit synctex plugin. Summary: gedit terminal plugin Requires: %{name}-data = %{version}-%{release} Requires: vte291 +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-terminal The gedit terminal plugin. %package -n gedit-plugin-textsize Summary: gedit textsize plugin Requires: %{name}-data = %{version}-%{release} +Requires: pygobject3 >= 3.14.0 %description -n gedit-plugin-textsize The gedit textsize plugin. @@ -196,6 +211,7 @@ The gedit zeitgeist plugin. %if !%{with_python3} %patch0 -p1 -b .disable-python3 %endif +%patch1 -p1 -b .iter-bytes %build aclocal @@ -345,6 +361,18 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : %endif %changelog +* Mon Aug 01 2016 Ray Strode - 3.14.1-5 +- Updated patch from Matej Cepl for python3→python2 + Resolves: #1360916 + +* Tue Apr 12 2016 Ray Strode - 3.14.1-4 +- Require pygobject3 3.14 + Resolves: #1293069 + +* Wed Apr 7 2016 Matthias Clasen 3.14.1-3 +- Fix a crash in text iter use + Resolves: #1239247 + * Thu Jun 25 2015 Ray Strode 3.14.1-2 - Updated python2 support patch from Matěj Cepl Related: #1230752