After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668193 - introspection.m4: take in account XDG_DATA_DIRS
introspection.m4: take in account XDG_DATA_DIRS
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-01-18 16:24 UTC by Pierre-Louis Bonicoli
Modified: 2015-02-07 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix-path-used-by-g-ir-scanner (896 bytes, patch)
2012-01-18 16:25 UTC, Pierre-Louis Bonicoli
committed Details | Review
Take-in-account-XDG_DATA_DIRS (668 bytes, patch)
2012-01-18 16:25 UTC, Pierre-Louis Bonicoli
needs-work Details | Review

Description Pierre-Louis Bonicoli 2012-01-18 16:24:20 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.
Comment 1 Pierre-Louis Bonicoli 2012-01-18 16:25:04 UTC
Created attachment 205538 [details] [review]
Fix-path-used-by-g-ir-scanner
Comment 2 Pierre-Louis Bonicoli 2012-01-18 16:25:24 UTC
Created attachment 205539 [details] [review]
Take-in-account-XDG_DATA_DIRS
Comment 3 Johan (not receiving bugmail) Dahlin 2012-03-31 17:40:16 UTC
Review of attachment 205538 [details] [review]:

Looks good
Comment 4 Johan (not receiving bugmail) Dahlin 2012-03-31 17:41:25 UTC
Review of attachment 205539 [details] [review]:

Looks good as well
Comment 5 Colin Walters 2012-10-27 15:43:11 UTC
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.
Comment 6 Pierre-Louis Bonicoli 2012-10-27 17:16:59 UTC
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'])
Comment 7 Colin Walters 2012-10-30 13:32:18 UTC
(In reply to comment #6)

> So in my opinion, the status of this bug report should be "resolved" :)

Great, thanks!
Comment 8 André Klapper 2015-02-07 16:55:13 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]