GNOME Bugzilla – Bug 668193
introspection.m4: take in account XDG_DATA_DIRS
Last modified: 2015-02-07 16:55:13 UTC
I have installed libmemphis (http://trac.openstreetmap.ch/trac/memphis/wiki/LibMemphis) in /opt/memphis-0.2.3/. Next I build libchamplain with: XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/memphis-0.2.3/share PKG_CONFIG_PATH=/opt/memphis-0.2.3/lib/pkgconfig ./configure --prefix=/opt/libchamplain-0.12.1/ but XDG_DATA_DIRS is not taken in account and command fails with: Adding the following line: AC_ARG_VAR([XDG_DATA_DIRS], [directories to add to g-ir-scanner's search path]) in libchamplain-0.12.1/m4/introspection.m4 allows to build libchamplain. libchamplain-0.12.1/m4/introspection.m4 is a copy of /usr/share/aclocal/introspection.m4 which is installed by gobject-introspection. Another point: man page of g-ir-scanner mentions "The g-ir-scanner uses the XDG_DATA_DIRS variable to check for dirs, the gir's are located in XDG_DATA_DIRS/share/gir-1.0." but g-ir-scanner use "XDG_DATA_DIRS/gir-1.0". Both patchs attached.
Created attachment 205538 [details] [review] Fix-path-used-by-g-ir-scanner
Created attachment 205539 [details] [review] Take-in-account-XDG_DATA_DIRS
Review of attachment 205538 [details] [review]: Looks good
Review of attachment 205539 [details] [review]: Looks good as well
Review of attachment 205539 [details] [review]: I'm nervous about this patch . While I think it's technically correct, there are a *lot* of projects which reuse introspection.m4, and I'm worried that it might e.g. conflict if specified multiple times, or cause something else to break. g-ir-scanner is not the only bit of code that reuses XDG_DATA_DIRS; some of the gsettings tools do too. I think if project-wide correctness on this front is desirable, we should patch each project which uses introspection.m4 to do it, or maybe have a separate xdg.m4. Note that this isn't a problem for jhbuild because it keeps the setting for XDG_DATA_DIRS during the build as well, not just during configure. I suggest your build system do the same - that way it behaves in the same way as jhbuild (the official GNOME build system), and you shouldn't run into any problems like this in the future. I'm not permanently rejecting this patch - I'm willing to reconsider, but we should discuss more.
Using PKG_CONFIG_PATH=/opt/memphis-0.2.3/lib/pkgconfig ./configure XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/memphis-0.2.3/share make instead of XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/memphis-0.2.3/share PKG_CONFIG_PATH=/opt/memphis-0.2.3/lib/pkgconfig ./configure make seems ok to me. So in my opinion, the status of this bug report should be "resolved" :) By the way the error message is missing in the initial description, here it is: Couldn't find include 'Memphis-0.2.gir' (search path: ['/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0'])
(In reply to comment #6) > So in my opinion, the status of this bug report should be "resolved" :) Great, thanks!
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]