2016-08-04 21:33:55 +00:00
|
|
|
project('gst-editing-services', 'c',
|
2023-01-23 23:04:53 +00:00
|
|
|
version : '1.23.0.1',
|
2022-09-21 13:49:45 +00:00
|
|
|
meson_version : '>= 0.62',
|
2016-08-04 21:33:55 +00:00
|
|
|
default_options : [ 'warning_level=1',
|
|
|
|
'buildtype=debugoptimized' ])
|
|
|
|
|
|
|
|
gst_version = meson.project_version()
|
|
|
|
version_arr = gst_version.split('.')
|
2018-02-08 19:16:26 +00:00
|
|
|
gst_version = meson.project_version()
|
|
|
|
version_arr = gst_version.split('.')
|
|
|
|
gst_version_major = version_arr[0].to_int()
|
|
|
|
gst_version_minor = version_arr[1].to_int()
|
|
|
|
gst_version_micro = version_arr[2].to_int()
|
|
|
|
if version_arr.length() == 4
|
|
|
|
gst_version_nano = version_arr[3].to_int()
|
2016-08-04 21:33:55 +00:00
|
|
|
else
|
|
|
|
gst_version_nano = 0
|
|
|
|
endif
|
2021-10-25 10:37:45 +00:00
|
|
|
gst_version_is_stable = gst_version_minor.is_even()
|
|
|
|
gst_version_is_dev = gst_version_minor.is_odd() and gst_version_micro < 90
|
2016-08-04 21:33:55 +00:00
|
|
|
|
|
|
|
apiversion = '1.0'
|
|
|
|
soversion = 0
|
|
|
|
# maintaining compatibility with the previous libtool versioning
|
|
|
|
# current = minor * 100 + micro
|
2018-08-31 09:14:58 +00:00
|
|
|
curversion = gst_version_minor * 100 + gst_version_micro
|
|
|
|
libversion = '@0@.@1@.0'.format(soversion, curversion)
|
|
|
|
osxversion = curversion + 1
|
2016-08-04 21:33:55 +00:00
|
|
|
|
2022-04-06 11:56:30 +00:00
|
|
|
glib_req = '>= 2.62.0'
|
2021-10-25 10:37:45 +00:00
|
|
|
|
|
|
|
if gst_version_is_stable
|
|
|
|
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
|
|
|
|
else
|
|
|
|
gst_req = '>= ' + gst_version
|
|
|
|
endif
|
2016-08-04 21:33:55 +00:00
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
2020-04-17 00:27:30 +00:00
|
|
|
mathlib = cc.find_library('m', required : false)
|
2018-09-24 14:41:24 +00:00
|
|
|
|
|
|
|
cdata = configuration_data()
|
|
|
|
|
2020-07-25 18:16:06 +00:00
|
|
|
prefix = get_option('prefix')
|
|
|
|
datadir = prefix / get_option('datadir')
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
if cc.get_id() == 'msvc'
|
2020-11-04 13:17:28 +00:00
|
|
|
msvc_args = [
|
|
|
|
# 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
|
|
|
|
# NOTE: Only add warnings here if you are sure they're spurious
|
2016-11-17 18:31:50 +00:00
|
|
|
'/wd4018', # implicit signed/unsigned conversion
|
|
|
|
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
|
|
|
'/wd4244', # lossy type conversion (e.g. double -> int)
|
|
|
|
'/wd4305', # truncating type conversion (e.g. double -> float)
|
2020-11-04 13:17:28 +00:00
|
|
|
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
|
|
|
|
|
|
|
# Enable some warnings on MSVC to match GCC/Clang behaviour
|
|
|
|
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
|
|
|
|
'/w14101', # 'identifier' : unreferenced local variable
|
|
|
|
'/w14189', # 'identifier' : local variable is initialized but not referenced
|
|
|
|
]
|
|
|
|
add_project_arguments(msvc_args, language: 'c')
|
2016-08-04 21:33:55 +00:00
|
|
|
endif
|
|
|
|
|
2018-04-25 10:01:01 +00:00
|
|
|
if cc.has_link_argument('-Wl,-Bsymbolic-functions')
|
|
|
|
add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
|
|
|
|
endif
|
|
|
|
|
2021-03-24 19:20:18 +00:00
|
|
|
# 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
|
|
|
|
|
2017-08-11 21:27:48 +00:00
|
|
|
# Symbol visibility
|
2022-12-13 13:58:43 +00:00
|
|
|
if cc.has_argument('-fvisibility=hidden')
|
2017-08-11 21:27:48 +00:00
|
|
|
add_project_arguments('-fvisibility=hidden', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2018-01-30 20:35:33 +00:00
|
|
|
# Disable strict aliasing
|
|
|
|
if cc.has_argument('-fno-strict-aliasing')
|
|
|
|
add_project_arguments('-fno-strict-aliasing', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
cdata.set('VERSION', '"@0@"'.format(gst_version))
|
|
|
|
cdata.set('PACKAGE', '"gst-editing-services"')
|
|
|
|
cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))
|
2020-06-19 18:25:56 +00:00
|
|
|
cdata.set('PACKAGE_BUGREPORT', '"https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/new"')
|
2016-08-04 21:33:55 +00:00
|
|
|
cdata.set('PACKAGE_NAME', '"GStreamer Editing Services"')
|
|
|
|
cdata.set('GST_PACKAGE_NAME', '"GStreamer Editing Services"')
|
|
|
|
cdata.set('GST_PACKAGE_ORIGIN', '"Unknown package origin"')
|
|
|
|
cdata.set('GST_LICENSE', '"LGPL"')
|
|
|
|
|
|
|
|
# Mandatory GST deps
|
|
|
|
gst_dep = dependency('gstreamer-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_dep'])
|
|
|
|
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'])
|
2020-07-08 12:01:58 +00:00
|
|
|
gstaudio_dep = dependency('gstreamer-audio-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'audio_dep'])
|
2016-08-04 21:33:55 +00:00
|
|
|
gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_base_dep'])
|
2016-10-25 15:54:11 +00:00
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
|
2018-09-01 06:47:08 +00:00
|
|
|
required : get_option('tests'),
|
|
|
|
fallback : ['gstreamer', 'gst_check_dep'])
|
2016-10-25 15:54:11 +00:00
|
|
|
endif
|
2016-08-04 21:33:55 +00:00
|
|
|
gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_controller_dep'])
|
2020-02-24 15:21:11 +00:00
|
|
|
gstvalidate_dep = dependency('gst-validate-1.0', version : gst_req, required : get_option('validate'),
|
2017-01-13 12:41:51 +00:00
|
|
|
fallback : ['gst-devtools', 'validate_dep'])
|
2016-08-04 21:33:55 +00:00
|
|
|
|
2022-03-25 19:00:20 +00:00
|
|
|
gio_dep = dependency('gio-2.0', version: glib_req)
|
2022-03-30 15:06:02 +00:00
|
|
|
gmodule_dep = dependency('gmodule-no-export-2.0')
|
2018-11-30 15:41:04 +00:00
|
|
|
libxml_dep = dependency('libxml-2.0', required: get_option('xptv'))
|
|
|
|
cdata.set('DISABLE_XPTV', not libxml_dep.found())
|
2016-08-04 21:33:55 +00:00
|
|
|
|
|
|
|
# TODO Properly port to Gtk 3
|
|
|
|
# gtk_dep = dependency('gtk+-3.0', required : false)
|
|
|
|
|
|
|
|
libges_deps = [gst_dep, gstbase_dep, gstvideo_dep, gstpbutils_dep,
|
2020-04-17 00:27:30 +00:00
|
|
|
gstcontroller_dep, gio_dep, libxml_dep, mathlib]
|
2016-08-04 21:33:55 +00:00
|
|
|
|
|
|
|
if gstvalidate_dep.found()
|
|
|
|
libges_deps = libges_deps + [gstvalidate_dep]
|
|
|
|
cdata.set('HAVE_GST_VALIDATE', 1)
|
|
|
|
endif
|
|
|
|
|
2018-07-25 11:50:02 +00:00
|
|
|
gir = find_program('g-ir-scanner', required : get_option('introspection'))
|
2016-08-04 21:33:55 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
|
|
|
|
# Fixme, not very elegant.
|
2019-10-17 23:50:16 +00:00
|
|
|
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
|
2016-11-04 17:41:13 +00:00
|
|
|
gir_init_section = [ '--add-init-section=' + \
|
|
|
|
'extern void gst_init(gint*,gchar**);' + \
|
|
|
|
'extern void ges_init(void);' + \
|
|
|
|
'g_setenv("GST_REGISTRY_1.0", "/no/way/this/exists.reg", TRUE);' + \
|
|
|
|
'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
|
|
|
|
'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
|
2016-11-29 13:37:11 +00:00
|
|
|
'g_setenv("GST_DEBUG", "0", TRUE);' + \
|
2016-11-04 17:41:13 +00:00
|
|
|
'gst_init(NULL,NULL);' + \
|
2019-03-23 19:21:31 +00:00
|
|
|
'ges_init();', '--quiet']
|
2016-08-04 21:33:55 +00:00
|
|
|
|
2019-02-05 18:46:49 +00:00
|
|
|
has_python = false
|
2021-09-13 21:33:01 +00:00
|
|
|
static_build = get_option('default_library') == 'static'
|
|
|
|
if static_build
|
|
|
|
if get_option('python').enabled()
|
|
|
|
error('Want to build python based modules but it is not supported while static building')
|
|
|
|
else
|
|
|
|
message('Disabling python support as it is not supported on static builds')
|
|
|
|
endif
|
|
|
|
elif build_gir
|
2019-02-05 18:46:49 +00:00
|
|
|
pymod = import('python')
|
|
|
|
python = pymod.find_installation(required: get_option('python'))
|
2019-11-07 11:24:32 +00:00
|
|
|
if python.found()
|
2020-03-11 11:42:50 +00:00
|
|
|
# Workaround for https://github.com/mesonbuild/meson/issues/5629
|
|
|
|
pythonver = python.language_version()
|
|
|
|
python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>=3', required: false)
|
|
|
|
if not python_dep.found()
|
|
|
|
python_dep = python.dependency(required : get_option('python'))
|
|
|
|
endif
|
2019-11-07 11:24:32 +00:00
|
|
|
else
|
|
|
|
python_dep = dependency('', required: false)
|
|
|
|
endif
|
2019-02-05 18:46:49 +00:00
|
|
|
if python_dep.found()
|
|
|
|
python_abi_flags = python.get_variable('ABIFLAGS', '')
|
|
|
|
pylib_loc = get_option('libpython-dir')
|
|
|
|
|
|
|
|
error_msg = ''
|
|
|
|
if not cc.compiles('#include <Python.h>', dependencies: [python_dep])
|
|
|
|
error_msg = 'Could not compile a simple program against python'
|
|
|
|
elif pylib_loc == ''
|
2022-01-04 20:37:59 +00:00
|
|
|
fsmod = import('fs')
|
2019-02-05 18:46:49 +00:00
|
|
|
pylib_loc = python.get_variable('LIBPL', '')
|
2020-04-18 14:22:25 +00:00
|
|
|
if host_machine.system() != 'windows' and host_machine.system() != 'darwin'
|
2019-02-05 18:46:49 +00:00
|
|
|
pylib_ldlibrary = python.get_variable('LDLIBRARY', '')
|
2022-01-04 20:37:59 +00:00
|
|
|
if not fsmod.exists(pylib_loc / pylib_ldlibrary)
|
2020-04-18 14:22:25 +00:00
|
|
|
# Workaround for Fedora
|
|
|
|
pylib_loc = python.get_variable('LIBDIR', '')
|
|
|
|
message('pylib_loc = @0@'.format(pylib_loc))
|
2019-02-05 18:46:49 +00:00
|
|
|
endif
|
|
|
|
|
2022-01-04 20:37:59 +00:00
|
|
|
if not fsmod.exists(pylib_loc / pylib_ldlibrary)
|
2019-02-05 18:46:49 +00:00
|
|
|
error_msg = '@0@ doesn\' exist, can\'t use python'.format(join_paths(pylib_loc, pylib_ldlibrary))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
if error_msg == ''
|
|
|
|
pylib_suffix = 'so'
|
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
pylib_suffix = 'dll'
|
|
|
|
elif host_machine.system() == 'darwin'
|
|
|
|
pylib_suffix = 'dylib'
|
|
|
|
endif
|
|
|
|
|
|
|
|
libges_deps = libges_deps + [python_dep, gmodule_dep]
|
|
|
|
has_python = true
|
|
|
|
message('python_abi_flags = @0@'.format(python_abi_flags))
|
|
|
|
message('pylib_loc = @0@'.format(pylib_loc))
|
|
|
|
cdata.set('HAS_PYTHON', true)
|
|
|
|
cdata.set('PY_LIB_LOC', '"@0@"'.format(pylib_loc))
|
|
|
|
cdata.set('PY_ABI_FLAGS', '"@0@"'.format(python_abi_flags))
|
|
|
|
cdata.set('PY_LIB_SUFFIX', '"@0@"'.format(pylib_suffix))
|
|
|
|
cdata.set('PYTHON_VERSION', '"@0@"'.format(python_dep.version()))
|
|
|
|
else
|
|
|
|
if get_option('python').enabled()
|
|
|
|
error(error_msg)
|
|
|
|
else
|
|
|
|
message(error_msg)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-07-01 20:22:24 +00:00
|
|
|
ges_c_args = ['-DHAVE_CONFIG_H', '-DG_LOG_DOMAIN="GES"']
|
2016-08-04 21:33:55 +00:00
|
|
|
plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
|
|
|
|
|
2018-11-04 09:47:01 +00:00
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
|
|
|
|
if get_option('default_library') == 'shared'
|
|
|
|
# If we don't build static plugins there is no need to generate pc files
|
|
|
|
plugins_pkgconfig_install_dir = disabler()
|
|
|
|
endif
|
|
|
|
|
2016-12-09 20:50:28 +00:00
|
|
|
if gst_dep.type_name() == 'internal'
|
2018-05-05 14:04:14 +00:00
|
|
|
gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
|
2016-12-09 20:50:28 +00:00
|
|
|
else
|
2018-02-21 19:42:19 +00:00
|
|
|
# We can't check that in the case of subprojects as we won't
|
2018-02-21 19:20:56 +00:00
|
|
|
# be able to build against an internal dependency (which is not built yet)
|
2018-02-21 19:42:19 +00:00
|
|
|
gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
|
2018-02-21 19:20:56 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if gst_debug_disabled and cc.has_argument('-Wno-unused')
|
|
|
|
add_project_arguments('-Wno-unused', language: 'c')
|
2016-12-09 20:50:28 +00:00
|
|
|
endif
|
|
|
|
|
2018-03-01 17:56:05 +00:00
|
|
|
warning_flags = [
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
'-Wredundant-decls',
|
|
|
|
'-Wundef',
|
|
|
|
'-Wwrite-strings',
|
|
|
|
'-Wformat',
|
|
|
|
'-Wformat-security',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wmissing-include-dirs',
|
|
|
|
'-Waddress',
|
|
|
|
'-Wno-multichar',
|
|
|
|
'-Wvla',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach extra_arg : warning_flags
|
|
|
|
if cc.has_argument (extra_arg)
|
|
|
|
add_project_arguments([extra_arg], language: 'c')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2019-06-06 19:40:57 +00:00
|
|
|
python3 = import('python').find_installation()
|
2018-11-04 18:04:45 +00:00
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
pkgconfig_subdirs = ['gstreamer-1.0']
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
configinc = include_directories('.')
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries = []
|
2020-06-27 04:39:00 +00:00
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
subdir('ges')
|
|
|
|
subdir('plugins')
|
2021-09-11 15:17:56 +00:00
|
|
|
subdir('tools')
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
subdir('tests')
|
2020-07-25 18:09:30 +00:00
|
|
|
if not get_option('examples').disabled()
|
|
|
|
subdir('examples')
|
|
|
|
endif
|
2018-10-22 06:22:52 +00:00
|
|
|
subdir('docs')
|
2016-08-25 18:04:54 +00:00
|
|
|
|
2018-07-08 14:36:36 +00:00
|
|
|
pygi_override_dir = get_option('pygi-overrides-dir')
|
|
|
|
if pygi_override_dir == ''
|
2022-09-10 17:16:39 +00:00
|
|
|
pygi_override_dir = python3.get_install_dir(
|
|
|
|
subdir : join_paths('gi', 'overrides')
|
|
|
|
)
|
2018-07-08 14:36:36 +00:00
|
|
|
endif
|
|
|
|
|
2022-09-10 17:16:39 +00:00
|
|
|
message('pygobject overrides directory = @0@'.format(pygi_override_dir))
|
|
|
|
subdir('bindings/python')
|
2018-07-08 14:36:36 +00:00
|
|
|
|
2020-07-08 16:33:07 +00:00
|
|
|
# Set release date
|
|
|
|
if gst_version_nano == 0
|
|
|
|
extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py')
|
2022-01-04 20:37:59 +00:00
|
|
|
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)
|
2020-07-08 16:33:07 +00:00
|
|
|
endif
|
|
|
|
|
2021-05-22 17:41:08 +00:00
|
|
|
if gio_dep.version().version_compare('< 2.67.4')
|
|
|
|
cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)')
|
|
|
|
endif
|
|
|
|
|
2020-07-08 16:33:07 +00:00
|
|
|
configure_file(output: 'config.h', configuration: cdata)
|
2022-02-10 09:13:27 +00:00
|
|
|
|
2022-11-07 00:10:39 +00:00
|
|
|
meson.add_dist_script('scripts/gen-changelog.py', meson.project_name(), '1.20.0', meson.project_version())
|
|
|
|
|
2022-02-10 09:13:27 +00:00
|
|
|
plugin_names = []
|
2022-08-31 22:44:14 +00:00
|
|
|
gst_plugins = []
|
2022-02-10 09:13:27 +00:00
|
|
|
foreach plugin: plugins
|
2022-09-01 19:11:31 +00:00
|
|
|
pkgconfig.generate(plugin, install_dir: plugins_pkgconfig_install_dir)
|
2022-08-31 22:44:14 +00:00
|
|
|
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
|
|
|
|
meson.override_dependency(plugin.name(), dep)
|
|
|
|
gst_plugins += [dep]
|
2022-02-10 09:13:27 +00:00
|
|
|
if plugin.name().startswith('gst')
|
|
|
|
plugin_names += [plugin.name().substring(3)]
|
|
|
|
else
|
|
|
|
plugin_names += [plugin.name()]
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
summary({
|
|
|
|
'Plugins': plugin_names,
|
|
|
|
}, list_sep: ', ')
|