2016-08-04 21:33:55 +00:00
|
|
|
project('gst-editing-services', 'c',
|
2019-01-17 02:30:06 +00:00
|
|
|
version : '1.15.1',
|
2018-07-25 11:50:02 +00:00
|
|
|
meson_version : '>= 0.47',
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
glib_req = '>= 2.40.0'
|
|
|
|
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
2018-09-24 14:41:24 +00:00
|
|
|
|
|
|
|
cdata = configuration_data()
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
# 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
|
|
|
|
if cc.get_id() == 'msvc'
|
2016-11-17 18:31:50 +00:00
|
|
|
add_project_arguments(
|
|
|
|
'/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)
|
|
|
|
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
|
|
|
|
|
2017-08-11 21:27:48 +00:00
|
|
|
# Symbol visibility
|
2018-09-24 14:41:24 +00:00
|
|
|
if cc.get_id() == 'msvc'
|
|
|
|
export_define = '__declspec(dllexport) extern'
|
|
|
|
elif cc.has_argument('-fvisibility=hidden')
|
2017-08-11 21:27:48 +00:00
|
|
|
add_project_arguments('-fvisibility=hidden', language: 'c')
|
2018-09-24 14:41:24 +00:00
|
|
|
export_define = 'extern __attribute__ ((visibility ("default")))'
|
|
|
|
else
|
|
|
|
export_define = 'extern'
|
2017-08-11 21:27:48 +00:00
|
|
|
endif
|
|
|
|
|
2018-09-24 14:41:24 +00:00
|
|
|
# Passing this through the command line would be too messy
|
|
|
|
cdata.set('GST_API_EXPORT', export_define)
|
|
|
|
|
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))
|
|
|
|
cdata.set('PACKAGE_BUGREPORT', '"http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer"')
|
|
|
|
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'])
|
|
|
|
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'])
|
2017-01-13 12:41:51 +00:00
|
|
|
gstvalidate_dep = dependency('gst-validate-1.0', version : gst_req, required : false,
|
|
|
|
fallback : ['gst-devtools', 'validate_dep'])
|
2016-08-04 21:33:55 +00:00
|
|
|
|
2017-06-23 20:18:36 +00:00
|
|
|
gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
|
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,
|
2016-09-07 19:53:06 +00:00
|
|
|
gstcontroller_dep, gio_dep, libxml_dep]
|
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
|
|
|
|
|
2017-06-09 20:37:48 +00:00
|
|
|
configure_file(output : 'config.h', configuration : cdata)
|
2016-08-04 21:33:55 +00:00
|
|
|
|
|
|
|
|
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.
|
2018-07-25 11:50:02 +00:00
|
|
|
build_gir = gir.found() and not meson.is_cross_build()
|
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);' + \
|
|
|
|
'ges_init();' ]
|
2016-08-04 21:33:55 +00:00
|
|
|
|
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',
|
|
|
|
'-Wdeclaration-after-statement',
|
|
|
|
'-Wvla',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach extra_arg : warning_flags
|
|
|
|
if cc.has_argument (extra_arg)
|
|
|
|
add_project_arguments([extra_arg], language: 'c')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
configinc = include_directories('.')
|
|
|
|
subdir('ges')
|
|
|
|
subdir('plugins')
|
|
|
|
subdir('tools')
|
|
|
|
subdir('pkgconfig')
|
|
|
|
subdir('tests')
|
|
|
|
subdir('examples')
|
2016-08-25 18:04:54 +00:00
|
|
|
|
2018-07-08 14:36:36 +00:00
|
|
|
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'))
|
|
|
|
'''
|
2018-10-08 22:25:21 +00:00
|
|
|
python3 = import('python').find_installation()
|
2018-07-08 14:36:36 +00:00
|
|
|
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
|
|
|
|
endif
|
|
|
|
|
|
|
|
if pygi_override_dir != ''
|
|
|
|
message('pygobject overrides directory ' + pygi_override_dir)
|
|
|
|
subdir('bindings/python')
|
|
|
|
endif
|
|
|
|
|
2017-02-15 15:52:24 +00:00
|
|
|
if build_machine.system() == 'windows'
|
|
|
|
message('Disabling gtk-doc while building on Windows')
|
|
|
|
else
|
2018-07-25 11:50:02 +00:00
|
|
|
if find_program('gtkdoc-scan', required : get_option('gtk_doc')).found()
|
2016-08-25 18:04:54 +00:00
|
|
|
subdir('docs')
|
|
|
|
else
|
2017-03-10 22:46:24 +00:00
|
|
|
message('Not building documentation as gtk-doc was not found')
|
2016-08-25 18:04:54 +00:00
|
|
|
endif
|
|
|
|
endif
|
2016-09-30 14:35:42 +00:00
|
|
|
|
|
|
|
run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
|