Opened 13 years ago

Closed 12 years ago

#33054 closed defect (fixed)

gtk3 @3.0.12 +introspection build failure

Reported by: msm@… Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: singingwolfboy@…, dbevans (David B. Evans), ryandesign (Ryan Carsten Schmidt), cdeil (Christoph Deil), su-v, mamoll (Mark Moll)
Port: gtk3 gobject-introspection

Description

While attempting to install gtk3 with introspection on a fresh macports(OSX 10.7.2), I ran into several build errors pertaining to missing .gir files. It turns out that atk, gdk-pixbuf2, and pango need introspection enabled for gtk3 to build properly with introspection.

I modified the Portfiles for atk, gdk-pixbuf2, and pango and then installed them again with +introspection, then gtk3 built just fine. Following the guide of the Portfile for gtk3 I produced a few patches to the other Portfiles.

--- Portfile-atk.orig   2012-01-28 23:22:44.000000000 -0500
+++ Portfile-atk        2012-01-28 16:34:30.000000000 -0500
@@ -1,5 +1,5 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:
sts=4
-# $Id$
+# $Id: Portfile 87586 2011-11-27 08:37:54Z dports@macports.org $
 
 PortSystem              1.0
 PortGroup               archcheck 1.0
@@ -40,6 +40,13 @@
 configure.args          --enable-static \
                         --disable-introspection
 
+
+variant introspection description {Enable introspection} {
+    depends_lib-append      port:gobject-introspection+    configure.args-delete   --disable-introspection
+    configure.args-append   --enable-introspection
+}
+
 livecheck.type          regex
 livecheck.url           http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
 livecheck.regex         {LATEST-IS-(\d+(?:\.\d+)*)}
--- Portfile-gdk-pixbuf2.orig   2012-01-28 23:23:36.000000000 -0500
+++ Portfile-gdk-pixbuf2        2012-01-28 16:32:31.000000000 -0500
@@ -1,5 +1,5 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:
sts=4
-# $Id$
+# $Id: Portfile 87587 2011-11-27 08:41:00Z dports@macports.org $
 
 PortSystem                  1.0
 
@@ -50,6 +50,12 @@
 configure.args              --with-libjasper \
                             --enable-introspection=no
 
+variant introspection description {Enable introspection} {
+    depends_lib-append      port:gobject-introspection
+    configure.args-delete   --enable-introspection=no
+    configure.args-append   --enable-introspection=yes
+}
+
 test.run                    yes
 test.target                 check
 
--- Portfile-pango.orig 2012-01-28 23:24:13.000000000 -0500
+++ Portfile-pango      2012-01-28 16:32:06.000000000 -0500
@@ -1,5 +1,5 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id$
+# $Id: Portfile 87564 2011-11-25 20:53:28Z ryandesign@macports.org $
 
 PortSystem              1.0
 PortGroup               archcheck 1.0
@@ -124,6 +124,12 @@
     default_variants +x11
 }
 
+variant introspection description {Enable introspection} {
+    depends_lib-append      port:gobject-introspection
+    configure.args-delete   --disable-introspection
+    configure.args-append   --enable-introspection
+}
+
 post-destroot {
     if {![variant_isset x11]} {
         xinstall -d ${destroot}${prefix}/etc/pango

hope this helps.

Attachments (3)

Portfile-atk.diff (912 bytes) - added by msm@… 13 years ago.
atk Portfile diff
Portfile-gdk-pixbuf2.diff (813 bytes) - added by msm@… 13 years ago.
gdk-pixbuf2 Portfile diff
Portfile-pango.diff (793 bytes) - added by msm@… 13 years ago.
pango Portfile diff

Download all attachments as: .zip

Change History (14)

Changed 13 years ago by msm@…

Attachment: Portfile-atk.diff added

atk Portfile diff

Changed 13 years ago by msm@…

Attachment: Portfile-gdk-pixbuf2.diff added

gdk-pixbuf2 Portfile diff

Changed 13 years ago by msm@…

Attachment: Portfile-pango.diff added

pango Portfile diff

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: singingwolfboy@… devans@… ryandesign@… added; singingwolfboy devans ryandesign removed

The Cc field requires complete email addresses.

comment:2 Changed 13 years ago by neverpanic (Clemens Lang)

Keywords: gtk3 gobject-introspection removed
Owner: changed from macports-tickets@… to cal@…
Port: gobject-introspection added
Status: newassigned

comment:3 Changed 13 years ago by cdeil (Christoph Deil)

Cc: Deil.Christoph@… added

Cc Me!

comment:4 Changed 13 years ago by cdeil (Christoph Deil)

I think I ran into the same problem:

$ sudo port -d install gtk3 +introspection
...
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'])

I am new to GTK and would like to use it from python. This tutorial ( http://python-gtk-3-tutorial.readthedocs.org/en/latest/introduction.html ) uses

from gi.repository import Gtk

Is this python GTK3 package available via Macports?

Which port / variant to I have to install to get it?

comment:5 Changed 13 years ago by su-v

Cc: suv-sf@… added

Cc Me!

comment:6 in reply to:  4 ; Changed 13 years ago by msm@…

Replying to Deil.Christoph@…:

I am new to GTK and would like to use it from python. This tutorial ( http://python-gtk-3-tutorial.readthedocs.org/en/latest/introduction.html ) uses

from gi.repository import Gtk

Is this python GTK3 package available via Macports?

Which port / variant to I have to install to get it?

To get Gtk-3.0 working with Python you will need to build this port(Gtk3) with introspection enabled. I was able to get introspection enabled by applying the patches posted here and then building those ports. You will also need to install the gobject-introspection port and pygobject.

Feel free to email me if you want to chat more about setting up Gtk3 with Python.

comment:7 in reply to:  6 ; Changed 13 years ago by cdeil (Christoph Deil)

Replying to msm@…:

Replying to Deil.Christoph@…:

I am new to GTK and would like to use it from python. This tutorial ( http://python-gtk-3-tutorial.readthedocs.org/en/latest/introduction.html ) uses

from gi.repository import Gtk

Is this python GTK3 package available via Macports?

Which port / variant to I have to install to get it?

To get Gtk-3.0 working with Python you will need to build this port(Gtk3) with introspection enabled. I was able to get introspection enabled by applying the patches posted here and then building those ports. You will also need to install the gobject-introspection port and pygobject.

Feel free to email me if you want to chat more about setting up Gtk3 with Python.

Thanks for your help!

I currently have this installed and active:

  atk @2.2.0_0 (active)
  gdk-pixbuf2 @2.26.1_0 (active)
  gobject-introspection @1.30.0_0 (active)
  pango @1.30.0_0+x11 (active)
  py27-gobject @2.26.0_2 (active)

Can you please post the commands I have to execute

  • to apply your patches and then how to
  • force a rebuild of these ports with the introspection variant?

I can see that the atk, gdk-pixbuf2 and pango maintainers are CC'ed on this ticket. Would it be possible to apply these patches or do you have suggestions for further tests?

Christoph

comment:8 in reply to:  7 Changed 13 years ago by msm@…

Replying to Deil.Christoph@…:

Can you please post the commands I have to execute

  • to apply your patches and then how to
  • force a rebuild of these ports with the introspection variant?

Well, when I created the patches I used 'sudo port edit' to modify the portfiles and then just rebuilt with 'sudo port install'. I'm not sure about applying the patches using the patch command as I don't recall where the portfiles are installed and I have since uninstalled macports.

I would say you could easily reproduce what I did by using the 'sudo port edit' command on the atk, gdk-pixbuf2, and pango to manually apply the few lines to each. Then run 'sudo port install <port> +introspection' and you should be able to get them all installed.

I can see that the atk, gdk-pixbuf2 and pango maintainers are CC'ed on this ticket. Would it be possible to apply these patches or do you have suggestions for further tests?

There is another ticket open about this issue and I believe the maintainers are working on a different solution to adding introspection. It sounds like at some point it will enabled by default.

good luck

comment:9 Changed 12 years ago by neverpanic (Clemens Lang)

#33877 will fix this. I plan to commit those, but more testing is needed and gobject-introspection needs to be patched a little more (it currently fails for me when trying to import the modules into Python because they're linked against relative paths, which works on Linux, but breaks on Macs).

comment:10 Changed 12 years ago by mamoll (Mark Moll)

Cc: mmoll@… added

Cc Me!

comment:11 Changed 12 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: assignedclosed

#33877 has been closed, r95237 enabled gobject-introspection for gtk3.

Note: See TracTickets for help on using tickets.