From: Eunhye Choi Date: Tue, 15 Feb 2022 07:56:34 +0000 (+0900) Subject: build: downgrade of meson X-Git-Tag: submit/tizen/20220216.051033~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b8d85d2d7268312a7e6ba40d08d53a0ffd7f209;p=platform%2Fupstream%2Fgstreamer.git build: downgrade of meson - downgrade of meson temporarily for SR verification. - this will be reverted as soon as meson 0.60.3 is applied at tizen_base. Change-Id: I458e1907c36011c45efc6cf9a49292eac281fabd --- diff --git a/meson.build b/meson.build index 45ff5e26c5..a3cd1511dd 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('gstreamer-full', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : ['buildtype=debugoptimized', # Needed due to https://github.com/mesonbuild/meson/issues/1889, # but this can cause problems in the future. Remove it @@ -156,6 +156,10 @@ foreach sp : subprojects orc_update_targets += subproj.get_variable('orc_update_targets', []) subprojects_names += [project_name] + cmdres = run_command(python3, '-c', symlink.format(project_name, meson.current_source_dir())) + if cmdres.returncode() == 0 + message('Created symlink to ' + project_name) + endif if not meson.is_cross_build() and build_infos.get('build-hotdoc', false) if plugins.length() > 0 @@ -224,24 +228,13 @@ if documented_projects != '' endif all_plugins_paths = [] -all_plugins_dirs = [] foreach plugin: all_plugins all_plugins_paths += plugin.full_path() - all_plugins_dirs += fs.parent(plugin.full_path()) endforeach # Work around meson bug: https://github.com/mesonbuild/meson/pull/6770 pathsep = host_machine.system() == 'windows' ? ';' : ':' all_plugins_paths = pathsep.join(all_plugins_paths) -devenv = environment() -devenv.set('GST_PLUGIN_PATH', all_plugins_dirs) -devenv.set('CURRENT_GST', meson.current_source_dir()) -devenv.set('GST_VERSION', meson.project_version()) -devenv.set('GST_ENV', 'gst-' + meson.project_version()) -devenv.set('GST_REGISTRY', meson.current_build_dir() / 'registry.dat') -devenv.set('GST_PLUGIN_SYSTEM_PATH', '') -meson.add_devenv(devenv) - generate_plugins_paths = find_program('scripts/generate_plugins_path.py') configure_file( output : 'GstPluginsPath.json', @@ -328,7 +321,7 @@ if get_option('default_library') == 'static' elif cc.get_id() == 'msvc' warning('FIXME: Provide a def file to publish the public symbols') else - warning('FIXME: Linker does not support the supplied version script (' + symbol_map + '), please disable the "gst-full-version-script" option') + error('Failed to link with version script (' + symbol_map + '), check logs for details') endif endif @@ -377,15 +370,23 @@ if get_option('default_library') == 'static' meson.override_dependency('gstreamer-full-1.0', gst_full_dep) endif +foreach custom_subproj: get_option('custom_subprojects').split(',') + if custom_subproj != '' + message ('Adding custom subproject ' + custom_subproj) + subproject(custom_subproj) + subprojects_names += [custom_subproj] + endif +endforeach + message('Building subprojects: ' + ', '.join(subprojects_names)) setenv = find_program('gst-env.py') -devenv_cmd = [setenv, '--builddir=@0@'.format(meson.project_build_root()), +devenv_cmd = [setenv, '--builddir=@0@'.format(meson.build_root()), '--gstbuilddir=@0@'.format(meson.current_build_dir()), - '--srcdir=@0@'.format(meson.project_source_root())] + '--srcdir=@0@'.format(meson.source_root())] subdir('tests') -if meson.can_run_host_binaries() and build_machine.system() == 'linux' and host_machine.system() == 'windows' +if meson.has_exe_wrapper() and build_machine.system() == 'linux' and host_machine.system() == 'windows' # FIXME: Ideally we could get the wrapper directly from meson devenv_cmd += ['--wine', host_machine.cpu_family() == 'x86_64' ? 'wine64' : 'wine32'] sysroot = meson.get_cross_property('sys_root') diff --git a/meson_options.txt b/meson_options.txt index cd2ff15ef0..df785d3f52 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -34,10 +34,6 @@ option('gst-full-device-providers', type : 'string', value : '', option('gst-full-dynamic-types', type : 'string', value : '', description : '''List of dynamic types to expose in gstreamer-full's ABI with the syntax plugin:dt1,dt2. By default '' will export all device provider of the enabled plugin.''') -# License-related feature options -option('gpl', type: 'feature', value: 'disabled', - description: 'Allow build of plugins that have (A)GPL-licensed dependencies') - # Common options, automatically inherited by subprojects option('tests', type : 'feature', value : 'auto', description : 'Build tests') option('examples', type : 'feature', value : 'auto', description : 'Build examples') diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 5f8a704f28..37d5a632a5 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -66,7 +66,7 @@ Group: Multimedia/Framework Url: http://gstreamer.freedesktop.org/ Source0: gstreamer-%{version}.tar.gz Source1001: gstreamer.manifest -BuildRequires: meson >= 0.59.0 +BuildRequires: meson >= 0.52.0 BuildRequires: gettext-tools BuildRequires: pkgconfig(glib-2.0) >= 2.32.0 diff --git a/subprojects/gst-editing-services/meson.build b/subprojects/gst-editing-services/meson.build index 8e62442228..6ad18f17f4 100644 --- a/subprojects/gst-editing-services/meson.build +++ b/subprojects/gst-editing-services/meson.build @@ -1,6 +1,6 @@ project('gst-editing-services', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) diff --git a/subprojects/gst-libav/docs/meson.build b/subprojects/gst-libav/docs/meson.build index 5f25f20837..eb2c125987 100644 --- a/subprojects/gst-libav/docs/meson.build +++ b/subprojects/gst-libav/docs/meson.build @@ -14,7 +14,7 @@ if gst_dep.type_name() == 'internal' gst_proj = subproject('gstreamer') plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-libav/meson.build b/subprojects/gst-libav/meson.build index 08473fd6e0..23014614cc 100644 --- a/subprojects/gst-libav/meson.build +++ b/subprojects/gst-libav/meson.build @@ -1,6 +1,6 @@ project('gst-libav', 'c', 'cpp', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) diff --git a/subprojects/gst-omx/docs/meson.build b/subprojects/gst-omx/docs/meson.build index 811929d90d..908b4cfb75 100644 --- a/subprojects/gst-omx/docs/meson.build +++ b/subprojects/gst-omx/docs/meson.build @@ -15,7 +15,7 @@ if gst_dep.type_name() == 'internal' plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else required_hotdoc_extensions += ['gst-extension'] - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-omx/meson.build b/subprojects/gst-omx/meson.build index 89f55fb3bc..1de769887c 100644 --- a/subprojects/gst-omx/meson.build +++ b/subprojects/gst-omx/meson.build @@ -1,6 +1,6 @@ project('gst-omx', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) diff --git a/subprojects/gst-plugins-bad/docs/meson.build b/subprojects/gst-plugins-bad/docs/meson.build index e3f952c187..8ed754c516 100644 --- a/subprojects/gst-plugins-bad/docs/meson.build +++ b/subprojects/gst-plugins-bad/docs/meson.build @@ -31,7 +31,7 @@ if gst_dep.type_name() == 'internal' gst_proj = subproject('gstreamer') plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-plugins-bad/ext/dts/meson.build b/subprojects/gst-plugins-bad/ext/dts/meson.build index e4a5bcbfef..8ab3fc917f 100644 --- a/subprojects/gst-plugins-bad/ext/dts/meson.build +++ b/subprojects/gst-plugins-bad/ext/dts/meson.build @@ -1,10 +1,5 @@ -dts_opt = get_option('dts').require(gpl_allowed, error_message: ''' - Plugin dts explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - # Don't do any dependency checks if disabled -if dts_opt.disabled() +if get_option('dts').disabled() subdir_done() endif @@ -14,7 +9,7 @@ if not dca_dep.found() if cc.has_header_symbol('dca.h', 'dca_init') dca_dep = cc.find_library('dca', required : false) endif - if not dca_dep.found() and dts_opt.enabled() + if not dca_dep.found() and get_option('dts').enabled() error('DTS plugin enabled, but libdca not found') endif endif diff --git a/subprojects/gst-plugins-bad/ext/faad/meson.build b/subprojects/gst-plugins-bad/ext/faad/meson.build index 2e633bd531..e3aefc9076 100644 --- a/subprojects/gst-plugins-bad/ext/faad/meson.build +++ b/subprojects/gst-plugins-bad/ext/faad/meson.build @@ -1,22 +1,12 @@ -faad_opt = get_option('faad').require(gpl_allowed, error_message: ''' - Plugin faad explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - -if faad_opt.disabled() - faad_dep = dependency('', required: false) - subdir_done() -endif - faad_args = [ ] have_faad = cc.has_header_symbol('neaacdec.h', 'NeAACDecOpen') have_faad_2_7 = have_faad and cc.has_header_symbol('neaacdec.h', 'LATM') -if have_faad and not have_faad_2_7 and faad_opt.enabled() +if have_faad and not have_faad_2_7 and get_option('faad').enabled() message('Found faad2, but too old (< v2.7.0)') endif -faad_dep = cc.find_library('faad', required : faad_opt) +faad_dep = cc.find_library('faad', required : get_option('faad')) if faad_dep.found() and have_faad_2_7 gstfaad = library('gstfaad', diff --git a/subprojects/gst-plugins-bad/ext/iqa/meson.build b/subprojects/gst-plugins-bad/ext/iqa/meson.build index 08d37a3509..75e07fc445 100644 --- a/subprojects/gst-plugins-bad/ext/iqa/meson.build +++ b/subprojects/gst-plugins-bad/ext/iqa/meson.build @@ -1,9 +1,4 @@ -iqa_opt = get_option('iqa').require(gpl_allowed, error_message: ''' - Plugin iqa explicitly required via options but (A)GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow (A)GPL-licensed plugins to be built. - ''') - -dssim_dep = dependency('dssim', required: iqa_opt, +dssim_dep = dependency('dssim', required : get_option('iqa'), fallback: ['dssim', 'dssim_dep']) if dssim_dep.found() diff --git a/subprojects/gst-plugins-bad/ext/mpeg2enc/meson.build b/subprojects/gst-plugins-bad/ext/mpeg2enc/meson.build index 325df936dc..af99bd564c 100644 --- a/subprojects/gst-plugins-bad/ext/mpeg2enc/meson.build +++ b/subprojects/gst-plugins-bad/ext/mpeg2enc/meson.build @@ -1,26 +1,21 @@ -mpeg2enc_opt = get_option('mpeg2enc').require(gpl_allowed, error_message: ''' - Plugin mpeg2enc explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - # mjpegtools upstream breaks API constantly and doesn't export the version in # a header anywhere. The configure file has a lot of logic to support old # versions, but it all seems untested and broken. Require 2.0.0. Can be changed # if someone complains. -mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : mpeg2enc_opt) -mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : mpeg2enc_opt) +mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : get_option('mpeg2enc')) +mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : get_option('mpeg2enc')) -if mjpegtools_dep.found() and mpeg2enc_dep.found() - no_warn_args = [] - foreach arg : [ - '-Wno-mismatched-tags', # mjpeg headers get class/struct mixed up - '-Wno-header-guard', - ] - if cxx.has_argument(arg) - no_warn_args += [arg] - endif - endforeach +no_warn_args = [] +foreach arg : [ + '-Wno-mismatched-tags', # mjpeg headers get class/struct mixed up + '-Wno-header-guard', + ] + if cxx.has_argument(arg) + no_warn_args += [arg] + endif +endforeach +if mjpegtools_dep.found() and mpeg2enc_dep.found() gstmpeg2enc = library('gstmpeg2enc', 'gstmpeg2enc.cc', 'gstmpeg2encoptions.cc', diff --git a/subprojects/gst-plugins-bad/ext/mplex/meson.build b/subprojects/gst-plugins-bad/ext/mplex/meson.build index 38a017e12f..a1ac6ac57d 100644 --- a/subprojects/gst-plugins-bad/ext/mplex/meson.build +++ b/subprojects/gst-plugins-bad/ext/mplex/meson.build @@ -1,11 +1,6 @@ -mplex_opt = get_option('mplex').require(gpl_allowed, error_message: ''' - Plugin mplex explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - -# See: ext/mplex for note about mjpegtools dep -mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : mplex_opt) -mplex2_dep = cxx.find_library('mplex2', required : mplex_opt) +# See: ext/mpeg2enc for note about mjpegtools dep +mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : get_option('mplex')) +mplex2_dep = cxx.find_library('mplex2', required : get_option('mplex')) if mjpegtools_dep.found() and mplex2_dep.found() gstmplex2 = library('gstmplex', diff --git a/subprojects/gst-plugins-bad/ext/resindvd/meson.build b/subprojects/gst-plugins-bad/ext/resindvd/meson.build index b7c901b505..06c216a33b 100644 --- a/subprojects/gst-plugins-bad/ext/resindvd/meson.build +++ b/subprojects/gst-plugins-bad/ext/resindvd/meson.build @@ -1,8 +1,3 @@ -resindvd_opt = get_option('resindvd').require(gpl_allowed, error_message: ''' - Plugin resindvd explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - resindvd_sources = [ 'gstmpegdemux.c', 'gstmpegdesc.c', @@ -15,8 +10,8 @@ resindvd_sources = [ 'rsnparsetter.c', ] -dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : resindvd_opt) -dvdread_dep = dependency('dvdread', version : '>= 4.1.2', required : resindvd_opt) +dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : get_option('resindvd')) +dvdread_dep = dependency('dvdread', version : '>= 4.1.2', required : get_option('resindvd')) if dvdnav_dep.found() and dvdread_dep.found() gstresindvd = library('gstresindvd', diff --git a/subprojects/gst-plugins-bad/ext/wayland/meson.build b/subprojects/gst-plugins-bad/ext/wayland/meson.build index a3ffb70d84..75800b287b 100644 --- a/subprojects/gst-plugins-bad/ext/wayland/meson.build +++ b/subprojects/gst-plugins-bad/ext/wayland/meson.build @@ -11,7 +11,7 @@ wl_sources = [ libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required:get_option('wayland')) if use_wayland - protocols_datadir = wl_protocol_dep.get_variable('pkgdatadir') + protocols_datadir = wl_protocol_dep.get_pkgconfig_variable('pkgdatadir') protocol_defs = [ ['/stable/viewporter/viewporter.xml', 'viewporter-protocol.c', 'viewporter-client-protocol.h'], diff --git a/subprojects/gst-plugins-bad/ext/x265/meson.build b/subprojects/gst-plugins-bad/ext/x265/meson.build index 9743803868..b664caebf8 100644 --- a/subprojects/gst-plugins-bad/ext/x265/meson.build +++ b/subprojects/gst-plugins-bad/ext/x265/meson.build @@ -1,9 +1,4 @@ -x265_opt = get_option('x265').require(gpl_allowed, error_message: ''' - Plugin x265 explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - -x265_dep = dependency('x265', required: x265_opt) +x265_dep = dependency('x265', required: get_option('x265')) if x265_dep.found() gstx265 = library('gstx265', 'gstx265enc.c', diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index 3b72173caf..0963ff84a4 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -1,6 +1,6 @@ project('gst-plugins-bad', 'c', 'cpp', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) @@ -321,9 +321,9 @@ gstglegl_dep = dependency('', required : false) if gstgl_dep.found() if gstgl_dep.type_name() == 'pkgconfig' - gst_gl_apis = gstgl_dep.get_variable('gl_apis').split() - gst_gl_winsys = gstgl_dep.get_variable('gl_winsys').split() - gst_gl_platforms = gstgl_dep.get_variable('gl_platforms').split() + gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split() + gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split() + gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms').split() else gstbase = subproject('gst-plugins-base') gst_gl_apis = gstbase.get_variable('enabled_gl_apis') @@ -457,7 +457,7 @@ cdata.set('TIZEN_FEATURE_WEBRTC_IMPORT_NETSIM', true) cdata.set('TIZEN_FEATURE_PITCH_AUDIO_META', true) # For plugins from libnice -libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('nice')) +libnice_dep = dependency('nice', version : '>=0.1.17', required : true) # TIZEN BUILD OPTION end @@ -524,8 +524,6 @@ pkgconfig.generate( description : 'Streaming media framework, bad plugins libraries', ) -gpl_allowed = get_option('gpl').allowed() - subdir('gst-libs') subdir('gst') subdir('sys') @@ -582,16 +580,17 @@ configure_file(output : 'config.h', configuration : cdata) subdir('docs') -plugin_names = [] -foreach plugin: plugins - if plugin.name().startswith('gst') - plugin_names += [plugin.name().substring(3)] - else - plugin_names += [plugin.name()] - endif -endforeach - -summary({ - 'Plugins': plugin_names, - '(A)GPL license allowed': gpl_allowed, -}, list_sep: ', ') +if meson.version().version_compare('>= 0.54') + plugin_names = [] + foreach plugin: plugins + # FIXME: Use str.subtring() when we can depend on Meson 0.56 + split = plugin.name().split('gst') + if split.length() == 2 + plugin_names += [split[1]] + else + warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name()) + plugin_names += [plugin.name()] + endif + endforeach + summary({'Plugins':plugin_names}, list_sep: ', ') +endif diff --git a/subprojects/gst-plugins-bad/meson_options.txt b/subprojects/gst-plugins-bad/meson_options.txt index 7fa60e1223..be0a27bd09 100644 --- a/subprojects/gst-plugins-bad/meson_options.txt +++ b/subprojects/gst-plugins-bad/meson_options.txt @@ -191,10 +191,6 @@ option('sctp-internal-usrsctp', type: 'feature', value : 'enabled', option('mfx_api', type : 'combo', choices : ['MSDK', 'oneVPL', 'auto'], value : 'auto', description : 'Select MFX API to build against') -# License-related feature options -option('gpl', type: 'feature', value: 'disabled', yield: true, - description: 'Allow build plugins that have (A)GPL-licensed dependencies') - # Common feature options option('examples', type : 'feature', value : 'auto', yield : true) option('tests', type : 'feature', value : 'auto', yield : true) diff --git a/subprojects/gst-plugins-base/docs/meson.build b/subprojects/gst-plugins-base/docs/meson.build index 328e5aaa4e..69f9438326 100644 --- a/subprojects/gst-plugins-base/docs/meson.build +++ b/subprojects/gst-plugins-base/docs/meson.build @@ -33,7 +33,7 @@ if gst_dep.type_name() == 'internal' gst_proj = subproject('gstreamer') plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-plugins-base/ext/ogg/meson.build b/subprojects/gst-plugins-base/ext/ogg/meson.build index d6b133bff9..4ff7b6b27d 100644 --- a/subprojects/gst-plugins-base/ext/ogg/meson.build +++ b/subprojects/gst-plugins-base/ext/ogg/meson.build @@ -10,7 +10,7 @@ ogg_sources = [ 'vorbis_parse.c', ] -ogg_dep = dependency('ogg', allow_fallback: true, version : '>=1.0', required : get_option('ogg')) +ogg_dep = dependency('ogg', version : '>=1.0', required : get_option('ogg')) core_conf.set('HAVE_OGG', ogg_dep.found()) if ogg_dep.found() diff --git a/subprojects/gst-plugins-base/ext/vorbis/meson.build b/subprojects/gst-plugins-base/ext/vorbis/meson.build index 23fdf373c9..a55249acc6 100644 --- a/subprojects/gst-plugins-base/ext/vorbis/meson.build +++ b/subprojects/gst-plugins-base/ext/vorbis/meson.build @@ -17,9 +17,9 @@ vorbisidec_sources = [ 'gstvorbiscommon.c', ] -vorbis_dep = dependency('vorbis', version : '>= 1.3.1', allow_fallback: true, required : get_option('vorbis')) -vorbisenc_dep = dependency('vorbisenc', version : '>= 1.3.1', allow_fallback: true, required : get_option('vorbis')) -vorbisidec_dep = dependency('vorbisidec', allow_fallback: true, required : get_option('tremor')) +vorbis_dep = dependency('vorbis', version : '>= 1.3.1', required : get_option('vorbis')) +vorbisenc_dep = dependency('vorbisenc', version : '>= 1.3.1', required : get_option('vorbis')) +vorbisidec_dep = dependency('vorbisidec', required : get_option('tremor')) if vorbis_dep.found() vorbis_deps = [vorbis_dep] diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build index b3536475e5..b44f2b2306 100644 --- a/subprojects/gst-plugins-base/meson.build +++ b/subprojects/gst-plugins-base/meson.build @@ -1,6 +1,6 @@ project('gst-plugins-base', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) @@ -329,11 +329,11 @@ core_conf.set('HAVE_GIO_UNIX_2_0', giounix_dep.found()) if gio_dep.type_name() == 'pkgconfig' core_conf.set_quoted('GIO_MODULE_DIR', - gio_dep.get_variable('giomoduledir')) + gio_dep.get_pkgconfig_variable('giomoduledir')) core_conf.set_quoted('GIO_LIBDIR', - gio_dep.get_variable('libdir')) + gio_dep.get_pkgconfig_variable('libdir')) core_conf.set_quoted('GIO_PREFIX', - gio_dep.get_variable('prefix')) + gio_dep.get_pkgconfig_variable('prefix')) else core_conf.set_quoted('GIO_MODULE_DIR', join_paths(get_option('prefix'), get_option('libdir'), 'gio/modules')) @@ -566,15 +566,17 @@ endif # Use core_conf after all subdirs have set values configure_file(output : 'config.h', configuration : core_conf) -plugin_names = [] -foreach plugin: plugins - if plugin.name().startswith('gst') - plugin_names += [plugin.name().substring(3)] - else - plugin_names += [plugin.name()] - endif -endforeach - -summary({ - 'Plugins': plugin_names, -}, list_sep: ', ') +if meson.version().version_compare('>= 0.54') + plugin_names = [] + foreach plugin: plugins + # FIXME: Use str.subtring() when we can depend on Meson 0.56 + split = plugin.name().split('gst') + if split.length() == 2 + plugin_names += [split[1]] + else + warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name()) + plugin_names += [plugin.name()] + endif + endforeach + summary({'Plugins':plugin_names}, list_sep: ', ') +endif diff --git a/subprojects/gst-plugins-base/tests/meson.build b/subprojects/gst-plugins-base/tests/meson.build index e10aa9a687..25bd3497fb 100644 --- a/subprojects/gst-plugins-base/tests/meson.build +++ b/subprojects/gst-plugins-base/tests/meson.build @@ -1,7 +1,7 @@ pluginsdirs = [] if gst_dep.type_name() == 'pkgconfig' - pluginsdirs = [gst_dep.get_variable('pluginsdir')] - gst_plugin_scanner_dir = gst_dep.get_variable('pluginscannerdir') + pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')] + gst_plugin_scanner_dir = gst_dep.get_pkgconfig_variable('pluginscannerdir') else gst_plugin_scanner_dir = gst_proj.get_variable('gst_scanner_dir') endif diff --git a/subprojects/gst-plugins-good/docs/meson.build b/subprojects/gst-plugins-good/docs/meson.build index 83c3a273fc..86304ab788 100644 --- a/subprojects/gst-plugins-good/docs/meson.build +++ b/subprojects/gst-plugins-good/docs/meson.build @@ -14,7 +14,7 @@ if gst_dep.type_name() == 'internal' gst_proj = subproject('gstreamer') plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-plugins-good/meson.build b/subprojects/gst-plugins-good/meson.build index 482df0e943..546e250678 100644 --- a/subprojects/gst-plugins-good/meson.build +++ b/subprojects/gst-plugins-good/meson.build @@ -1,6 +1,6 @@ project('gst-plugins-good', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) @@ -299,9 +299,9 @@ have_gstgl = gstgl_dep.found() if have_gstgl if gstgl_dep.type_name() == 'pkgconfig' - gst_gl_apis = gstgl_dep.get_variable('gl_apis').split() - gst_gl_winsys = gstgl_dep.get_variable('gl_winsys').split() - gst_gl_platforms = gstgl_dep.get_variable('gl_platforms').split() + gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split() + gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split() + gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms').split() else gstbase = subproject('gst-plugins-base') gst_gl_apis = gstbase.get_variable('enabled_gl_apis') @@ -536,15 +536,17 @@ endif configure_file(output : 'config.h', configuration : cdata) -plugin_names = [] -foreach plugin: plugins - if plugin.name().startswith('gst') - plugin_names += [plugin.name().substring(3)] - else - plugin_names += [plugin.name()] - endif -endforeach - -summary({ - 'Plugins': plugin_names, -}, list_sep: ', ') +if meson.version().version_compare('>= 0.54') + plugin_names = [] + foreach plugin: plugins + # FIXME: Use str.subtring() when we can depend on Meson 0.56 + split = plugin.name().split('gst') + if split.length() == 2 + plugin_names += [split[1]] + else + warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name()) + plugin_names += [plugin.name()] + endif + endforeach + summary({'Plugins':plugin_names}, list_sep: ', ') +endif diff --git a/subprojects/gst-plugins-ugly/docs/meson.build b/subprojects/gst-plugins-ugly/docs/meson.build index f71d07bb96..1c67d8c701 100644 --- a/subprojects/gst-plugins-ugly/docs/meson.build +++ b/subprojects/gst-plugins-ugly/docs/meson.build @@ -15,7 +15,7 @@ if gst_dep.type_name() == 'internal' gst_proj = subproject('gstreamer') plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-plugins-ugly/ext/a52dec/meson.build b/subprojects/gst-plugins-ugly/ext/a52dec/meson.build index 68908a7e7f..843bef0910 100644 --- a/subprojects/gst-plugins-ugly/ext/a52dec/meson.build +++ b/subprojects/gst-plugins-ugly/ext/a52dec/meson.build @@ -1,24 +1,22 @@ -a52dec_opt = get_option('a52dec').require(gpl_allowed, error_message: ''' - Plugin a52dec explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') +if get_option('a52dec').disabled() + subdir_done() +endif a52_dep = cc.find_library('a52', required : get_option('a52dec')) -if a52_dep.found() - have_a52_h = cc.has_header_symbol('a52dec/a52.h', 'a52_init', prefix : '#include ') +have_a52_h = cc.has_header_symbol('a52dec/a52.h', 'a52_init', prefix : '#include ') +if not have_a52_h and get_option('a52dec').enabled() + error('a52dec plugin enabled but a52.h not found') +endif - if have_a52_h - a52dec = library('gsta52dec', - 'gsta52dec.c', - c_args : ugly_args, - include_directories : [configinc], - dependencies : [gstaudio_dep, orc_dep, a52_dep], - install : true, - install_dir : plugins_install_dir, - ) - pkgconfig.generate(a52dec, install_dir : plugins_pkgconfig_install_dir) - plugins += [a52dec] - elif a52dec_opt.enabled() - error('a52dec plugin enabled but a52.h not found') - endif +if a52_dep.found() and have_a52_h + a52dec = library('gsta52dec', + 'gsta52dec.c', + c_args : ugly_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, orc_dep, a52_dep], + install : true, + install_dir : plugins_install_dir, + ) + pkgconfig.generate(a52dec, install_dir : plugins_pkgconfig_install_dir) + plugins += [a52dec] endif diff --git a/subprojects/gst-plugins-ugly/ext/cdio/meson.build b/subprojects/gst-plugins-ugly/ext/cdio/meson.build index 4b21e36012..054d02627c 100644 --- a/subprojects/gst-plugins-ugly/ext/cdio/meson.build +++ b/subprojects/gst-plugins-ugly/ext/cdio/meson.build @@ -1,9 +1,4 @@ -cdio_opt = get_option('cdio').require(gpl_allowed, error_message: ''' - Plugin cdio explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - -cdio_dep = dependency('libcdio', version : '>= 0.76', required : cdio_opt) +cdio_dep = dependency('libcdio', version : '>= 0.76', required : get_option('cdio')) if cdio_dep.found() cdio = library('gstcdio', diff --git a/subprojects/gst-plugins-ugly/ext/dvdread/meson.build b/subprojects/gst-plugins-ugly/ext/dvdread/meson.build index a1cbfdcb38..f075d8462b 100644 --- a/subprojects/gst-plugins-ugly/ext/dvdread/meson.build +++ b/subprojects/gst-plugins-ugly/ext/dvdread/meson.build @@ -1,9 +1,4 @@ -dvdread_opt = get_option('dvdread').require(gpl_allowed, error_message: ''' - Plugin dvdread explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - -dvdread_dep = dependency('dvdread', version : '>= 0.5.0', required : dvdread_opt) +dvdread_dep = dependency('dvdread', version : '>= 0.5.0', required : get_option('dvdread')) if gmodule_dep.found() and dvdread_dep.found() dvdread = library('gstdvdread', diff --git a/subprojects/gst-plugins-ugly/ext/mpeg2dec/meson.build b/subprojects/gst-plugins-ugly/ext/mpeg2dec/meson.build index 77d3ba057b..aa5262ac59 100644 --- a/subprojects/gst-plugins-ugly/ext/mpeg2dec/meson.build +++ b/subprojects/gst-plugins-ugly/ext/mpeg2dec/meson.build @@ -1,9 +1,4 @@ -mpeg2dec_opt = get_option('mpeg2dec').require(gpl_allowed, error_message: ''' - Plugin mpeg2dec explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - -mpeg2_dep = dependency('libmpeg2', version : '>= 0.4.0', required : mpeg2dec_opt) +mpeg2_dep = dependency('libmpeg2', version : '>= 0.4.0', required : get_option('mpeg2dec')) if mpeg2_dep.found() mpeg2dec = library('gstmpeg2dec', diff --git a/subprojects/gst-plugins-ugly/ext/sidplay/meson.build b/subprojects/gst-plugins-ugly/ext/sidplay/meson.build index bc3bc77849..6310652f36 100644 --- a/subprojects/gst-plugins-ugly/ext/sidplay/meson.build +++ b/subprojects/gst-plugins-ugly/ext/sidplay/meson.build @@ -1,7 +1,7 @@ -sidplay_option = get_option('sidplay').require(gpl_allowed, error_message: ''' - Plugin sidplay explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') +sidplay_option = get_option('sidplay') +if sidplay_option.disabled() + subdir_done() +endif if not add_languages('cpp', native: false, required: sidplay_option) subdir_done() diff --git a/subprojects/gst-plugins-ugly/ext/x264/meson.build b/subprojects/gst-plugins-ugly/ext/x264/meson.build index 7fe65f88ee..fdbfeebce5 100644 --- a/subprojects/gst-plugins-ugly/ext/x264/meson.build +++ b/subprojects/gst-plugins-ugly/ext/x264/meson.build @@ -1,14 +1,9 @@ -x264_opt = get_option('x264').require(gpl_allowed, error_message: ''' - Plugin x264 explicitly required via options but GPL-licensed plugins disabled via options. - Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. - ''') - x264_sources = [ 'gstx264enc.c', 'gstencoderbitrateprofilemanager.c', ] -x264_dep = dependency('x264', required : x264_opt, +x264_dep = dependency('x264', required : get_option('x264'), fallback: ['x264', 'libx264_dep']) if x264_dep.found() diff --git a/subprojects/gst-plugins-ugly/meson.build b/subprojects/gst-plugins-ugly/meson.build index a98be6acaa..522bdcd579 100644 --- a/subprojects/gst-plugins-ugly/meson.build +++ b/subprojects/gst-plugins-ugly/meson.build @@ -1,6 +1,6 @@ project('gst-plugins-ugly', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) @@ -292,8 +292,6 @@ if get_option('default_library') == 'shared' plugins_pkgconfig_install_dir = disabler() endif -gpl_allowed = get_option('gpl').allowed() - python3 = import('python').find_installation() subdir('gst') @@ -319,16 +317,17 @@ endif configure_file(output : 'config.h', configuration : cdata) -plugin_names = [] -foreach plugin: plugins - if plugin.name().startswith('gst') - plugin_names += [plugin.name().substring(3)] - else - plugin_names += [plugin.name()] - endif -endforeach - -summary({ - 'Plugins': plugin_names, - '(A)GPL license allowed': gpl_allowed, -}, list_sep: ', ') +if meson.version().version_compare('>= 0.54') + plugin_names = [] + foreach plugin: plugins + # FIXME: Use str.subtring() when we can depend on Meson 0.56 + split = plugin.name().split('gst') + if split.length() == 2 + plugin_names += [split[1]] + else + warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name()) + plugin_names += [plugin.name()] + endif + endforeach + summary({'Plugins':plugin_names}, list_sep: ', ') +endif diff --git a/subprojects/gst-plugins-ugly/meson_options.txt b/subprojects/gst-plugins-ugly/meson_options.txt index a3fc8c4c3c..fac0fef0b6 100644 --- a/subprojects/gst-plugins-ugly/meson_options.txt +++ b/subprojects/gst-plugins-ugly/meson_options.txt @@ -18,10 +18,6 @@ option('mpeg2dec', type : 'feature', value : 'auto', description : 'MPEG 2 video option('sidplay', type : 'feature', value : 'auto', description : 'Commodore 64 audio decoder plugin based on libsidplay (GPL - only built if gpl option is also enabled!)') option('x264', type : 'feature', value : 'auto', description : 'H.264 video encoder plugin based on libx264 (GPL - only built if gpl option is also enabled!)') -# License-related feature options -option('gpl', type: 'feature', value: 'disabled', yield: true, - description: 'Allow build plugins that have GPL-licensed dependencies') - # Common feature options option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)') diff --git a/subprojects/gst-rtsp-server/docs/meson.build b/subprojects/gst-rtsp-server/docs/meson.build index fa649cf077..39d8ec634f 100644 --- a/subprojects/gst-rtsp-server/docs/meson.build +++ b/subprojects/gst-rtsp-server/docs/meson.build @@ -33,7 +33,7 @@ if gst_dep.type_name() == 'internal' plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') else required_hotdoc_extensions += ['gst-extension'] - plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), + plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), required: false) endif diff --git a/subprojects/gst-rtsp-server/meson.build b/subprojects/gst-rtsp-server/meson.build index 35953af72c..5580285244 100644 --- a/subprojects/gst-rtsp-server/meson.build +++ b/subprojects/gst-rtsp-server/meson.build @@ -1,6 +1,6 @@ project('gst-rtsp-server', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : ['warning_level=1', 'buildtype=debugoptimized']) gst_version = meson.project_version() diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build index 7b9b96d331..32b6a83b0e 100644 --- a/subprojects/gstreamer/meson.build +++ b/subprojects/gstreamer/meson.build @@ -1,6 +1,6 @@ project('gstreamer', 'c', version : '1.20.0', - meson_version : '>= 0.59', + meson_version : '>= 0.52', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) @@ -539,7 +539,7 @@ bashcomp_found = false if bashcomp_dep.found() bashcomp_found = true bashcomp_dir_override = bashcomp_dep.version().version_compare('>= 2.10') ? ['datadir', datadir] : ['prefix', prefix] - bash_completions_dir = bashcomp_dep.get_variable('completionsdir', pkgconfig_define: bashcomp_dir_override) + bash_completions_dir = bashcomp_dep.get_pkgconfig_variable('completionsdir', define_variable: bashcomp_dir_override) if bash_completions_dir == '' msg = 'Found bash-completion but the .pc file did not set \'completionsdir\'.' if bashcomp_option.enabled() @@ -550,7 +550,7 @@ if bashcomp_dep.found() bashcomp_found = false endif - bash_helpers_dir = bashcomp_dep.get_variable('helpersdir', pkgconfig_define: bashcomp_dir_override) + bash_helpers_dir = bashcomp_dep.get_pkgconfig_variable('helpersdir', define_variable: bashcomp_dir_override) if bash_helpers_dir == '' msg = 'Found bash-completion, but the .pc file did not set \'helpersdir\'.' if bashcomp_option.enabled() @@ -643,15 +643,17 @@ endif configure_file(output : 'config.h', configuration : cdata) install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal')) -plugin_names = [] -foreach plugin: plugins - if plugin.name().startswith('gst') - plugin_names += [plugin.name().substring(3)] - else - plugin_names += [plugin.name()] - endif -endforeach - -summary({ - 'Plugins': plugin_names, -}, list_sep: ', ') +if meson.version().version_compare('>= 0.54') + plugin_names = [] + foreach plugin: plugins + # FIXME: Use str.subtring() when we can depend on Meson 0.56 + split = plugin.name().split('gst') + if split.length() == 2 + plugin_names += [split[1]] + else + warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name()) + plugin_names += [plugin.name()] + endif + endforeach + summary({'Plugins':plugin_names}, list_sep: ', ') +endif