GNOME Bugzilla – Bug 685094
pygobject should not hard depend in cairo
Last modified: 2012-10-15 05:48:04 UTC
It's not really cool that pygobject has a hard dependency on cairo just so it can build the test. I'm using pygobject on OS X and I'm fine with not running the tests during the build. Having cairo as a dependency for my little library just because pygobject needs it to run a test during the build is not so nice.
Created attachment 226071 [details] [review] Patch to make building tests optional
I just hit that yesterday, and wrote the following patch, which may well bear a striking resemblance to glib's --disable-modular-tests...
Hm, does that actually work for you? It doesn't disable the usage of pycairo along with it, and pycairo needs libcairo already. Also, libcairo is already needed by GTK and Pango, i. e. even on a reasonably small GNOME-ish build you would already need it. I think we need a more complete patch then to completely disable all usages of cairo in the code if you want to build this without cairo. It's not just the tests, it's also gi/pygi-foreign-cairo.c (which you couldn't build without cairo) and gi/overrides/Gdk.py, which you couldn't load without cairo either.
I think you are missing the existence of "--disable-cairo" which already avoids compiling pygi-foreign-cairo.c and _gi_cairo.la. The point is that even if you attempt configuring with --disable-cairo, you still can't build because of the cairo dependence on the tests. That's why my patch adds a --disable-tests flags to avoid building the tests. So configure --disable-cairo --disable-tests avoids the cairo dependence. BTW do you have any thoughts on https://mail.gnome.org/archives/python-hackers-list/2012-October/msg00005.html because it seems to me that libffi is no longer a direct dependency either...
I still don't quite like this patch, to be honest. It's a little more effort, but with this it's enough to just specify --disable-cairo and it will just skip the tests that actually need it: http://git.gnome.org/browse/pygobject/commit/?id=75e373b99c3cb66dd60b13c803e5f7eec77cc415 With that, I get ---------------------------------------------------------------------- Ran 621 tests in 5.444s OK (skipped=59, expected failures=1) which still provides a good code coverage. This only rearranges the build system a bit and otherwise only affects tests, so this is fine for 3.6.1 (which is due today). As for libffi, I need to look into that. I'll answer on the ML.