Re: Installing perl-Gtk3 under OS X

On Mon, Mar 19, 2012 at 23:30, Alejandro Imass <ait p2ee org> wrote:
On Mon, Mar 19, 2012 at 4:30 PM, Emmanuel Rodriguez
<emmanuel rodriguez gmail com> wrote:
On Sun, Mar 18, 2012 at 21:03, Alejandro Imass <ait p2ee org> wrote:
On Sun, Mar 18, 2012 at 3:27 PM, Emmanuel Rodriguez
<emmanuel rodriguez gmail com> wrote:


Is there an easy way to install perl-Gtk3 under OS X?


MacPorts managed to install gtk3 but it's compiled without
introspection. I tried enabling it by hacking the ports file but then
I got this error:

:info:build Couldn't find include 'GdkPixbuf-2.0.gir' (search path:
['../gdk', 'gir-1.0', '/opt/local/share/gir-1.0',
'/usr/share/gir-1.0', '/opt/local/share/gir-1.0'])
:info:build make[4]: *** [Gdk-3.0.gir] Error

Yeah, I fugured as much. I mean I wa confident that GTK3 would work
but perhaps no good for devel.
Getting gtk3 and all its dependencies installed is of great help. So
MacPorts did help.

This is not going to be an easy task :(

Probably not, bu I think it's a lot easier to hack the MacPort rather
than build your own... well who knows really..

This is exactly what I did yesterday but I didn't had the time to
email my results. I know have perl-Gtk3 working under OS X :) Here's
what I did:

First install MacPorts, i followed the instructions from their web
site [1] and I downloaded the dmg installer and executed:

sudo port -v selfupdate

The set your environment properly, add this to your shell and your

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export MANPATH="/opt/local/share/man:$MANPATH"
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/local/lib
export GI_TYPELIB_PATH=/opt/local/lib/girepository-1.0

If you change your default ports folder you're on your own and you
should be able to figure out what to change (replace /opt/local with
your port's installation folder).

Now the fun begins. Installing gtk3 is as easy as:

sudo port install gtk3

The problem is that gtk3 and a few libraries are compiled without
introspection. Fire up your editor skills because we need to edit a
few files. You'll find the files here:

cd /opt/local/var/macports/sources/

sudo nano -w gnome/gtk3/Portfile
sudo nano -w graphics/gdk-pixbuf2/Portfile
sudo nano -w x11/pango/Portfile
sudo nano -w devel/atk/Portfile

Look for the word introspection and replace the flag with
--enable-introspection. Then uninstall and reinstall these ports:

sudo port -f uninstall gdk-pixbuf2 && sudo port install gdk-pixbuf2
sudo port -f uninstall pango && sudo port install pango
sudo port -f uninstall atk && sudo port install atk
sudo port -f uninstall gtk3 && sudo port install gkt3

If I didn't forget a single command then gtk3 would be built and
installed with introspection support.

Installing perl-Gtk3 is now an easier task since all that's needed is
to install the introspection library:

sudo port install gobject-introspection

That's it the rest should be a normal CPAN installation procedure.

I still have to try compile WebKitGtk+'s port with gtk3 and
introspection. I haven't even tried this step yet.


I hope that this helps someone else.
Emmanuel Rodriguez

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]