GNOME Bugzilla – Bug 639782
[introspection] fails to follow --prefix in make install
Last modified: 2018-01-25 17:06:11 UTC
It tries to install .gir files to /usr/share/.. even if I build with --prefix which fails my "make distcheck". Same applies to the typelib directory Patch follows
Created attachment 178563 [details] [review] Install typelib and girfiles following the package's --prefix
Created attachment 213557 [details] [review] Allow using AC_ARG_VAR to override pkg-config variables Alternate approach. I like Olivier's way better, but it would break backwards compatibility and I'm not sure that's allowed. Furthermore, unless g-i handles multiple directories (e.g., /usr/lib/girepository-1.0 and /usr/local/lib/girepository-1.0) well, and AFAIK it doesn't, it could be a source of a lot of confusion.
It looks like (that' what google says) not a lot of library are using INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR in their Makefile.am files, probably partly because of this issue. libgda uses a configure option as a workaround. Those who are using INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR (sqlheavy, grilo), don't propose a nice solution for a complete installation in --prefix ( user has to use make install INTROSPECTION_GIRDIR=gir/path INTROSPECTION_TYPELIBDIR=typelib/dir). I would say the first patch is preferable.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
(In reply to Evan Nemerson from comment #2) > Created attachment 213557 [details] [review] [review] > Allow using AC_ARG_VAR to override pkg-config variables > > Alternate approach. I like Olivier's way better, but it would break > backwards compatibility and I'm not sure that's allowed. It would change behavior, but only in what I consider non-production use cases. People hitting this are presumably doing jhbuild + system install of g-i. And jhbuild itself takes care of setting up environment variables so this works at runtime.
Attachment 178563 [details] pushed as a16797f - Install typelib and girfiles following the package's --prefix
This patch doesn't work because ${datadir} is expanded to ${datarootdir}, not the path that can be used outside the configure script. Therefore, the command sent to pkg-config is: pkg-config --variable=girdir --define-variable=datadir=${datarootdir} gobject-introspection-1.0 It returns /gir-1.0 because ${datarootdir} is not defined in gobject-introspection-1.0.pc. This problem causes some modules to install .gir and .typelib files in wrong locations.
(In reply to Ting-Wei Lan from comment #7) > This patch doesn't work because ${datadir} is expanded to ${datarootdir}, > not the path that can be used outside the configure script. Therefore, the > command sent to pkg-config is: > > pkg-config --variable=girdir --define-variable=datadir=${datarootdir} > gobject-introspection-1.0 > > It returns /gir-1.0 because ${datarootdir} is not defined in > gobject-introspection-1.0.pc. This problem causes some modules to install > .gir and .typelib files in wrong locations. Thanks for the report. Since it's so late in the cycle, I've reverted the patch for now until we have time to do a full tested solution.
Comment on attachment 178563 [details] [review] Install typelib and girfiles following the package's --prefix Marking as needs-work as per comment #7.
Libraries should always install introspection data in their *own* prefix; consumers with separate prefixes should use XDG_DATA_DIRS and GI_TYPELIB_PATH to override the search paths for everything — just like we do in tools like jhbuild. *** This bug has been marked as a duplicate of bug 728146 ***