From 337fee838811f7ebc5bcb1645ea5c5a4249f7d69 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 17 Aug 2024 14:28:35 +0530 Subject: [PATCH] ci: Add a gtk subproject for testing on windows and macos The gstreamer-rs CI needs to build gtk to test the gtk4 plugin in gst-plugins-rs. Formalize support for gtk in the monorepo, and disable it by default because it's not an important dependency; unlike libnice. Part-of: --- .gitlab-ci.yml | 2 ++ meson.build | 14 ++++++++++++++ meson_options.txt | 1 + 3 files changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 11379e4359..41380fe34f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -463,6 +463,7 @@ build debian x86_64: -Dgst-plugins-good:cairo=enabled -Dgst-plugins-good:soup=enabled -Dgst-plugins-bad:d3d11-wgc=enabled + -Dgtk=enabled rules: - !reference [.upstream-branch-rules, rules] - changes: @@ -606,6 +607,7 @@ build macos: -Dgst-plugins-base:pango=enabled -Dgst-plugins-good:cairo=enabled -Dgst-plugins-good:soup=enabled + -Dgtk=enabled # ---- Tests ----- # diff --git a/meson.build b/meson.build index 7646f6cf53..92606e4f4f 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,7 @@ project('gstreamer-full', 'c', apiversion = '1.0' gst_version = '>= @0@'.format(meson.project_version()) +host_system = host_machine.system() build_system = build_machine.system() cc = meson.get_compiler('c') @@ -100,6 +101,18 @@ if get_option('webrtc').enabled() libnice_options += ['gstreamer=enabled'] endif +gtk_options = [ + 'build-demos=false', + 'build-examples=false', + 'build-testsuite=false', + 'build-tests=false', +] +if host_system == 'windows' + gtk_options += ['vulkan=disabled'] +elif host_system == 'darwin' + gtk_options += ['x11-backend=false'] +endif + # Disable gst-python if we've disabled introspection gst_python_option = get_option('python').disable_if(get_option('introspection').disabled()) @@ -121,6 +134,7 @@ subprojects = [ ['pygobject', { 'option': get_option('python'), 'match_gst_version': false, 'sysdep': 'pygobject-3.0', 'sysdep_version': '>= 3.8' }], ['gst-python', { 'option': gst_python_option}], ['gst-examples', { 'option': get_option('gst-examples'), 'match_gst_versions': false}], + ['gtk', {'option': get_option('gtk'), 'match_gst_version': false, 'subproject_options': gtk_options}], ['gst-plugins-rs', { 'option': get_option('rs'), 'build-hotdoc': true, 'match_gst_version': false}], ] diff --git a/meson_options.txt b/meson_options.txt index 15a315b60c..64ecc93e4d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,6 +16,7 @@ option('sharp', type : 'feature', value : 'disabled') # External subprojects option('tls', type : 'feature', value : 'auto', description : 'TLS support using glib-networking as a subproject') option('libnice', type : 'feature', value : 'auto', description: 'ICE support using libnice as a subproject') +option('gtk', type: 'feature', value: 'disabled', description: 'Build GTK4 as a subproject') # Build for fuzzing option('oss_fuzz', type : 'feature', value : 'disabled',