Back to development
[platform/upstream/gstreamer.git] / subprojects / gst-editing-services / meson.build
index b4479d3..d747094 100644 (file)
@@ -1,6 +1,6 @@
 project('gst-editing-services', 'c',
-  version : '1.19.3.1',
-  meson_version : '>= 0.59',
+  version : '1.21.3.1',
+  meson_version : '>= 0.62',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
@@ -27,7 +27,7 @@ curversion = gst_version_minor * 100 + gst_version_micro
 libversion = '@0@.@1@.0'.format(soversion, curversion)
 osxversion = curversion + 1
 
-glib_req = '>= 2.56.0'
+glib_req = '>= 2.62.0'
 
 if gst_version_is_stable
   gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
@@ -67,6 +67,12 @@ if cc.has_link_argument('-Wl,-Bsymbolic-functions')
   add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
 endif
 
+# glib doesn't support unloading, which means that unloading and reloading
+# any library that registers static types will fail
+if cc.has_link_argument('-Wl,-z,nodelete')
+  add_project_link_arguments('-Wl,-z,nodelete', language: 'c')
+endif
+
 # Symbol visibility
 if cc.get_id() == 'msvc'
   export_define = '__declspec(dllexport) extern'
@@ -115,7 +121,8 @@ 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', version: glib_req, fallback: ['glib', 'libgio_dep'])
+gio_dep = dependency('gio-2.0', version: glib_req)
+gmodule_dep = dependency('gmodule-no-export-2.0')
 libxml_dep = dependency('libxml-2.0', required: get_option('xptv'))
 cdata.set('DISABLE_XPTV', not libxml_dep.found())
 
@@ -174,18 +181,17 @@ elif build_gir
     if not cc.compiles('#include <Python.h>', dependencies: [python_dep])
       error_msg = 'Could not compile a simple program against python'
     elif pylib_loc == ''
-      check_path_exists = 'import os, sys; assert(os.path.exists(sys.argv[1]))'
+      fsmod = import('fs')
       pylib_loc = python.get_variable('LIBPL', '')
       if host_machine.system() != 'windows' and host_machine.system() != 'darwin'
         pylib_ldlibrary = python.get_variable('LDLIBRARY', '')
-        if run_command(python, '-c', check_path_exists, join_paths(pylib_loc, pylib_ldlibrary)).returncode() != 0
+        if not fsmod.exists(pylib_loc / pylib_ldlibrary)
           # Workaround for Fedora
           pylib_loc = python.get_variable('LIBDIR', '')
           message('pylib_loc = @0@'.format(pylib_loc))
         endif
 
-        res = run_command(python, '-c', check_path_exists, join_paths(pylib_loc, pylib_ldlibrary))
-        if res.returncode() != 0
+        if not fsmod.exists(pylib_loc / pylib_ldlibrary)
           error_msg = '@0@ doesn\' exist, can\'t use python'.format(join_paths(pylib_loc, pylib_ldlibrary))
         endif
       endif
@@ -197,7 +203,6 @@ elif build_gir
           pylib_suffix = 'dylib'
         endif
 
-        gmodule_dep = dependency('gmodule-2.0')
         libges_deps = libges_deps + [python_dep, gmodule_dep]
         has_python = true
         message('python_abi_flags = @0@'.format(python_abi_flags))
@@ -252,7 +257,6 @@ warning_flags = [
   '-Wmissing-include-dirs',
   '-Waddress',
   '-Wno-multichar',
-  '-Wdeclaration-after-statement',
   '-Wvla',
   '-Wpointer-arith',
 ]
@@ -268,74 +272,35 @@ pkgconfig = import('pkgconfig')
 pkgconfig_subdirs = ['gstreamer-1.0']
 
 configinc = include_directories('.')
-libraries = []
+gst_libraries = []
 
 subdir('ges')
 subdir('plugins')
-if not get_option('tools').disabled()
-  subdir('tools')
-endif
+subdir('tools')
+
 subdir('tests')
 if not get_option('examples').disabled()
   subdir('examples')
 endif
 subdir('docs')
 
-override_detector = '''
-import sys
-import os
-
-prefix = sys.argv[1]
-version = sys.version_info
-
-# If we are installing in the same prefix as PyGobject
-# make sure to install in the right place.
-import gi.overrides
-
-overrides_path = os.path.dirname(gi.overrides.__file__)
-if os.path.commonprefix([overrides_path, prefix]) == prefix:
-    print(overrides_path)
-    exit(0)
-
-# Otherwise follow python's way of install site packages inside
-# the provided prefix
-if os.name == 'posix':
-    print(os.path.join(
-        prefix, 'lib', 'python%d.%d' % (version.major, version.minor),
-        'site-packages', 'gi', 'overrides'))
-else:
-    print(os.path.join(
-        prefix, 'Lib', 'Python%d%d' % (version.major, version.minor),
-        'site-packages', 'gi', 'overrides'))
-'''
 pygi_override_dir = get_option('pygi-overrides-dir')
 if pygi_override_dir == ''
-    cres = run_command(python3, '-c', override_detector, get_option('prefix'))
-    if cres.returncode() == 0
-      pygi_override_dir = cres.stdout().strip()
-    endif
-    if cres.stderr() != ''
-        message(cres.stderr())
-    endif
+  pygi_override_dir = python3.get_install_dir(
+    subdir : join_paths('gi', 'overrides')
+  )
 endif
 
-if pygi_override_dir != ''
-  message('pygobject overrides directory ' + pygi_override_dir)
-  subdir('bindings/python')
-endif
+message('pygobject overrides directory = @0@'.format(pygi_override_dir))
+subdir('bindings/python')
 
 # 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
+  run_result = run_command(extract_release_date, gst_version, files('gst-editing-services.doap'), check: true)
+  release_date = run_result.stdout().strip()
+  cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date)
+  message('Package release date: ' + release_date)
 endif
 
 if gio_dep.version().version_compare('< 2.67.4')
@@ -343,3 +308,23 @@ if gio_dep.version().version_compare('< 2.67.4')
 endif
 
 configure_file(output: 'config.h', configuration: cdata)
+
+meson.add_dist_script('scripts/gen-changelog.py', meson.project_name(), '1.20.0', meson.project_version())
+
+plugin_names = []
+gst_plugins = []
+foreach plugin: plugins
+  pkgconfig.generate(plugin, install_dir: plugins_pkgconfig_install_dir)
+  dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
+  meson.override_dependency(plugin.name(), dep)
+  gst_plugins += [dep]
+  if plugin.name().startswith('gst')
+    plugin_names += [plugin.name().substring(3)]
+  else
+    plugin_names += [plugin.name()]
+  endif
+endforeach
+
+summary({
+    'Plugins': plugin_names,
+}, list_sep: ', ')