GTK+3: port to libpeas, re-add Python plugin support #71

Closed
rezso opened this Issue Apr 7, 2015 · 12 comments

Projects

None yet

5 participants

@rezso
Contributor
rezso commented Apr 7, 2015 edited

the error message:
https://gist.github.com/rezso/b83eab47d9859913a98c

without gobject-introspection the build is successful.

@monsta
Member
monsta commented Apr 22, 2015

The latest git master version builds fine for me with GTK+3 and introspection enabled.
Not sure why you mentioned pygtk - it's GTK+2 only, in GTK+3 it's replaced by introspection (PyGObject).

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Please make sure you have the whole MATE (well, at least the packages required for building eom) built with GTK+3.

@rezso
Contributor
rezso commented Apr 22, 2015

It seems to me, that the python support requires pygtk.
checking whether Python support is requested... autodetect
checking for a Python interpreter with version >= 2.3... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
sed: can't read ${exec_prefix}/lib/python2.7/config/Makefile: No such file or directory
sed: can't read ${exec_prefix}/lib/python2.7/config/Makefile: No such file or directory
checking for PYGTK... no
configure: WARNING: No package 'pygobject-2.0' found
No package 'pygtk-2.0' found
configure: WARNING: Disabling python support

@monsta
Member
monsta commented Apr 23, 2015

Ah... right, sorry. I totally forgot that in Debian we build GTK+3 version of eom with --disable-python flag.

@derlaft
derlaft commented May 20, 2015

Have the same problem here with 1.10.0. Build log: https://s3.amazonaws.com/archive.travis-ci.org/jobs/63279991/log.txt (at the very end)

Everything seems to be compiled with gtk2, eom built with --disable-python

@flexiondotorg flexiondotorg added this to the Gtk+3 milestone Aug 27, 2015
@monsta monsta added the confirmed label Sep 25, 2015
@raveit65 raveit65 changed the title from Compiling 1.9.90 with gtk3, pygtk and gobject-introspection fails to GTK3: Compiling 1.9.90 with gtk3, pygtk and gobject-introspection fails Nov 11, 2015
@raveit65
Member

Building with introspection works now after
3d34cc1
But there are some introspections build warnings left.

@monsta monsta changed the title from GTK3: Compiling 1.9.90 with gtk3, pygtk and gobject-introspection fails to GTK+3: port to libpeas, re-add Python plugin support Dec 8, 2016
@monsta
Member
monsta commented Dec 8, 2016

Ok, porting to libpeas is done, what's left is to enable Python loader and find some Python plugins to test it.

@raveit65
Member

I guess this can only be tested by @yselkowitz when the python plugins are ported to libpeas.
https://github.com/yselkowitz/eom-plugins

@monsta
Member
monsta commented Dec 20, 2016

I made a simple Python plugin for testing. It consists of two small files.

sidebar-test.py:

from gi.repository import GObject, Gtk, Peas

class SidebarTest(GObject.Object, Peas.Activatable):
    __gtype_name__ = "SidebarTestPlugin"

    object = GObject.Property(type=GObject.Object)

    def __init__(self):
        GObject.Object.__init__(self)

    def do_activate(self):
        self.label = Gtk.Label.new("Just a test")
        self.label.show()

        window = self.object
        window.get_sidebar().add_page("Sidebar Test", self.label)

    def do_deactivate(self):
        window = self.object
        window.get_sidebar().remove_page(self.label)

sidebar-test.plugin:

[Plugin]
Loader=python
Module=sidebar-test
IAge=1
Name=Sidebar Test
Description=Shows a test message in the sidebar
Icon=text-x-python
Authors=Vlad Orlov <monsta@inbox.ru>
Copyright=Copyright © 2016 Vlad Orlov <monsta@inbox.ru>
Website=http://www.mate-desktop.org

How to test:

  • install introspection data for eom and libpeas and Python plugin loader from libpeas
  • copy both sidebar-test.* files from here to eom plugins dir (/usr/lib/.../eom/plugins/)
  • enable this plugin in the preferences
  • load some image (needed to show the sidebar)
  • press Ctrl-F9 to reveal the sidebar

The sidebar should show a test message.

@raveit65
Member

aha, i nedd to install Python-2 plugin loader from libpeas, there is also one package for python3.
And i see the sidebar after enable this in view menu.

@monsta
Member
monsta commented Dec 31, 2016

Ah, so in Fedora they're in separate packages too? It's the same in Debian now.

@raveit65
Member

yes, one for python3 and one for python2.

@monsta
Member
monsta commented Jan 2, 2017

Ok, I think it's done. I guess #108 can be closed as well now.

@monsta monsta closed this Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment