What do I need to install for the solution Could not find any typelib for GtkSource, Cannot import: GtkSourceView, cannot import the name GtkSource

I am trying to apply a patch for meld from https://bugzilla.gnome.org/show_bug.cgi?id=680569 myself, and I am having problems with this:

$ git clone git://git.gnome.org/meld $ cd meld $ python setup.py build $ bin/meld 2014-01-11 16:30:44,736 ERROR root: Could not find any typelib for GtkSource Cannot import: GtkSourceView cannot import name GtkSource 

I don't know much about Python, etc. I don’t know (yet) what typelib is for Python - enlighten me! ;-) I looked around and dimly realized that this had something to do with an exotic fruit;) called gir, but it does not seem to help:

 $ sudo apt-get install gir1.2-gtk-3.0 gir1.2-gtk-3.0 is already the newest version. $ sudo apt-get install gir1.2-gtk-2.0 The following NEW packages will be installed: gir1.2-gtk-2.0 Setting up gir1.2-gtk-2.0 (2.24.20-1ubuntu1) ... $ bin/meld 2014-01-11 16:32:24,133 ERROR root: Could not find any typelib for GtkSource Cannot import: GtkSourceView cannot import name GtkSource 

What am I missing? Thanks!

+7
python pygtk pygobject meld
source share
1 answer

To install the desired library on a Debian / Ubuntu machine:

 sudo apt-get install gir1.2-gtksource-3.0 

GtkSourceView is a C library that allows applications to display a syntax-highlighted text buffer for code and a bunch of other useful properties.

https://wiki.gnome.org/Projects/GtkSourceView

The above package has the following description:

GtkSourceView is a text widget that extends the standard GTK + 3.x GtkTextView text widget. It improves GtkTextView by implementing syntax highlighting and other features specific to the original editor. This package contains gobject introspection information.

Since Gtk + 3.0 there is a system called Introspection, which allows you to analyze source code written in C to dynamically create bindings for other languages ​​such as Python, Vala, etc. gir for GObject Introspection repository (I'm not sure about R ). Citation:

https://wiki.gnome.org/action/show/Projects/GObjectIntrospection?action=show&redirect=GObjectIntrospection#What_is_introspection.3F

GObject integration is an intermediate layer between C libraries (using GObject) and language bindings. The C library can be scanned at compile time and generate a metadata file in addition to the actual native C library. Then, at run time, language bindings can read this metadata and automatically provide the bindings to be called into C library.

+11
source share

All Articles