Meson: Use pkg-config generator
[platform/upstream/gstreamer.git] / meson.build
index feccbe3..7d81312 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-editing-services', 'c',
-  version : '1.17.2.1',
-  meson_version : '>= 0.48',
+  version : '1.19.0.1',
+  meson_version : '>= 0.54',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
@@ -25,7 +25,7 @@ curversion = gst_version_minor * 100 + gst_version_micro
 libversion = '@0@.@1@.0'.format(soversion, curversion)
 osxversion = curversion + 1
 
-glib_req = '>= 2.44.0'
+glib_req = '>= 2.56.0'
 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
 
 cc = meson.get_compiler('c')
@@ -33,6 +33,9 @@ mathlib = cc.find_library('m', required : false)
 
 cdata = configuration_data()
 
+prefix = get_option('prefix')
+datadir = prefix / get_option('datadir')
+
 # Ignore several spurious warnings for things gstreamer does very commonly
 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
@@ -84,6 +87,8 @@ gstpbutils_dep = dependency('gstreamer-pbutils-' + apiversion, version : gst_req
     fallback : ['gst-plugins-base', 'pbutils_dep'])
 gstvideo_dep = dependency('gstreamer-video-' + apiversion, version : gst_req,
     fallback : ['gst-plugins-base', 'video_dep'])
+gstaudio_dep = dependency('gstreamer-audio-' + apiversion, version : gst_req,
+    fallback : ['gst-plugins-base', 'audio_dep'])
 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
     fallback : ['gstreamer', 'gst_base_dep'])
 if host_machine.system() != 'windows'
@@ -96,7 +101,7 @@ gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
 gstvalidate_dep = dependency('gst-validate-1.0', version : gst_req, required : get_option('validate'),
   fallback : ['gst-devtools', 'validate_dep'])
 
-gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
+gio_dep = dependency('gio-2.0', version: glib_req, fallback: ['glib', 'libgio_dep'])
 libxml_dep = dependency('libxml-2.0', required: get_option('xptv'))
 cdata.set('DISABLE_XPTV', not libxml_dep.found())
 
@@ -192,8 +197,6 @@ if build_gir
   endif
 endif
 
-configure_file(output : 'config.h', configuration : cdata)
-
 ges_c_args = ['-DHAVE_CONFIG_H', '-DG_LOG_DOMAIN="GES"']
 plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
 
@@ -240,13 +243,19 @@ foreach extra_arg : warning_flags
 endforeach
 
 python3 = import('python').find_installation()
+pkgconfig = import('pkgconfig')
+pkgconfig_subdirs = ['gstreamer-1.0']
+
 configinc = include_directories('.')
 subdir('ges')
 subdir('plugins')
-subdir('tools')
-subdir('pkgconfig')
+if not get_option('tools').disabled()
+  subdir('tools')
+endif
 subdir('tests')
-subdir('examples')
+if not get_option('examples').disabled()
+  subdir('examples')
+endif
 subdir('docs')
 
 override_detector = '''
@@ -292,4 +301,20 @@ if pygi_override_dir != ''
   subdir('bindings/python')
 endif
 
+# Set release date
+if gst_version_nano == 0
+  extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py')
+  run_result = run_command(extract_release_date, gst_version, files('gst-editing-services.doap'))
+  if run_result.returncode() == 0
+    release_date = run_result.stdout().strip()
+    cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date)
+    message('Package release date: ' + release_date)
+  else
+    # Error out if our release can't be found in the .doap file
+    error(run_result.stderr())
+  endif
+endif
+
+configure_file(output: 'config.h', configuration: cdata)
+
 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')