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 639782 - [introspection] fails to follow --prefix in make install
[introspection] fails to follow --prefix in make install
Status: RESOLVED DUPLICATE of bug 728146
Product: gobject-introspection
Classification: Platform
Component: build
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-01-17 20:52 UTC by Olivier Crête
Modified: 2018-01-25 17:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Install typelib and girfiles following the package's --prefix (1.60 KB, patch)
2011-01-17 20:55 UTC, Olivier Crête
needs-work Details | Review
Allow using AC_ARG_VAR to override pkg-config variables (3.22 KB, patch)
2012-05-06 22:59 UTC, Evan Nemerson
none Details | Review

Description Olivier Crête 2011-01-17 20:52:09 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
Comment 1 Olivier Crête 2011-01-17 20:55:20 UTC
Created attachment 178563 [details] [review]
Install typelib and girfiles following the package's --prefix
Comment 2 Evan Nemerson 2012-05-06 22:59:36 UTC
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.
Comment 3 Emmanuel Pacaud 2012-05-07 09:00:59 UTC
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.
Comment 4 André Klapper 2015-02-07 17:15:29 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 5 Colin Walters 2015-02-20 15:17:06 UTC
(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.
Comment 6 Colin Walters 2015-02-20 15:21:51 UTC
Attachment 178563 [details] pushed as a16797f - Install typelib and girfiles following the package's --prefix
Comment 7 Ting-Wei Lan 2015-02-22 04:48:34 UTC
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.
Comment 8 Colin Walters 2015-02-22 16:17:42 UTC
(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 9 Philip Withnall 2015-03-13 09:18:17 UTC
Comment on attachment 178563 [details] [review]
Install typelib and girfiles following the package's --prefix

Marking as needs-work as per comment #7.
Comment 10 Emmanuele Bassi (:ebassi) 2018-01-25 17:06:11 UTC
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 ***