#33877 closed enhancement (fixed)
Build atk, pango and gdk-pixbuf2 with GObject Introspection
Reported by: | neverpanic (Clemens Lang) | Owned by: | singingwolfboy@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.0.99 |
Keywords: | haspatch | Cc: | mamoll (Mark Moll), su-v, cdeil (Christoph Deil), zach.charlop.powers@…, Themanwithoutaplan, dougalg@… |
Port: | atk pango pango-devel gdk-pixbuf2 gtk3 |
Description
GObject Introspection is only useful when the libraries trying to be used through introspection are built with --enable-introspection
.
Current practice (e.g. in the gtk3 port) is to provide a variant for introspection, which is however a pain to maintain, because every port trying to depend on, e.g., gtk3 +introspection needs to check for a file installed by that variant, abort if it's not there and instruct the user to install the dependency with the needed variant.
Because of this, I would suggest to enable introspection by default. This adds a dependency on the gobject-introspection
port. I don't see this as a blocker, because the port is a rather quick build and its dependencies will mostly be installed in systems where introspection is used anyway (e.g., cairo is needed by pango, glib2 is needed by gtk3, python27 is required by a huge number of ports).
I'll attach patches for atk, gdk-pixbuf2 and pango shortly.
Attachments (4)
Change History (28)
Changed 13 years ago by neverpanic (Clemens Lang)
Attachment: | atk-enable-introspection.patch added |
---|
Changed 13 years ago by neverpanic (Clemens Lang)
Attachment: | gdk-pixbuf2-enable-introspection.patch added |
---|
Patch against the gdk-pixbuf2 Portfile enabling introspection
Changed 13 years ago by neverpanic (Clemens Lang)
Attachment: | pango-enable-introspection.patch added |
---|
Patch against the pango Portfile enabling introspection
Changed 13 years ago by neverpanic (Clemens Lang)
Attachment: | pango-devel-enable-introspection.patch added |
---|
Patch against the pango-devel Portfile enabling introspection
comment:1 Changed 13 years ago by neverpanic (Clemens Lang)
Any comments? Should I just go ahead and commit those, since all those ports are marked openmaintainer?
comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)
Enabling introspection has previously caused lots of problems. I don't know what introspection is or what's going on. If you have reviewed the previous problems, and come to the conclusion that they won't happen again, then proceed at your discretion. I agree if the feature is useful and does not cause problems it should be turned on.
comment:3 follow-up: 4 Changed 13 years ago by msm@…
I brought this up a few months ago here: #33054
The patches I generated allow for introspection to be turned off if needed.
@ryandesign Introspection allows for a dynamic analysis of the api for gobject/gdk/gtk and a few others. For one this allows python developers to move forward with using gtk3 as PyGtk is going to be deprecated.
comment:4 follow-up: 5 Changed 13 years ago by neverpanic (Clemens Lang)
Replying to msm@…:
The patches I generated allow for introspection to be turned off if needed.
Yes, I was aware of this. This method has the problem that it can't be directly depended upon, because the MacPorts dependency engine doesn't handle variants (i.e. you can't easily depend on gtk3 +introspection). This makes writing Portfiles using introspection (imho unnecessarily) hard and often requires user interaction to get the dependencies right.
comment:5 Changed 13 years ago by msm@…
comment:12 Changed 12 years ago by Themanwithoutaplan
I've just tried the Pango patch (+ py27-gobject3) but Pango is not coming through.
Type "help", "copyright", "credits" or "license" for more information. >>> from gi.repository import cairo >>> from gi.repository import Pango ERROR:root:Could not find any typelib for Pango Traceback (most recent call last):
comment:13 Changed 12 years ago by neverpanic (Clemens Lang)
Which files did your pango install? Check with port contents pango
. Also make sure you're not getting the binary download from the buildbot without the changes in the Portfile, but force build from source: port -s install pango
.
comment:14 follow-up: 18 Changed 12 years ago by Themanwithoutaplan
Yes, I did trip up over the different behaviour of port -D . build
and port -D . install
After that I was still hitting problems until I added /opt/local/lib to the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/local/lib
Result: Weasyprint, http://www.weasyprint.org now runs on Mac OS.
comment:15 Changed 12 years ago by neverpanic (Clemens Lang)
This is a known problem and I'm going to fix this by modifying gobject-introspection
to include the full path of the to-be-loaded libraries in the typelib file. Unfortunately upstream gobject-introspection disregards Mac OS X' linking style here (which works fine as long as the libraries are located in /usr/lib).
comment:16 Changed 12 years ago by Themanwithoutaplan
Great! I'm sure I'm not the only one who struggles with some of the unix environment variables. I managed to destroy my LD_LIBRARY_PATH earlier and had to reinstall py-Gobject3 to get things working again.
comment:18 Changed 12 years ago by dougalg@…
Charlie, can you clarify how you got it to work? I'm stuck at the typelib error, and cannot get pango to install. Do I need to manually add these patches or have they been moved into the main repository already?
I've already added opt/local/lib to my LD_LIBRARY_PATH
Any help would be appreciated, thanks.
Replying to charlie.clark@…:
Yes, I did trip up over the different behaviour of
port -D . build
andport -D . install
After that I was still hitting problems until I added /opt/local/lib to the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/local/lib
Result: Weasyprint, http://www.weasyprint.org now runs on Mac OS.
comment:20 follow-up: 21 Changed 12 years ago by dougalg@…
OK, I found and looked at the portfile, then patched it with the patch. Now when I try to build it fails with:
Error: Unable to open port: invalid command name "CC=/usr/bin/clang"
Thank you if you have any idea what might be wrong.
comment:21 follow-up: 24 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to dougalg@…:
Error: Unable to open port: invalid command name "CC=/usr/bin/clang"
I'm not sure which of the four patches in this ticket you're talking about. The only thing I can imagine is that you did not actually use the patch(es), but rather tried to make equivalent changes to the Portfile(s) manually, and ended up inserting something like the following, which is a syntax error:
build.env-append CC=${configure.cc}
Rather than the following, which is what you want:
build.env-append \ CC=${configure.cc}
comment:22 Changed 12 years ago by neverpanic (Clemens Lang)
Port: | gtk3 added |
---|
GObject Introspection from MacPorts as of r95227 generates .gir and .typelib files with absolute paths. This should lift any requirements to specify DYLD_LIBRARY_PATH
or DYLD_FALLBACK_LIBRARY_PATH
.
In order for this change to work, the .gir and .typelib files must be regenerated, i.e. the ports installing these files must be rebuilt.
comment:23 Changed 12 years ago by neverpanic (Clemens Lang)
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:24 Changed 12 years ago by dougalg@…
Thank you for your help. The patch did indeed not patch all the lines so I manually added those which it missed, so you must be right. However, since it's been added to the trunk now, I just updated and it worked great!
Replying to ryandesign@…:
I'm not sure which of the four patches in this ticket you're talking about. The only thing I can imagine is that you did not actually use the patch(es), but rather tried to make equivalent changes to the Portfile(s) manually, and ended up inserting something like the following, which is a syntax error...
Patch against the atk Portfile enabling introspection