meson: add 'gpl' option and only build plugins with (A)GPL deps if explicitly enabled
authorTim-Philipp Müller <tim@centricular.com>
Sat, 18 Sep 2021 23:55:34 +0000 (00:55 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 18 Oct 2021 17:03:19 +0000 (18:03 +0100)
Require explicit opt-in to build plugins with (A)GPL dependencies.

Keep ugly/bad options on 'auto' for now so cerbero doesn't fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1084>

22 files changed:
.gitlab-ci.yml
README.md
ci/docker/windows/install_gst.ps1
meson_options.txt
subprojects/gst-plugins-bad/ext/dts/meson.build
subprojects/gst-plugins-bad/ext/faad/meson.build
subprojects/gst-plugins-bad/ext/iqa/iqa.c
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/x265/meson.build
subprojects/gst-plugins-bad/meson.build
subprojects/gst-plugins-bad/meson_options.txt
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

index a94b712..b1c9780 100644 (file)
@@ -63,6 +63,7 @@ variables:
     -Drtsp_server=enabled
     -Dvaapi=enabled
     -Dsharp=disabled
+    -Dgpl=enabled
 
   MESON_GST_WERROR: >
     -Dgstreamer:werror=true
index 270c570..591f3f3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -129,6 +129,30 @@ the build files to find `libmfx`.
 The plugin will be automatically enabled if possible, but you can ensure it by
 passing `-Dbad=enabled -Dgst-plugins-bad:msdk=enabled` to `meson`.
 
+### Building plugins with (A)GPL-licensed dependencies
+
+Some plugins have GPL- or AGPL-licensed dependencies and will only be built
+if you have explicitly opted in to allow (A)GPL-licensed dependencies by
+passing `-Dgpl=enabled` to Meson.
+
+List of plugins with (A)GPL-licensed dependencies (non-exhaustive) in gst-plugins-bad:
+ - dts (DTS audio decoder plugin)
+ - faad (Free AAC audio decoder plugin)
+ - iqa (Image quality assessment plugin based on dssim-c)
+ - mpeg2enc (MPEG-2 video encoder plugin)
+ - mplex (audio/video multiplexer plugin)
+ - ofa (Open Fingerprint Architecture library plugin)
+ - resindvd (Resin DVD playback plugin)
+ - x265 (HEVC/H.265 video encoder plugin)
+
+List of plugins with (A)GPL-licensed dependencies (non-exhaustive) in gst-plugins-ugly:
+ - a52dec (Dolby Digital (AC-3) audio decoder plugin)
+ - cdio (CD audio source plugin based on libcdio)
+ - dvdread (DVD video source plugin based on libdvdread)
+ - mpeg2dec (MPEG-2 video decoder plugin based on libmpeg2)
+ - sidplay (Commodore 64 audio decoder plugin based on libsidplay)
+ - x264 (H.264 video encoder plugin based on libx264)
+
 ### Static build
 
 Since *1.18.0* when doing a static build using `--default-library=static`, a
index 6105f36..7d961cd 100644 (file)
@@ -53,7 +53,8 @@ $env:MESON_ARGS = "-Dglib:installed_tests=false " +
     "-Dlibav=disabled " +
     "-Dvaapi=disabled " +
     "-Dgst-plugins-base:pango=enabled " +
-    "-Dgst-plugins-good:cairo=enabled "
+    "-Dgst-plugins-good:cairo=enabled " +
+    "-Dgpl=enabled "
 
 Write-Output "Building gst"
 cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && meson _build $env:MESON_ARGS && meson compile -C _build && ninja -C _build install"
@@ -68,4 +69,4 @@ git clean -fdxx
 if (!$?) {
   Write-Host "Failed to git clean"
   Exit 1
-}
\ No newline at end of file
+}
index 1fa3c6d..3037d53 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 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 afe83b9..9362fd8 100644 (file)
@@ -516,6 +516,7 @@ plugin_init (GstPlugin * plugin)
   return GST_ELEMENT_REGISTER (iqa, plugin);
 }
 
+// FIXME: effective iqa plugin license should be AGPL3+ !
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     iqa,
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 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 6701d9a..474397e 100644 (file)
@@ -486,6 +486,8 @@ pkgconfig.generate(
   description : 'Streaming media framework, bad plugins libraries',
 )
 
+gpl_allowed = get_option('gpl').allowed()
+
 subdir('gst-libs')
 subdir('gst')
 subdir('sys')
@@ -559,5 +561,9 @@ if meson.version().version_compare('>= 0.54')
       plugin_names += [plugin.name()]
     endif
   endforeach
-  summary({'Plugins':plugin_names}, list_sep: ', ')
+
+  summary({
+      'Plugins': plugin_names,
+      '(A)GPL license allowed': gpl_allowed,
+  }, list_sep: ', ')
 endif
index f30c9a7..c5f2e8b 100644 (file)
@@ -101,10 +101,10 @@ option('decklink', type : 'feature', value : 'auto', description : 'DeckLink aud
 option('directfb', type : 'feature', value : 'auto', description : 'DirectFB video sink plugin')
 option('directsound', type : 'feature', value : 'auto', description : 'Directsound audio source plugin')
 option('dtls', type : 'feature', value : 'auto', description : 'DTLS encoder and decoder plugin')
-option('dts', type : 'feature', value : 'auto', description : 'DTS audio decoder plugin')
+option('dts', type : 'feature', value : 'auto', description : 'DTS audio decoder plugin (GPL - only built if gpl option is also enabled!)')
 option('dvb', type : 'feature', value : 'auto', description : 'DVB video bin and source plugin')
 option('faac', type : 'feature', value : 'auto', description : 'Free AAC audio encoder plugin')
-option('faad', type : 'feature', value : 'auto', description : 'Free AAC audio decoder plugin')
+option('faad', type : 'feature', value : 'auto', description : 'Free AAC audio decoder plugin (GPL - only built if gpl option is also enabled!)')
 option('fbdev', type : 'feature', value : 'auto', description : 'Framebuffer video sink plugin')
 option('fdkaac', type : 'feature', value : 'auto', description : 'Fraunhofer AAC audio codec plugin')
 option('flite', type : 'feature', value : 'auto', description : 'Flite speech synthesizer source plugin')
@@ -114,7 +114,7 @@ option('gme', type : 'feature', value : 'auto', description : 'libgme gaming con
 option('gs', type : 'feature', value : 'auto', description : 'Google Cloud Storage source and sink plugin')
 option('gsm', type : 'feature', value : 'auto', description : 'GSM encoder/decoder plugin')
 option('ipcpipeline', type : 'feature', value : 'auto', description : 'Inter-process communication plugin')
-option('iqa', type : 'feature', value : 'auto', description : 'Image quality assessment plugin')
+option('iqa', type : 'feature', value : 'auto', description : 'Image quality assessment plugin (AGPL - only built if gpl option is also enabled!)')
 option('kate', type : 'feature', value : 'auto', description : 'Kate subtitle parser, tagger, and codec plugin')
 option('kms', type : 'feature', value : 'auto', description : 'KMS video sink plugin')
 option('ladspa', type : 'feature', value : 'auto', description : 'LADSPA plugin bridge')
@@ -126,8 +126,8 @@ option('lv2', type : 'feature', value : 'auto', description : 'LV2 audio plugin
 option('mediafoundation', type : 'feature', value : 'auto', description : 'Microsoft Media Foundation plugin')
 option('microdns', type : 'feature', value : 'auto', description : 'libmicrodns-based device provider')
 option('modplug', type : 'feature', value : 'auto', description : 'ModPlug audio decoder plugin')
-option('mpeg2enc', type : 'feature', value : 'auto', description : 'mpeg2enc video encoder plugin')
-option('mplex', type : 'feature', value : 'auto', description : 'mplex audio/video multiplexer plugin')
+option('mpeg2enc', type : 'feature', value : 'auto', description : 'mpeg2enc video encoder plugin (GPL - only built if gpl option is also enabled!)')
+option('mplex', type : 'feature', value : 'auto', description : 'mplex audio/video multiplexer plugin (GPL - only built if gpl option is also enabled!)')
 option('msdk', type : 'feature', value : 'auto', description : 'Intel Media SDK video encoder/decoder plugin')
 option('musepack', type : 'feature', value : 'auto', description : 'libmpcdec Musepack decoder plugin')
 option('neon', type : 'feature', value : 'auto', description : 'NEON HTTP source plugin')
@@ -141,7 +141,7 @@ option('openmpt', type : 'feature', value : 'auto', description : 'OpenMPT modul
 option('openni2', type : 'feature', value : 'auto', description : 'OpenNI2 library plugin')
 option('opensles', type : 'feature', value : 'auto', description : 'OpenSL ES audio source/sink plugin')
 option('opus', type : 'feature', value : 'auto', description : 'OPUS audio parser plugin')
-option('resindvd', type : 'feature', value : 'auto', description : 'Resin DVD playback plugin')
+option('resindvd', type : 'feature', value : 'auto', description : 'Resin DVD playback plugin (GPL - only built if gpl option is also enabled!)')
 option('rsvg', type : 'feature', value : 'auto', description : 'SVG overlayer and image decoder plugin')
 option('rtmp', type : 'feature', value : 'auto', description : 'RTMP video network source and sink plugin')
 option('sbc', type : 'feature', value : 'auto', description : 'SBC bluetooth audio codec plugin')
@@ -171,7 +171,7 @@ option('webrtcdsp', type : 'feature', value : 'auto', description : 'Plugin with
 option('wildmidi', type : 'feature', value : 'auto', description : 'WildMidi midi soft synth plugin')
 option('winks', type : 'feature', value : 'auto', description : 'Windows Kernel Streaming video source plugin')
 option('winscreencap', type : 'feature', value : 'auto', description : 'Windows Screen Capture video source plugin')
-option('x265', type : 'feature', value : 'auto', description : 'HEVC/H.265 video encoder plugin')
+option('x265', type : 'feature', value : 'auto', description : 'HEVC/H.265 video encoder plugin (GPL - only built if gpl option is also enabled!)')
 option('zbar', type : 'feature', value : 'auto', description : 'Barcode image scanner plugin using zbar library')
 option('zxing', type : 'feature', value : 'auto', description : 'Barcode image scanner plugin using zxing-cpp library')
 option('wpe', type : 'feature', value : 'auto', description : 'WPE Web browser plugin')
@@ -192,6 +192,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: 'auto', yield: true, # FIXME: disable by default
+  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 843bef0..68908a7 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 1392d05..ac19511 100644 (file)
@@ -271,7 +271,10 @@ 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')
 subdir('ext')
 subdir('tests')
@@ -312,5 +315,8 @@ if meson.version().version_compare('>= 0.54')
       plugin_names += [plugin.name()]
     endif
   endforeach
-  summary({'Plugins':plugin_names}, list_sep: ', ')
+  summary({
+      'Plugins': plugin_names,
+      '(A)GPL license allowed': gpl_allowed,
+    }, list_sep: ', ')
 endif
index 0b59d01..74c3115 100644 (file)
@@ -9,14 +9,18 @@ option('realmedia', type : 'feature', value : 'auto')
 option('xingmux', type : 'feature', value : 'auto')
 
 # Feature options for plugins that need external deps
-option('a52dec', type : 'feature', value : 'auto', description : 'Dolby Digital (AC-3) audio decoder plugin')
+option('a52dec', type : 'feature', value : 'auto', description : 'Dolby Digital (AC-3) audio decoder plugin based on liba52 (GPL - only built if gpl option is also enabled!)')
 option('amrnb', type : 'feature', value : 'auto', description : 'Adaptive Multi-Rate Narrow-Band audio codec plugin')
 option('amrwbdec', type : 'feature', value : 'auto', description : 'Adaptive Multi-Rate Wide-Band audio decoder plugin')
-option('cdio', type : 'feature', value : 'auto', description : 'CD audio source plugin')
-option('dvdread', type : 'feature', value : 'auto', description : 'DVD video source plugin')
-option('mpeg2dec', type : 'feature', value : 'auto', description : 'MPEG 2 video decoder plugin')
-option('sidplay', type : 'feature', value : 'auto', description : 'Commodore 64 audio decoder plugin')
-option('x264', type : 'feature', value : 'auto', description : 'H.264 video encoder plugin')
+option('cdio', type : 'feature', value : 'auto', description : 'CD audio source plugin based on libcdio (GPL - only built if gpl option is also enabled!)')
+option('dvdread', type : 'feature', value : 'auto', description : 'DVD video source plugin based on libdvdread (GPL - only built if gpl option is also enabled!)')
+option('mpeg2dec', type : 'feature', value : 'auto', description : 'MPEG 2 video decoder plugin based on libmpeg2 (GPL - only built if gpl option is also enabled!)')
+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: 'auto', yield: true, # FIXME: disable by default
+  description: 'Allow build plugins that have GPL-licensed dependencies')
 
 # Common feature options
 option('nls', type : 'feature', value : 'auto', yield: true,
@@ -36,4 +40,4 @@ option('package-name', type : 'string', yield : true,
 option('package-origin', type : 'string', value : 'Unknown package origin', yield: true,
        description : 'package origin URL to use in plugins')
 option('doc', type : 'feature', value : 'auto', yield: true,
-       description: 'Enable documentation.')
\ No newline at end of file
+       description: 'Enable documentation.')