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 794820 - Avoid hard dependencies of GTK+ 4 on GStreamer ...and GTK+ 3
Avoid hard dependencies of GTK+ 4 on GStreamer ...and GTK+ 3
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: module sets
unspecified
Other All
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2018-03-29 20:13 UTC by Daniel Boles
Modified: 2018-04-03 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core-deps: Allow building GTK+ 4 without GStreamer (1.62 KB, patch)
2018-04-03 17:31 UTC, Daniel Boles
committed Details | Review
deps: Drop gtk+-3 to suggests for gst-plugins-base (1.41 KB, patch)
2018-04-03 17:32 UTC, Daniel Boles
committed Details | Review

Description Daniel Boles 2018-03-29 20:13:39 UTC
I'm told that GTK+ can be built without depending on GStreamer by passing -Dmedia=none, but we unconditionally require GStreamer and its plugins in the Meson module.

If building without these deps can be done, we should support it. GStreamer is currently broken on my system (Debian unstable, generating lots of compile-time errors), but I still need to test other changes I'm making to GTK+.

It looks like this should be fine; GTK+'s modules/media/meson.build does this:

if media_backends.contains('gstreamer')
  gstplayer_dep = dependency('gstreamer-player-1.0', version: '>= 1.12.3', required: true)
  cdata.set('HAVE_GSTREAMER', 1)

I guess the detail here is we would like the condition name to be, etc. I guess no-gstreamer would make the most sense, but maybe people will want something different?
Comment 1 Daniel Boles 2018-03-29 20:19:00 UTC
These deps were added in commit b9cda5825ca76e8ac07451a3c46b0c7060ce3c8c, so CCing for thoughts :)
Comment 2 Ting-Wei Lan 2018-04-01 09:42:15 UTC
The commit I pushed was meant to backport changes from gnome-build-meta. I didn't think of this issue when I made the change.

Do you think moving gstreamer from 'dependencies' to 'suggests' is sufficient, or we must add a condition for it? Personally I don't like 'no'-prefixed names because it is usually clearer to add an option to the default and check it by '<if condition-unset="name">'.

The name 'gstreamer' is also unclear to me because a condition applies to all modules and gstreamer is used by a lot of modules. Having a 'gstreamer' condition which is only useful in GTK+ may look confusing.
Comment 3 Daniel Boles 2018-04-01 10:09:53 UTC
Ah, of course (moduleset noob here): `suggests` should be fine; if a user doesn't have GStreamer but does try to build with it, the problem will be pretty obvious, but users could deliberately opt out (via `module_mesonargs`) and have it work.

Also, yeah, I wasn't having much luck thinking of a good condition name that wasn't either too vague or too specific... so that's probably best avoided.

I'll try a patch with `suggests` locally once all the other roadblocks are clear.
Comment 4 Daniel Boles 2018-04-01 10:53:08 UTC
also: gtk+ depends on gst-plugins-base, which depends on gtk+-3... so now GTK+ 4 also builds GTK+ 3. That seems... not ideal
Comment 5 Daniel Boles 2018-04-01 11:19:46 UTC
gst-plugins-base only wants gtk+-3 optionally for examples.

So, correct me if I'm wrong, the fix would be to move gtk+-3 to a suggests in gst-plugins-base, then build gtk+ with --ignore-suggests?
Comment 6 Ting-Wei Lan 2018-04-01 15:07:39 UTC
(In reply to Daniel Boles from comment #5)
> gst-plugins-base only wants gtk+-3 optionally for examples.

Thanks for finding this. I wasn't aware of this problem.

> So, correct me if I'm wrong, the fix would be to move gtk+-3 to a suggests
> in gst-plugins-base, then build gtk+ with --ignore-suggests?

This sounds good to me.
Comment 7 Daniel Boles 2018-04-03 17:31:43 UTC
Created attachment 370495 [details] [review]
core-deps: Allow building GTK+ 4 without GStreamer

We can invoke Meson on gtk+ with -Dmedia=none to avoid GStreamer, so
move it and its plugins to be suggests rather than hard dependencies.
Comment 8 Daniel Boles 2018-04-03 17:32:03 UTC
Created attachment 370496 [details] [review]
deps: Drop gtk+-3 to suggests for gst-plugins-base

These GStreamer plugins build examples with GTK+ 3, but those are non-
essential, so we should avoid building GTK+ 3 if not needed or wanted,
especially because gst-plugins-base can now be pulled in by GTK+ 4…
Comment 9 Daniel Boles 2018-04-03 17:36:04 UTC
This seems fine for me, but of course reopen with any improvements (or gotchas?)

Attachment 370495 [details] pushed as b9785ad - core-deps: Allow building GTK+ 4 without GStreamer
Attachment 370496 [details] pushed as bd6ac88 - deps: Drop gtk+-3 to suggests for gst-plugins-base