GNOME Bugzilla – Bug 794709
meson: allow wrapping glib-networking as a subproject
Last modified: 2018-03-28 19:35:55 UTC
Created attachment 370165 [details] [review] see commit message Provide fallbacks to the required dependencies, and specify implicit dependencies (gobject, gmodule), as this is required when building against an internal dependency with meson.
Review of attachment 370165 [details] [review]: Can you explain a bit what this does and how it is expected to work? ::: meson.build @@ +55,3 @@ +if glib_dep.type_name() == 'internal' + glib_proj = subproject('glib') + gio_module_dir = glib_proj.get_variable('glib_giomodulesdir') This will result in installing outside the build prefix, which is not OK.
(In reply to Michael Catanzaro from comment #1) > Review of attachment 370165 [details] [review] [review]: > > Can you explain a bit what this does and how it is expected to work? > > ::: meson.build > @@ +55,3 @@ > +if glib_dep.type_name() == 'internal' > + glib_proj = subproject('glib') > + gio_module_dir = glib_proj.get_variable('glib_giomodulesdir') This is obtaining the glib_giomodulesdir variable from the glib subproject, if the glib dependency is "internal", ie is getting built as another subproject alongside glib-networking. > > This will result in installing outside the build prefix, which is not OK. It will not, this variable is the one that is passed when building glib's pc file, for reference when building without specifying a prefix, its value is "/usr/local/lib/gio/modules", which is OK
(In reply to Mathieu Duponchelle from comment #2) > This is obtaining the glib_giomodulesdir variable from the glib subproject, > if the glib dependency is "internal", ie is getting built as another > subproject alongside glib-networking. I don't understand: what does this mean? Is there meson documentation for it? glib-networking is not a subproject nor does it have any subprojects. > > This will result in installing outside the build prefix, which is not OK. > > It will not, this variable is the one that is passed when building glib's pc > file, for reference when building without specifying a prefix, its value is > "/usr/local/lib/gio/modules", which is OK That's actually not OK, that's a meson bug. When glib is built with Autotools, you'll notice the definition of giomodulesdir is relative to other pkg-config variables (libdir and prefix) and so can be adjusted relative to a new prefix. When built with meson, we just get a hardcoded path. glib's prefix can be different from glib-networking's prefix, and we want to always install under glib-networking's prefix: that's why we have to redefine the pkg-config variable. I'm going to make this patch as needs-work for this reason. If glib is built with meson, then you cannot look at the pkg-config variable at all until meson is fixed. In the meantime, you'll just have to hardcode the proper path here.
(In reply to Michael Catanzaro from comment #3) > I'm going to make this patch as needs-work > for this reason. I meant "mark"
You might want to take a look at meson's documentation for subprojects, I don't think it is the role of the patch to explain how meson works :) In the case where glib is built as a subproject *alongside* glib-networking, they will share the same prefix, making your concerns unfounded.
Review of attachment 370165 [details] [review]: OK, fair enough
Thanks :)