diff --git a/.gedit.metadata b/.gedit.metadata index c41cbf7..1ea1c46 100644 --- a/.gedit.metadata +++ b/.gedit.metadata @@ -1 +1 @@ -cc4cd6e7cd7919abb38bbf45b61597a2904a1c2f SOURCES/gedit-3.8.3.tar.xz +ba483e435ceae91c31f759413298d3ebe1350b0e SOURCES/gedit-3.14.3.tar.xz diff --git a/.gitignore b/.gitignore index 0ed5eaf..694a7db 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/gedit-3.8.3.tar.xz +SOURCES/gedit-3.14.3.tar.xz diff --git a/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch b/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch new file mode 100644 index 0000000..b4e64ed --- /dev/null +++ b/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch @@ -0,0 +1,97 @@ +From e0155f834f494fc3de374920589cba8b93ead96a Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Mon, 21 Sep 2015 16:21:45 -0400 +Subject: [PATCH] po: es: use single quote instead of chevrons + +Fixes weird debug spew +--- + po/es.po | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/po/es.po b/po/es.po +index 6c90959..a83af90 100644 +--- a/po/es.po ++++ b/po/es.po +@@ -444,78 +444,78 @@ msgstr "" + msgid "Print Line Numbers" + msgstr "Imprimir números de línea" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:63 + msgid "" + "If this value is 0, then no line numbers will be inserted when printing a " + "document. Otherwise, gedit will print line numbers every such number of " + "lines." + msgstr "" + "Si este valor es cero entonces no se colocan números de líneas al imprimir " + "el documento. En otro caso, gedit imprime los números de línea cada dicha " + "cantidad de líneas." + + #: ../data/org.gnome.gedit.gschema.xml.in.h:64 + msgid "'Monospace 9'" + msgstr "«Monospace 9»" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:65 + msgid "Body Font for Printing" + msgstr "Tipografía para impresión del cuerpo" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:66 + msgid "" + "Specifies the font to use for a document's body when printing documents." + msgstr "" + "Especifica la tipografía que utilizar para el cuerpo del documento cuando se " + "imprimen archivos." + + #: ../data/org.gnome.gedit.gschema.xml.in.h:67 + msgid "'Sans 11'" +-msgstr "«Sans 11»" ++msgstr "'Sans 11'" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:68 + msgid "Header Font for Printing" + msgstr "Tipografía para impresión de la cabecera" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:69 + msgid "" + "Specifies the font to use for page headers when printing a document. This " + "will only take effect if the \"Print Header\" option is turned on." + msgstr "" + "Especifica la tipografía que utilizar para la cabecera de las páginas cuando " + "se imprime un documento. Esto sólo tiene efecto cuando la opción «Imprimir " + "cabecera» se encuentre activada." + + #: ../data/org.gnome.gedit.gschema.xml.in.h:70 + msgid "'Sans 8'" +-msgstr "«Sans 8»" ++msgstr "'Sans 8'" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:71 + msgid "Line Number Font for Printing" + msgstr "Tipografía para impresión de los números de línea" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:72 + msgid "" + "Specifies the font to use for line numbers when printing. This will only " + "take effect if the \"Print Line Numbers\" option is non-zero." + msgstr "" + "Especifica la tipografía que utilizar para los números de línea cuando se " + "imprimen. Esto sólo tiene efecto si la opción «Imprimir números de línea» es " + "distinta de cero." + + #. Translators: This is the sorted list of encodings used by gedit + #. for automatic detection of the file encoding. You may want to customize it adding + #. encodings that are common in your country, for instance the GB18030 encoding + #. for the Chinese translation. You may also want to remove the ISO-8859-15 encoding + #. (covering English and most Western European languages) if you think people + #. in your country will rarely use it. + #. "CURRENT" is a magic value used by gedit and it represents the encoding + #. for the current locale, so please don't translate the "CURRENT" term. + #. Only recognized encodings are used. + #. See http://git.gnome.org/browse/gedit/tree/gedit/gedit-encodings.c#n152 for + #. a list of supported encodings + #: ../data/org.gnome.gedit.gschema.xml.in.h:84 + msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" + msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:85 +-- +2.5.0 diff --git a/SOURCES/gedit-disable-python3.patch b/SOURCES/gedit-disable-python3.patch index ed02dab..d526e56 100644 --- a/SOURCES/gedit-disable-python3.patch +++ b/SOURCES/gedit-disable-python3.patch @@ -1,7 +1,54 @@ -diff -up gedit-3.8.3/configure.ac.disable-python gedit-3.8.3/configure.ac ---- gedit-3.8.3/configure.ac.disable-python 2013-07-17 20:41:04.210713683 -0400 -+++ gedit-3.8.3/configure.ac 2013-07-17 20:41:36.763967930 -0400 -@@ -306,7 +306,7 @@ if test "x$enable_python" = "xauto"; the +From 1cb46d3837804d69c2b2e12317d3c5a7e60a819a Mon Sep 17 00:00:00 2001 +From: Matěj Cepl +Date: Fri, 15 May 2015 11:00:19 -0400 +Subject: [PATCH] Switch from python3 to python2 + +--- + configure.ac | 2 +- + gedit/gedit-plugins-engine.c | 2 +- + plugins/externaltools/data/send-to-fpaste.tool.in | 2 +- + plugins/externaltools/externaltools.plugin.desktop.in | 2 +- + plugins/externaltools/tools/library.py | 15 ++++++++------- + plugins/pythonconsole/pythonconsole.plugin.desktop.in | 2 +- + plugins/quickopen/quickopen.plugin.desktop.in | 2 +- + plugins/snippets/snippets.plugin.desktop.in | 2 +- + plugins/snippets/snippets/library.py | 3 ++- + plugins/snippets/snippets/shareddata.py | 3 ++- + plugins/snippets/snippets/signals.py | 2 +- + 11 files changed, 20 insertions(+), 17 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cf3d734..3acee28 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -276,61 +276,61 @@ if test "x$enable_enchant" = "xyes" ; then + have_iso_codes=no + fi + AC_MSG_RESULT([$result]) + fi + + if test "x$have_iso_codes" = "xyes"; then + AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix]) + AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package]) + else + AC_MSG_ERROR([iso-codes is required to build the spell plugin. Use --disable-spell to build without spell plugin.]) + fi + else + enable_enchant=no + AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.]) + fi + fi + + AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes") + + AC_ARG_ENABLE([python], + AS_HELP_STRING([--enable-python[=@<:@no/auto/yes@:>@]],[Build with python support]), + [enable_python=$enableval], + [enable_python="auto"]) + + if test "x$enable_python" = "xauto"; then + PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED], + [enable_python=yes],[enable_python=no]) fi if test "x$enable_python" = "xyes"; then @@ -9,86 +56,696 @@ diff -up gedit-3.8.3/configure.ac.disable-python gedit-3.8.3/configure.ac + AM_PATH_PYTHON PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED]) - pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"` -diff -up gedit-3.8.3/gedit/gedit-plugins-engine.c.disable-python gedit-3.8.3/gedit/gedit-plugins-engine.c ---- gedit-3.8.3/gedit/gedit-plugins-engine.c.disable-python 2013-03-12 02:35:32.000000000 -0400 -+++ gedit-3.8.3/gedit/gedit-plugins-engine.c 2013-07-17 20:41:04.210713683 -0400 -@@ -66,7 +66,7 @@ gedit_plugins_engine_init (GeditPluginsE - GEDIT_TYPE_PLUGINS_ENGINE, - GeditPluginsEnginePrivate); + pyoverridesdir="\$(pyexecdir)/gi/overrides" + AC_SUBST(pyoverridesdir) + fi + + AM_CONDITIONAL(ENABLE_PYTHON, test x"$enable_python" = "xyes") + + dnl ================================================================ + dnl Start of pkg-config checks + dnl ================================================================ + + # Dependencies + + PKG_CHECK_MODULES(GEDIT, [ + libxml-2.0 >= $LIBXML_REQUIRED + glib-2.0 >= $GLIB_REQUIRED + gio-2.0 >= $GLIB_REQUIRED + gmodule-2.0 + gtk+-3.0 >= $GTK_REQUIRED + gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED + libpeas-1.0 >= $LIBPEAS_REQUIRED + libpeas-gtk-1.0 >= $LIBPEAS_REQUIRED + gsettings-desktop-schemas + ]) + + if test "$os_osx" = "no" && + test "$os_win32" = "no"; then + PKG_CHECK_MODULES(X11, [ + x11 +diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c +index 725cb3b..678809b 100644 +--- a/gedit/gedit-plugins-engine.c ++++ b/gedit/gedit-plugins-engine.c +@@ -28,61 +28,61 @@ + #include + + #include + #include + + #include "gedit-debug.h" + #include "gedit-app.h" + #include "gedit-dirs.h" + #include "gedit-settings.h" + #include "gedit-utils.h" + + struct _GeditPluginsEnginePrivate + { + GSettings *plugin_settings; + }; + + G_DEFINE_TYPE_WITH_PRIVATE (GeditPluginsEngine, gedit_plugins_engine, PEAS_TYPE_ENGINE) + + GeditPluginsEngine *default_engine = NULL; + + static void + gedit_plugins_engine_init (GeditPluginsEngine *engine) + { + gchar *typelib_dir; + GError *error = NULL; + + gedit_debug (DEBUG_PLUGINS); + + engine->priv = gedit_plugins_engine_get_instance_private (engine); - peas_engine_enable_loader (PEAS_ENGINE (engine), "python3"); + peas_engine_enable_loader (PEAS_ENGINE (engine), "python"); engine->priv->plugin_settings = g_settings_new ("org.gnome.gedit.plugins"); + /* Require gedit's typelib. */ + typelib_dir = g_build_filename (gedit_dirs_get_gedit_lib_dir (), + "girepository-1.0", + NULL); + + if (!g_irepository_require_private (g_irepository_get_default (), + typelib_dir, "Gedit", "3.0", 0, &error)) + { + g_warning ("Could not load Gedit repository: %s", error->message); + g_error_free (error); + error = NULL; + } + + g_free (typelib_dir); + + /* This should be moved to libpeas */ + if (!g_irepository_require (g_irepository_get_default (), + "Peas", "1.0", 0, &error)) + { + g_warning ("Could not load Peas repository: %s", error->message); + g_error_free (error); + error = NULL; + } + + if (!g_irepository_require (g_irepository_get_default (), + "PeasGtk", "1.0", 0, &error)) + { +diff --git a/plugins/externaltools/data/send-to-fpaste.tool.in b/plugins/externaltools/data/send-to-fpaste.tool.in +index d255007..95c2d37 100755 +--- a/plugins/externaltools/data/send-to-fpaste.tool.in ++++ b/plugins/externaltools/data/send-to-fpaste.tool.in +@@ -1,27 +1,27 @@ +-#!/usr/bin/env python3 ++#!/usr/bin/env python + + import os, urllib, json, sys, urllib.request + from gi.repository import Gtk, Gdk + + lang = os.getenv('GEDIT_CURRRENT_DOCUMENT_LANGUAGE') + if lang is None: + lang = "text" + + current_document_path = os.getenv('GEDIT_CURRENT_DOCUMENT_PATH') + selected_text = os.getenv('GEDIT_SELECTED_TEXT') + + if selected_text is None: + selected_text = sys.stdin.read() + + url_params = urllib.parse.urlencode({'paste_data': selected_text, 'paste_lang': lang, 'mode':'json', 'api_submit':'true'}) + openfpaste = urllib.request.urlopen("http://fpaste.org", bytes(url_params, 'utf-8')).read().decode("utf-8") + final_data = json.loads(openfpaste) + + paste_url = "http://fpaste.org/" + final_data['result']['id'] + + print(paste_url + " has been copied to clipboard.") + + disp = Gdk.Display.get_default() + clipper = Gtk.Clipboard.get_for_display(disp, Gdk.SELECTION_CLIPBOARD) + clipper.set_text(paste_url, len(paste_url)) + clipper.store() +diff --git a/plugins/externaltools/externaltools.plugin.desktop.in b/plugins/externaltools/externaltools.plugin.desktop.in +index cc7a4da..c56e4e3 100644 --- a/plugins/externaltools/externaltools.plugin.desktop.in +++ b/plugins/externaltools/externaltools.plugin.desktop.in -@@ -1,5 +1,5 @@ +@@ -1,9 +1,9 @@ [Plugin] -Loader=python3 +Loader=python Module=externaltools IAge=3 _Name=External Tools + _Description=Execute external commands and shell scripts. + Authors=Steve Frécinaux + Copyright=Copyright © 2005 Steve Frécinaux + Website=http://www.gedit.org +diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py +index adfd943..4d4bce0 100644 +--- a/plugins/externaltools/tools/library.py ++++ b/plugins/externaltools/tools/library.py +@@ -1,48 +1,49 @@ + # -*- coding: utf-8 -*- + # Gedit External Tools plugin + # Copyright (C) 2006 Steve Frécinaux + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + ++import io + import os + import re + import locale + import platform + from gi.repository import GLib + + + class Singleton(object): + _instance = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs) + cls._instance.__init_once__() + + return cls._instance + + + class ToolLibrary(Singleton): + def __init_once__(self): + self.locations = [] + + def set_locations(self, datadir): + self.locations = [] + + if platform.platform() != 'Windows': + for d in self.get_xdg_data_dirs(): + self.locations.append(os.path.join(d, 'gedit', 'plugins', 'externaltools', 'tools')) + + self.locations.append(datadir) +@@ -219,61 +220,61 @@ class Tool(object): + self.changed = False + self._properties = dict() + self._transform = { + 'Languages': [self._to_list, self._from_list] + } + self._load() + + def _to_list(self, value): + if value.strip() == '': + return [] + else: + return [x.strip() for x in value.split(',')] + + def _from_list(self, value): + return ','.join(value) + + def _parse_value(self, key, value): + if key in self._transform: + return self._transform[key][0](value) + else: + return value + + def _load(self): + if self.filename is None: + return + + filename = self.library.get_full_path(self.get_path()) + if filename is None: + return + +- fp = open(filename, 'r', 1, encoding='utf-8') ++ fp = io.open(filename, 'r', 1, encoding='utf-8') + in_block = False + lang = locale.getlocale(locale.LC_MESSAGES)[0] + + for line in fp: + if not in_block: + in_block = line.startswith('# [Gedit Tool]') + continue + if line.startswith('##') or line.startswith('# #'): + continue + if not line.startswith('# '): + break + + try: + (key, value) = [i.strip() for i in line[2:].split('=', 1)] + m = self.RE_KEY.match(key) + if m.group(3) is None: + self._properties[m.group(1)] = self._parse_value(m.group(1), value) + elif lang is not None and lang.startswith(m.group(3)): + self._properties[m.group(1)] = self._parse_value(m.group(1), value) + except ValueError: + break + fp.close() + self.changed = False + + def _set_property_if_changed(self, key, value): + if value != self._properties.get(key): + self._properties[key] = value + + self.changed = True + +@@ -368,141 +369,141 @@ class Tool(object): + def get_save_files(self): + save_files = self._properties.get('Save-files') + if save_files: + return save_files + return 'nothing' + + def set_save_files(self, value): + self._set_property_if_changed('Save-files', value) + + save_files = property(get_save_files, set_save_files) + + def get_languages(self): + languages = self._properties.get('Languages') + if languages: + return languages + return [] + + def set_languages(self, value): + self._set_property_if_changed('Languages', value) + + languages = property(get_languages, set_languages) + + def has_hash_bang(self): + if self.filename is None: + return True + + filename = self.library.get_full_path(self.get_path()) + if filename is None: + return True + +- fp = open(filename, 'r', 1, encoding='utf-8') ++ fp = io.open(filename, 'r', 1, encoding='utf-8') + for line in fp: + if line.strip() == '': + continue + return line.startswith('#!') + + # There is no property for this one because this function is quite + # expensive to perform + def get_script(self): + if self.filename is None: + return ["#!/bin/sh\n"] + + filename = self.library.get_full_path(self.get_path()) + if filename is None: + return ["#!/bin/sh\n"] + +- fp = open(filename, 'r', 1, encoding='utf-8') ++ fp = io.open(filename, 'r', 1, encoding='utf-8') + lines = list() + + # before entering the data block + for line in fp: + if line.startswith('# [Gedit Tool]'): + break + lines.append(line) + # in the block: + for line in fp: + if line.startswith('##'): + continue + if not (line.startswith('# ') and '=' in line): + # after the block: strip one emtpy line (if present) + if line.strip() != '': + lines.append(line) + break + # after the block + for line in fp: + lines.append(line) + fp.close() + return lines + + def _dump_properties(self): + lines = ['# [Gedit Tool]'] + for item in self._properties.items(): + if item[0] in self._transform: + lines.append('# %s=%s' % (item[0], self._transform[item[0]][1](item[1]))) + elif item[1] is not None: + lines.append('# %s=%s' % item) + return '\n'.join(lines) + '\n' + + def save_with_script(self, script): + filename = self.library.get_full_path(self.filename, 'w') +- fp = open(filename, 'w', 1, encoding='utf-8') ++ fp = io.open(filename, 'w', 1, encoding='utf-8') + + # Make sure to first print header (shebang, modeline), then + # properties, and then actual content + header = [] + content = [] + inheader = True + + # Parse + for line in script: + line = line.rstrip("\n") + if not inheader: + content.append(line) + elif line.startswith('#!'): + # Shebang (should be always present) + header.append(line) + elif line.strip().startswith('#') and ('-*-' in line or 'ex:' in line or 'vi:' in line or 'vim:' in line): + header.append(line) + else: + content.append(line) + inheader = False + + # Write out header + for line in header: + fp.write(line + "\n") + +- fp.write(self._dump_properties()) +- fp.write("\n") ++ fp.write(unicode(self._dump_properties(), 'utf8')) ++ fp.write(u"\n") + + for line in content: +- fp.write(line + "\n") ++ fp.write(unicode(line + "\n", 'utf8')) + + fp.close() + os.chmod(filename, 0o750) + self.changed = False + + def save(self): + if self.changed: + self.save_with_script(self.get_script()) + + def autoset_filename(self): + if self.filename is not None: + return + dirname = self.parent.path + if dirname != '': + dirname += os.path.sep + + basename = self.name.lower().replace(' ', '-').replace('/', '-') + + if self.library.get_full_path(dirname + basename): + i = 2 + while self.library.get_full_path(dirname + "%s-%d" % (basename, i)): + i += 1 + basename = "%s-%d" % (basename, i) + self.filename = basename + + if __name__ == '__main__': + library = ToolLibrary() + library.set_locations(os.path.expanduser("~/.config/gedit/tools")) + + def print_tool(t, indent): +diff --git a/plugins/pythonconsole/pythonconsole.plugin.desktop.in b/plugins/pythonconsole/pythonconsole.plugin.desktop.in +index 21283e8..4309667 100644 --- a/plugins/pythonconsole/pythonconsole.plugin.desktop.in +++ b/plugins/pythonconsole/pythonconsole.plugin.desktop.in -@@ -1,5 +1,5 @@ +@@ -1,10 +1,10 @@ [Plugin] -Loader=python3 +Loader=python Module=pythonconsole IAge=3 _Name=Python Console + _Description=Interactive Python console standing in the bottom panel + Icon=gnome-mime-text-x-python + Authors=Steve Frécinaux + Copyright=Copyright © 2006 Steve Frécinaux + Website=http://www.gedit.org +diff --git a/plugins/quickopen/quickopen.plugin.desktop.in b/plugins/quickopen/quickopen.plugin.desktop.in +index 68b6faa..17edecc 100644 --- a/plugins/quickopen/quickopen.plugin.desktop.in +++ b/plugins/quickopen/quickopen.plugin.desktop.in -@@ -1,5 +1,5 @@ +@@ -1,10 +1,10 @@ [Plugin] -Loader=python3 +Loader=python Module=quickopen IAge=3 _Name=Quick Open + _Description=Quickly open files + Icon=gtk-open + Authors=Jesse van den Kieboom + Copyright=Copyright © 2009 Jesse van den Kieboom + Website=http://www.gedit.org +diff --git a/plugins/snippets/snippets.plugin.desktop.in b/plugins/snippets/snippets.plugin.desktop.in +index 8551b6b..f41a626 100644 --- a/plugins/snippets/snippets.plugin.desktop.in +++ b/plugins/snippets/snippets.plugin.desktop.in -@@ -1,5 +1,5 @@ +@@ -1,9 +1,9 @@ [Plugin] -Loader=python3 +Loader=python Module=snippets IAge=3 _Name=Snippets + _Description=Insert often-used pieces of text in a fast way + Authors=Jesse van den Kieboom + Copyright=Copyright © 2005 Jesse van den Kieboom + Website=http://www.gedit.org +diff --git a/plugins/snippets/snippets/library.py b/plugins/snippets/snippets/library.py +index 455ac91..1b454f3 100644 +--- a/plugins/snippets/snippets/library.py ++++ b/plugins/snippets/snippets/library.py +@@ -1,47 +1,48 @@ + # Gedit snippets plugin + # Copyright (C) 2005-2006 Jesse van den Kieboom + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + ++import io + import os + import weakref + import sys + import re + + from gi.repository import Gdk, Gtk + + import xml.etree.ElementTree as et + from . import helper + + class NamespacedId: + def __init__(self, namespace, id): + if not id: + self.id = None + else: + if namespace: + self.id = namespace + '-' + else: + self.id = 'global-' + + self.id += id + + class SnippetData: + PROPS = {'tag': '', 'text': '', 'description': 'New snippet', + 'accelerator': '', 'drop-targets': ''} + + def __init__(self, node, library): + self.priv_id = node.attrib.get('id') + + self.set_library(library) +@@ -426,61 +427,61 @@ class SnippetsSystemFile: + + return True + + def _process_element(self, element): + if element.tag == 'snippet': + self._add_snippet(element) + self.insnippet = False + + return True + + def ensure(self): + if not self.ok or self.loaded: + return + + self.load() + + def parse_xml(self, readsize=16384): + if not self.path: + return + + elements = [] + + builder = SnippetsTreeBuilder( \ + lambda node: elements.append((node, True)), \ + lambda node: elements.append((node, False))) + + parser = et.XMLParser(target=builder) + self.insnippet = False + + try: +- f = open(self.path, "r", encoding='utf-8') ++ f = io.open(self.path, "r", encoding='utf-8') + except IOError: + self.ok = False + return + + while True: + try: + data = f.read(readsize) + except IOError: + self.ok = False + break + + if not data: + break + + try: + parser.feed(data) + except Exception: + self.ok = False + break + + for element in elements: + yield element + + del elements[:] + + f.close() + + def load(self): + if not self.ok: + return +diff --git a/plugins/snippets/snippets/shareddata.py b/plugins/snippets/snippets/shareddata.py +index be6fd14..64ffcc4 100644 --- a/plugins/snippets/snippets/shareddata.py +++ b/plugins/snippets/snippets/shareddata.py -@@ -20,7 +20,10 @@ import os +@@ -1,56 +1,57 @@ + # Gedit snippets plugin + # Copyright (C) 2011 Jesse van den Kieboom + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + from .singleton import Singleton + import os from gi.repository import Gtk + # To register the GeditSnippetsManager type + from .manager import Manager + -class SharedData(object, metaclass=Singleton): -+ +class SharedData(object): + __metaclass__ = Singleton -+ def __init__(self): self.dlg = None self.dlg_default_size = None -@@ -29,7 +32,7 @@ class SharedData(object, metaclass=Singl + self.controller_registry = {} + self.windows = {} def register_controller(self, view, controller): self.controller_registry[view] = controller -- -+ + def unregister_controller(self, view, controller): if self.controller_registry[view] == controller: del self.controller_registry[view] -@@ -72,7 +75,8 @@ class SharedData(object, metaclass=Singl - self.dlg.connect('destroy', self.manager_destroyed) - if self.dlg_default_size: -- self.dlg.set_default_size(self.dlg_default_size[0], self.dlg_default_size[1]) -+ self.dlg.set_default_size(self.dlg_default_size[0], -+ self.dlg_default_size[1]) + def register_window(self, window): + self.windows[window.window] = window + + def unregister_window(self, window): + if window.window in self.windows: + del self.windows[window.window] + + def update_state(self, window): + if window in self.windows: + self.windows[window].do_update_state() + + def get_active_controller(self, window): + view = window.get_active_view() + + if not view or not view in self.controller_registry: + return None + +diff --git a/plugins/snippets/snippets/signals.py b/plugins/snippets/snippets/signals.py +index 647b616..9aaa95a 100644 +--- a/plugins/snippets/snippets/signals.py ++++ b/plugins/snippets/snippets/signals.py +@@ -1,50 +1,50 @@ + # -*- coding: utf-8 -*- + # + # signals.py + # + # Copyright (C) 2009 - Jesse van den Kieboom + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, see . + +-class Signals: ++class Signals(object): + def __init__(self): + self._signals = {} + + def _connect(self, obj, name, handler, connector): + ret = self._signals.setdefault(obj, {}) + + hid = connector(name, handler) + ret.setdefault(name, []).append(hid) + + return hid + + def connect_signal(self, obj, name, handler): + return self._connect(obj, name, handler, obj.connect) + + def connect_signal_after(self, obj, name, handler): + return self._connect(obj, name, handler, obj.connect_after) + + def disconnect_signals(self, obj): + if obj not in self._signals: + return False + + for name in self._signals[obj]: + for hid in self._signals[obj][name]: + obj.disconnect(hid) + + del self._signals[obj] + return True - self.dlg.set_transient_for(window) - self.dlg.present() + def block_signal(self, obj, name): + if obj not in self._signals: +-- +2.3.7 diff --git a/SOURCES/jp-search.patch b/SOURCES/jp-search.patch new file mode 100644 index 0000000..6e22fb6 --- /dev/null +++ b/SOURCES/jp-search.patch @@ -0,0 +1,12 @@ +diff -up gedit-3.14.3/gedit/gedit-recent.c.jp-search gedit-3.14.3/gedit/gedit-recent.c +--- gedit-3.14.3/gedit/gedit-recent.c.jp-search 2015-08-18 10:11:59.995992219 -0400 ++++ gedit-3.14.3/gedit/gedit-recent.c 2015-08-18 10:12:23.350315762 -0400 +@@ -250,7 +250,7 @@ gedit_recent_get_items (GeditRecentConfi + { + gchar *uri_lower; + +- uri_lower = g_utf8_strdown (gtk_recent_info_get_uri (info), -1); ++ uri_lower = g_utf8_strdown (gtk_recent_info_get_uri_display (info), -1); + + if (strstr (uri_lower, config->substring_filter) == NULL) + { diff --git a/SPECS/gedit.spec b/SPECS/gedit.spec index 84863b4..742a8ac 100644 --- a/SPECS/gedit.spec +++ b/SPECS/gedit.spec @@ -1,52 +1,41 @@ %global _changelog_trimtime %(date +%s -d "1 year ago") -%if 0%{?fedora} > 12 -%global with_zeitgeist 1 -%global with_python3 1 -%else -%global with_zeitgeist 0 -%global with_python3 0 -%endif - -%if %{with_python3} -%global __python %{__python3} -%endif - -%define glib2_version 2.28.0 -%define pygo_version 2.90 +%define glib2_version 2.39.5 +%define gtk3_version 3.13.6 +%define pygo_version 3.0.0 %define desktop_file_utils_version 0.9 -%define gtksourceview_version 3.0.0 +%define gtksourceview_version 3.13.4 %define enchant_version 1.2.0 %define isocodes_version 0.35 %define libpeas_version 1.7.0 -%define zeitgeist_version 0.9.12 Summary: Text editor for the GNOME desktop Name: gedit Epoch: 2 -Version: 3.8.3 -Release: 6%{?dist} -License: GPLv2+ and CC-BY-SA +Version: 3.14.3 +Release: 9%{?dist} +License: GPLv2+ and GFDL Group: Applications/Editors #VCS: git:git://git.gnome.org/gedit -Source0: http://download.gnome.org/sources/gedit/3.8/gedit-%{version}.tar.xz +Source0: http://download.gnome.org/sources/gedit/3.14/gedit-%{version}.tar.xz + +# https://bugzilla.redhat.com/show_bug.cgi?id=1016757 +Patch4: gedit-disable-python3.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1251840 +Patch5: jp-search.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1247999 +Patch6: 0001-po-es-use-single-quote-instead-of-chevrons.patch URL: http://projects.gnome.org/gedit/ Requires(post): desktop-file-utils >= %{desktop_file_utils_version} Requires(postun): desktop-file-utils >= %{desktop_file_utils_version} -%ifarch ppc64,x86_64,ia64,s390x -Patch1: gedit-2.13.90-libdir.patch -%endif - -# https://bugzilla.redhat.com/show_bug.cgi?id=1016757 -Patch4: gedit-disable-python3.patch - BuildRequires: gnome-common BuildRequires: glib2-devel >= %{glib2_version} -BuildRequires: gtk3-devel -BuildRequires: libSM-devel +BuildRequires: gtk3-devel >= %{gtk3_version} BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} BuildRequires: enchant-devel >= %{enchant_version} BuildRequires: iso-codes-devel >= %{isocodes_version} @@ -62,21 +51,19 @@ BuildRequires: intltool BuildRequires: gobject-introspection-devel BuildRequires: yelp-tools BuildRequires: itstool -%if %{with_python3} -BuildRequires: python3-devel -BuildRequires: python3-gobject >= %{pygo_version} -%else +BuildRequires: vala-tools BuildRequires: python-devel -%endif -%if %{with_python3} -Requires: python3-gobject >= %{pygo_version} -%endif +Requires: glib2%{?_isa} >= %{glib2_version} +Requires: gtk3%{?_isa} >= %{gtk3_version} +Requires: gtksourceview3%{?_isa} >= %{gtksourceview_version} # the run-command plugin uses zenity Requires: zenity Requires: gsettings-desktop-schemas Requires: gvfs +Obsoletes: gedit-collaboration < 3.6.1-6 + %description gedit is a small, but powerful text editor designed specifically for the GNOME desktop. It has most standard text editor functions and fully @@ -93,7 +80,6 @@ gedit-plugins package. Summary: Support for developing plugins for the gedit text editor Group: Development/Libraries Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: gtksourceview3-devel >= %{gtksourceview_version} %description devel gedit is a small, but powerful text editor for the GNOME desktop. @@ -102,34 +88,17 @@ to gedit. Install gedit-devel if you want to write plugins for gedit. -%if %{with_zeitgeist} -%package zeitgeist -Summary: Zeitgeist plugin for gedit -Group: Applications/Editors -Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: zeitgeist >= %{zeitgeist_version} -BuildRequires: zeitgeist-devel >= %{zeitgeist_version} - -%description zeitgeist -This packages brings the Zeitgeist dataprovider - a plugin that logs -access and leave event for documents used with gedit. -%endif - %prep %setup -q -%ifarch ppc64,x86_64,ia64,s390x -%patch1 -p1 -b .libdir -%endif - -%if !%{with_python3} %patch4 -p1 -b .disable-python -%endif +%patch5 -p1 -b .jp-search +%patch6 -p1 -b .es-po-quotes -%build -NOCONFIGURE=1 autoreconf -i -f && \ - intltoolize -f +autoreconf -i -f +intltoolize -f +%build %configure \ --disable-gtk-doc \ --enable-introspection=yes \ @@ -147,8 +116,20 @@ make install DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} --with-gnome +# for backward compatibility with user defined file associations +cat << EOF > $RPM_BUILD_ROOT%{_datadir}/applications/gedit.desktop +[Desktop Entry] +Name=gedit +Exec=gedit %U +Type=Application +MimeType=text/plain; +NoDisplay=true +X-GNOME-UsesNotifications=false +X-RHEL-AliasOf=org.gnome.gedit +EOF + %check -desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/gedit.desktop +desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.gedit.desktop %post update-desktop-database >&/dev/null || : @@ -169,42 +150,36 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : %files -f %{name}.lang %doc README COPYING AUTHORS %{_datadir}/gedit -%{_datadir}/applications/gedit.desktop +%{_datadir}/applications/*.desktop %{_mandir}/man1/* -%if %{with_python3} -%{python3_sitearch}/gi/overrides/Gedit.py* -%{python3_sitearch}/gi/overrides/__pycache__ -%endif +%{python2_sitearch}/gi/overrides/* %{_libexecdir}/gedit %{_libdir}/gedit/girepository-1.0 %dir %{_libdir}/gedit %dir %{_libdir}/gedit/plugins -%{_libdir}/gedit/libgedit-private.so -%{_libdir}/gedit/plugins/* -%{python2_sitearch}/gi/overrides/Gedit.py* -#%{_libdir}/gedit/plugins/changecase.plugin -#%{_libdir}/gedit/plugins/libchangecase.so -#%{_libdir}/gedit/plugins/docinfo.plugin -#%{_libdir}/gedit/plugins/libdocinfo.so -#%{_libdir}/gedit/plugins/filebrowser.plugin -#%{_libdir}/gedit/plugins/libfilebrowser.so -#%{_libdir}/gedit/plugins/modelines.plugin -#%{_libdir}/gedit/plugins/libmodelines.so -#%{_libdir}/gedit/plugins/externaltools.plugin -#%{_libdir}/gedit/plugins/externaltools -#%{_libdir}/gedit/plugins/pythonconsole.plugin -#%{_libdir}/gedit/plugins/pythonconsole -#%{_libdir}/gedit/plugins/quickopen.plugin -#%{_libdir}/gedit/plugins/quickopen -#%{_libdir}/gedit/plugins/snippets.plugin -#%{_libdir}/gedit/plugins/snippets -#%{_libdir}/gedit/plugins/sort.plugin -#%{_libdir}/gedit/plugins/libsort.so -#%{_libdir}/gedit/plugins/spell.plugin -#%{_libdir}/gedit/plugins/libspell.so -#%{_libdir}/gedit/plugins/time.plugin -#%{_libdir}/gedit/plugins/libtime.so +%{_libdir}/gedit/libgedit.so +%{_libdir}/gedit/plugins/docinfo.plugin +%{_libdir}/gedit/plugins/libdocinfo.so +%{_libdir}/gedit/plugins/filebrowser.plugin +%{_libdir}/gedit/plugins/libfilebrowser.so +%{_libdir}/gedit/plugins/modelines.plugin +%{_libdir}/gedit/plugins/libmodelines.so +%{_libdir}/gedit/plugins/externaltools.plugin +%{_libdir}/gedit/plugins/externaltools +%{_libdir}/gedit/plugins/pythonconsole.plugin +%{_libdir}/gedit/plugins/pythonconsole +%{_libdir}/gedit/plugins/quickopen.plugin +%{_libdir}/gedit/plugins/quickopen +%{_libdir}/gedit/plugins/snippets.plugin +%{_libdir}/gedit/plugins/snippets +%{_libdir}/gedit/plugins/sort.plugin +%{_libdir}/gedit/plugins/libsort.so +%{_libdir}/gedit/plugins/spell.plugin +%{_libdir}/gedit/plugins/libspell.so +%{_libdir}/gedit/plugins/time.plugin +%{_libdir}/gedit/plugins/libtime.so %{_bindir}/* +%{_datadir}/appdata/org.gnome.gedit.appdata.xml %{_datadir}/GConf/gsettings %{_datadir}/glib-2.0/schemas/org.gnome.gedit.gschema.xml %{_datadir}/glib-2.0/schemas/org.gnome.gedit.enums.xml @@ -218,17 +193,51 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : %files devel -%{_includedir}/gedit-3.0 +%{_includedir}/gedit-3.12 %{_libdir}/pkgconfig/gedit.pc %{_datadir}/gtk-doc - -%if %{with_zeitgeist} -%files zeitgeist -%{_libdir}/gedit/plugins/zeitgeist.plugin -%{_libdir}/gedit/plugins/libzeitgeistplugin.so -%endif +%{_datadir}/vala/ %changelog +* Wed Sep 23 2015 Ray Strode 3.14.3-9 +- Add X-RHEL-AliasOf=org.gnome.gedit to compat desktop file + Related: #1259292 + +* Mon Sep 21 2015 Ray Strode - 2:3.14.3-8 +- Use ' instead of « in es locale for font parsing + Resolves: #1247999 +- Add X-GNOME-UsesNotifications=false to compat desktop file + Related: #1259292 + +* Tue Aug 18 2015 Matthias Clasen - 2:3.14.3-7 +- Fix search in Japanese titles + Resolves: #1251840 + +* Thu Jul 16 2015 Ray Strode - 2:3.14.3-6 +- add type=Application to appease rpmdiff + Related: #1238207 + +* Tue Jul 14 2015 Ray Strode - 2:3.14.3-5 +- use cat instead of echo from previous fix + Resolves: #1238207 + +* Wed Jul 01 2015 Ray Strode - 2:3.14.3-4 +- fix backward compat gedit.desktop to not show up in menus + Related: #1174591 + Resolves: 1238207 + +* Fri Jun 26 2015 Ray Strode - 2:3.14.3-3 +- add backward compat gedit.desktop to keep user mime assocations working + Related: #1174591 1235413 + +* Thu Jun 25 2015 Ray Strode - 2:3.14.3-2 +- Updated python2 support patch from Matěj Cepl + Related: #1174591 + +* Mon Mar 23 2015 Richard Hughes - 2:3.14.3-1 +- Update to 3.14.3 +- Resolves: #1174591 + * Thu Jan 30 2014 Ray Strode - 2:3.8.3-6 - Update License field to reflect documentation change Resolves: #1059847