meson: apply latest build script 27/271427/2 submit/tizen/20220222.093450
authorEunhye Choi <eunhae1.choi@samsung.com>
Mon, 21 Feb 2022 06:18:12 +0000 (15:18 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Tue, 22 Feb 2022 09:18:38 +0000 (18:18 +0900)
- revert 5b8d85d2d7268312a7e6ba40d08d53a0ffd7f209
- meson version have to be over 0.59.x

Change-Id: I9466034180183e7b1ee99e44ab6cca27f78e0815

38 files changed:
meson.build
meson_options.txt
packaging/gstreamer.spec
subprojects/gst-editing-services/meson.build
subprojects/gst-libav/docs/meson.build
subprojects/gst-libav/meson.build
subprojects/gst-omx/docs/meson.build
subprojects/gst-omx/meson.build
subprojects/gst-plugins-bad/docs/meson.build
subprojects/gst-plugins-bad/ext/dts/meson.build
subprojects/gst-plugins-bad/ext/faad/meson.build
subprojects/gst-plugins-bad/ext/iqa/meson.build
subprojects/gst-plugins-bad/ext/mpeg2enc/meson.build
subprojects/gst-plugins-bad/ext/mplex/meson.build
subprojects/gst-plugins-bad/ext/resindvd/meson.build
subprojects/gst-plugins-bad/ext/wayland/meson.build
subprojects/gst-plugins-bad/ext/x265/meson.build
subprojects/gst-plugins-bad/meson.build
subprojects/gst-plugins-bad/meson_options.txt
subprojects/gst-plugins-base/docs/meson.build
subprojects/gst-plugins-base/ext/ogg/meson.build
subprojects/gst-plugins-base/ext/vorbis/meson.build
subprojects/gst-plugins-base/meson.build
subprojects/gst-plugins-base/tests/meson.build
subprojects/gst-plugins-good/docs/meson.build
subprojects/gst-plugins-good/meson.build
subprojects/gst-plugins-ugly/docs/meson.build
subprojects/gst-plugins-ugly/ext/a52dec/meson.build
subprojects/gst-plugins-ugly/ext/cdio/meson.build
subprojects/gst-plugins-ugly/ext/dvdread/meson.build
subprojects/gst-plugins-ugly/ext/mpeg2dec/meson.build
subprojects/gst-plugins-ugly/ext/sidplay/meson.build
subprojects/gst-plugins-ugly/ext/x264/meson.build
subprojects/gst-plugins-ugly/meson.build
subprojects/gst-plugins-ugly/meson_options.txt
subprojects/gst-rtsp-server/docs/meson.build
subprojects/gst-rtsp-server/meson.build
subprojects/gstreamer/meson.build

index a3cd151..45ff5e2 100644 (file)
@@ -1,6 +1,6 @@
 project('gstreamer-full', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   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,10 +156,6 @@ 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
@@ -228,13 +224,24 @@ 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',
@@ -321,7 +328,7 @@ if get_option('default_library') == 'static'
     elif cc.get_id() == 'msvc'
       warning('FIXME: Provide a def file to publish the public symbols')
     else
-      error('Failed to link with version script (' + symbol_map + '), check logs for details')
+      warning('FIXME: Linker does not support the supplied version script (' + symbol_map + '), please disable the "gst-full-version-script" option')
     endif
   endif
 
@@ -370,23 +377,15 @@ 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.build_root()),
+devenv_cmd = [setenv, '--builddir=@0@'.format(meson.project_build_root()),
               '--gstbuilddir=@0@'.format(meson.current_build_dir()),
-              '--srcdir=@0@'.format(meson.source_root())]
+              '--srcdir=@0@'.format(meson.project_source_root())]
 
 subdir('tests')
-if meson.has_exe_wrapper() and build_machine.system() == 'linux' and host_machine.system() == 'windows'
+if meson.can_run_host_binaries() 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')
index df785d3..cd2ff15 100644 (file)
@@ -34,6 +34,10 @@ 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')
index d107865..d774736 100644 (file)
 
 Name:           %{_name}
 Version:        1.20.0
-Release:        3
+Release:        4
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
 Url:            http://gstreamer.freedesktop.org/
 Source0:        gstreamer-%{version}.tar.gz
 Source1001:     gstreamer.manifest
-BuildRequires:  meson >= 0.52.0
+BuildRequires:  meson >= 0.59.0
 BuildRequires:  gettext-tools
 BuildRequires:  pkgconfig(glib-2.0) >= 2.32.0
 
index 6ad18f1..8e62442 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-editing-services', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
index eb2c125..5f25f20 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
     required: false)
 endif
 
index 2301461..08473fd 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-libav', 'c', 'cpp',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
index 908b4cf..811929d 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
         required: false)
 endif
 
index 1de7698..89f55fb 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-omx', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
index 8ed754c..e3f952c 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
         required: false)
 endif
 
index 8ab3fc9..e4a5bcb 100644 (file)
@@ -1,5 +1,10 @@
+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 get_option('dts').disabled()
+if dts_opt.disabled()
   subdir_done()
 endif
 
@@ -9,7 +14,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 get_option('dts').enabled()
+  if not dca_dep.found() and dts_opt.enabled()
     error('DTS plugin enabled, but libdca not found')
   endif
 endif
index e3aefc9..2e633bd 100644 (file)
@@ -1,12 +1,22 @@
+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 get_option('faad').enabled()
+if have_faad and not have_faad_2_7 and faad_opt.enabled()
   message('Found faad2, but too old (< v2.7.0)')
 endif
 
-faad_dep = cc.find_library('faad', required : get_option('faad'))
+faad_dep = cc.find_library('faad', required : faad_opt)
 
 if faad_dep.found() and have_faad_2_7
   gstfaad = library('gstfaad',
index 75e07fc..08d37a3 100644 (file)
@@ -1,4 +1,9 @@
-dssim_dep = dependency('dssim', required : get_option('iqa'),
+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,
     fallback: ['dssim', 'dssim_dep'])
 
 if dssim_dep.found()
index af99bd5..325df93 100644 (file)
@@ -1,21 +1,26 @@
+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 : get_option('mpeg2enc'))
-mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : get_option('mpeg2enc'))
-
-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
+mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : mpeg2enc_opt)
+mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : mpeg2enc_opt)
 
 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
+
   gstmpeg2enc = library('gstmpeg2enc',
     'gstmpeg2enc.cc',
     'gstmpeg2encoptions.cc',
index a1ac6ac..38a017e 100644 (file)
@@ -1,6 +1,11 @@
-# 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'))
+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)
 
 if mjpegtools_dep.found() and mplex2_dep.found()
   gstmplex2 = library('gstmplex',
index 06c216a..b7c901b 100644 (file)
@@ -1,3 +1,8 @@
+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',
@@ -10,8 +15,8 @@ resindvd_sources = [
   'rsnparsetter.c',
 ]
 
-dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : get_option('resindvd'))
-dvdread_dep = dependency('dvdread', version : '>= 4.1.2', required : get_option('resindvd'))
+dvdnav_dep = dependency('dvdnav', version : '>= 4.1.2', required : resindvd_opt)
+dvdread_dep = dependency('dvdread', version : '>= 4.1.2', required : resindvd_opt)
 
 if dvdnav_dep.found() and dvdread_dep.found()
   gstresindvd = library('gstresindvd',
index 75800b2..a3ffb70 100644 (file)
@@ -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_pkgconfig_variable('pkgdatadir')
+    protocols_datadir = wl_protocol_dep.get_variable('pkgdatadir')
 
     protocol_defs = [
         ['/stable/viewporter/viewporter.xml', 'viewporter-protocol.c', 'viewporter-client-protocol.h'],
index b664cae..9743803 100644 (file)
@@ -1,4 +1,9 @@
-x265_dep = dependency('x265', required: get_option('x265'))
+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)
 if x265_dep.found()
   gstx265 = library('gstx265',
     'gstx265enc.c',
index 0963ff8..3b72173 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-plugins-bad', 'c', 'cpp',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   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_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()
+    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()
   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 : true)
+libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('nice'))
 
 # TIZEN BUILD OPTION end
 
@@ -524,6 +524,8 @@ pkgconfig.generate(
   description : 'Streaming media framework, bad plugins libraries',
 )
 
+gpl_allowed = get_option('gpl').allowed()
+
 subdir('gst-libs')
 subdir('gst')
 subdir('sys')
@@ -580,17 +582,16 @@ configure_file(output : 'config.h', configuration : cdata)
 
 subdir('docs')
 
-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
+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: ', ')
index be0a27b..7fa60e1 100644 (file)
@@ -191,6 +191,10 @@ 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)
index 69f9438..328e5aa 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
         required: false)
 endif
 
index 4ff7b6b..d6b133b 100644 (file)
@@ -10,7 +10,7 @@ ogg_sources = [
   'vorbis_parse.c',
 ]
 
-ogg_dep = dependency('ogg', version : '>=1.0', required : get_option('ogg'))
+ogg_dep = dependency('ogg', allow_fallback: true, version : '>=1.0', required : get_option('ogg'))
 core_conf.set('HAVE_OGG', ogg_dep.found())
 
 if ogg_dep.found()
index a55249a..23fdf37 100644 (file)
@@ -17,9 +17,9 @@ vorbisidec_sources = [
   'gstvorbiscommon.c',
 ]
 
-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'))
+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'))
 
 if vorbis_dep.found()
   vorbis_deps = [vorbis_dep]
index b44f2b2..b353647 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-plugins-base', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   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_pkgconfig_variable('giomoduledir'))
+        gio_dep.get_variable('giomoduledir'))
     core_conf.set_quoted('GIO_LIBDIR',
-        gio_dep.get_pkgconfig_variable('libdir'))
+        gio_dep.get_variable('libdir'))
     core_conf.set_quoted('GIO_PREFIX',
-        gio_dep.get_pkgconfig_variable('prefix'))
+        gio_dep.get_variable('prefix'))
 else
     core_conf.set_quoted('GIO_MODULE_DIR', join_paths(get_option('prefix'),
       get_option('libdir'), 'gio/modules'))
@@ -566,17 +566,15 @@ endif
 # Use core_conf after all subdirs have set values
 configure_file(output : 'config.h', configuration : core_conf)
 
-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
+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: ', ')
index 25bd349..e10aa9a 100644 (file)
@@ -1,7 +1,7 @@
 pluginsdirs = []
 if gst_dep.type_name() == 'pkgconfig'
-  pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')]
-  gst_plugin_scanner_dir = gst_dep.get_pkgconfig_variable('pluginscannerdir')
+  pluginsdirs = [gst_dep.get_variable('pluginsdir')]
+  gst_plugin_scanner_dir = gst_dep.get_variable('pluginscannerdir')
 else
   gst_plugin_scanner_dir = gst_proj.get_variable('gst_scanner_dir')
 endif
index 86304ab..83c3a27 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
         required: false)
 endif
 
index 15ef3c3..6818f93 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-plugins-good', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   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_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()
+    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()
   else
     gstbase = subproject('gst-plugins-base')
     gst_gl_apis = gstbase.get_variable('enabled_gl_apis')
@@ -537,17 +537,15 @@ endif
 
 configure_file(output : 'config.h', configuration : cdata)
 
-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
+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: ', ')
index 1c67d8c..f71d07b 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
         required: false)
 endif
 
index 843bef0..ee45145 100644 (file)
@@ -1,22 +1,24 @@
-if get_option('a52dec').disabled()
-  subdir_done()
-endif
+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.
+  ''')
 
 a52_dep = cc.find_library('a52', required : get_option('a52dec'))
-have_a52_h = cc.has_header_symbol('a52dec/a52.h', 'a52_init', prefix : '#include <stdint.h>')
-if not have_a52_h and get_option('a52dec').enabled()
-  error('a52dec plugin enabled but a52.h not found')
-endif
+if a52_dep.found()
+  have_a52_h = cc.has_header_symbol('a52dec/a52.h', 'a52_init', prefix : '#include <stdint.h>')
 
-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]
+  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
 endif
index 054d026..4b21e36 100644 (file)
@@ -1,4 +1,9 @@
-cdio_dep = dependency('libcdio', version : '>= 0.76', required : get_option('cdio'))
+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)
 
 if cdio_dep.found()
   cdio = library('gstcdio',
index f075d84..a1cbfdc 100644 (file)
@@ -1,4 +1,9 @@
-dvdread_dep = dependency('dvdread', version : '>= 0.5.0', required : get_option('dvdread'))
+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)
 
 if gmodule_dep.found() and dvdread_dep.found()
   dvdread = library('gstdvdread',
index aa5262a..77d3ba0 100644 (file)
@@ -1,4 +1,9 @@
-mpeg2_dep = dependency('libmpeg2', version : '>= 0.4.0', required : get_option('mpeg2dec'))
+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)
 
 if mpeg2_dep.found()
   mpeg2dec = library('gstmpeg2dec',
index 6310652..bc3bc77 100644 (file)
@@ -1,7 +1,7 @@
-sidplay_option = get_option('sidplay')
-if sidplay_option.disabled()
-  subdir_done()
-endif
+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.
+  ''')
 
 if not add_languages('cpp', native: false, required: sidplay_option)
   subdir_done()
index fdbfeeb..7fe65f8 100644 (file)
@@ -1,9 +1,14 @@
+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 : get_option('x264'),
+x264_dep = dependency('x264', required : x264_opt,
                       fallback: ['x264', 'libx264_dep'])
 
 if x264_dep.found()
index 522bdcd..a98be6a 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-plugins-ugly', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
@@ -292,6 +292,8 @@ 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')
@@ -317,17 +319,16 @@ endif
 
 configure_file(output : 'config.h', configuration : cdata)
 
-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
+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: ', ')
index fac0fef..a3fc8c4 100644 (file)
@@ -18,6 +18,10 @@ 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)')
index 39d8ec6..fa649cf 100644 (file)
@@ -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_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+    plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
         required: false)
 endif
 
index 5580285..35953af 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-rtsp-server', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   default_options : ['warning_level=1', 'buildtype=debugoptimized'])
 
 gst_version = meson.project_version()
index 32b6a83..7b9b96d 100644 (file)
@@ -1,6 +1,6 @@
 project('gstreamer', 'c',
   version : '1.20.0',
-  meson_version : '>= 0.52',
+  meson_version : '>= 0.59',
   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_pkgconfig_variable('completionsdir', define_variable: bashcomp_dir_override)
+  bash_completions_dir = bashcomp_dep.get_variable('completionsdir', pkgconfig_define:  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_pkgconfig_variable('helpersdir', define_variable: bashcomp_dir_override)
+  bash_helpers_dir = bashcomp_dep.get_variable('helpersdir', pkgconfig_define:  bashcomp_dir_override)
   if bash_helpers_dir == ''
     msg = 'Found bash-completion, but the .pc file did not set \'helpersdir\'.'
     if bashcomp_option.enabled()
@@ -643,17 +643,15 @@ endif
 configure_file(output : 'config.h', configuration : cdata)
 install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal'))
 
-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
+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: ', ')