2024-04-29 19:22:56 +00:00
|
|
|
project('gstreamer-sharp', ['cs', 'c'], version: '1.22.12.1',
|
2022-09-21 13:49:45 +00:00
|
|
|
meson_version : '>= 0.62', license: 'LGPL')
|
2017-08-21 18:20:47 +00:00
|
|
|
|
|
|
|
if host_machine.system() == 'osx'
|
|
|
|
lib_prefix=''
|
|
|
|
lib_suffix='.dylib'
|
|
|
|
else
|
|
|
|
lib_prefix='.so'
|
|
|
|
lib_suffix=''
|
|
|
|
endif
|
|
|
|
|
|
|
|
gtk_sharp_required_version = '>=3.22.6'
|
|
|
|
|
2017-09-25 15:00:00 +00:00
|
|
|
csc = meson.get_compiler('cs')
|
|
|
|
if csc.get_id() == 'mono'
|
|
|
|
add_project_arguments('-keyfile:' + join_paths(meson.current_source_dir(), meson.project_name() + '.snk'),
|
|
|
|
language: ['cs'])
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2017-08-30 17:02:50 +00:00
|
|
|
subproject('gtk-sharp', default_options: ['install=false'])
|
|
|
|
gtk_sharp = subproject('gtk-sharp')
|
|
|
|
|
|
|
|
glib_sharp_dep = gtk_sharp.get_variable('glib_sharp_dep')
|
|
|
|
glib_sharp = gtk_sharp.get_variable('glib_sharp')
|
|
|
|
|
|
|
|
gio_sharp_dep = gtk_sharp.get_variable('gio_sharp_dep')
|
|
|
|
gio_sharp = gtk_sharp.get_variable('gio_sharp')
|
|
|
|
|
|
|
|
gapi_fixup = gtk_sharp.get_variable('gapi_fixup')
|
|
|
|
gapi_codegen = gtk_sharp.get_variable('gapi_codegen')
|
|
|
|
|
|
|
|
glib_api_includes = gtk_sharp.get_variable('glib_api_includes')
|
|
|
|
gio_api_includes = gtk_sharp.get_variable('gio_api_includes')
|
|
|
|
has_gtk = gtk_sharp.get_variable('has_gtk')
|
|
|
|
if has_gtk
|
|
|
|
gtk_sharp_dep = [gtk_sharp.get_variable('gtk_sharp_dep'),
|
|
|
|
gtk_sharp.get_variable('atk_sharp_dep')]
|
2017-08-21 18:20:47 +00:00
|
|
|
else
|
|
|
|
gtk_sharp_dep = dependency('gtk-sharp-3.0', version: gtk_sharp_required_version,
|
|
|
|
required: false)
|
|
|
|
endif
|
2017-10-04 20:07:26 +00:00
|
|
|
|
2019-04-13 06:43:48 +00:00
|
|
|
mono_path = [gtk_sharp.get_variable('mono_path'), join_paths(meson.current_build_dir(), 'sources')]
|
2017-10-04 20:07:26 +00:00
|
|
|
|
2017-09-20 20:22:17 +00:00
|
|
|
codegen_dependencies = [gapi_codegen, gapi_fixup, glib_sharp, gio_sharp]
|
2017-08-30 17:02:50 +00:00
|
|
|
gapi_fixup = gapi_fixup.full_path()
|
|
|
|
gapi_codegen = gapi_codegen.full_path()
|
2017-08-21 18:20:47 +00:00
|
|
|
|
|
|
|
gacutil = find_program('gacutil')
|
|
|
|
generate_api = find_program('generate_code.py')
|
2017-09-26 12:30:12 +00:00
|
|
|
nuget = find_program('nuget.py')
|
2017-10-04 19:02:53 +00:00
|
|
|
diff = find_program('Tests/test_abi.py')
|
2017-08-21 18:20:47 +00:00
|
|
|
|
|
|
|
# TODO Handle monodoc
|
|
|
|
|
|
|
|
apiversion = '1.0'
|
|
|
|
gst_required_version = '>=@0@'.format(meson.project_version())
|
|
|
|
gst_deps = []
|
|
|
|
|
2018-01-12 16:04:37 +00:00
|
|
|
# dependency name, [subproject-name, internal-dep-name, library-name']
|
|
|
|
gst_deps_defs = [
|
|
|
|
['gstreamer', ['gstreamer', 'gst_dep'], 'libgst'],
|
|
|
|
['gstreamer-app', ['gst-plugins-base', 'app_dep'], 'gstapp'],
|
|
|
|
['gstreamer-audio', ['gst-plugins-base', 'audio_dep'], 'gstaudio'],
|
|
|
|
['gstreamer-base', ['gstreamer', 'gst_base_dep'], 'gst_base'],
|
|
|
|
['gstreamer-controller', ['gstreamer', 'gst_controller_dep'], 'gst_controller'],
|
|
|
|
['gstreamer-fft', ['gst-plugins-base', 'fft_dep'], 'gstfft'],
|
|
|
|
['gstreamer-net', ['gstreamer', 'gst_net_dep'], 'gst_net'],
|
|
|
|
['gstreamer-pbutils', ['gst-plugins-base', 'pbutils_dep'], 'pbutils'],
|
|
|
|
['gstreamer-riff', ['gst-plugins-base', 'riff_dep'], 'gstriff'],
|
|
|
|
['gstreamer-rtp', ['gst-plugins-base', 'rtp_dep'], 'gst_rtp'],
|
|
|
|
['gstreamer-rtsp', ['gst-plugins-base', 'rtsp_dep'], 'gst_rtsp'],
|
|
|
|
['gstreamer-sdp', ['gst-plugins-base', 'sdp_dep'], 'gstsdp'],
|
|
|
|
['gstreamer-tag', ['gst-plugins-base', 'tag_dep'], 'gsttag'],
|
2018-03-19 18:49:25 +00:00
|
|
|
['gstreamer-video', ['gst-plugins-base', 'video_dep'], 'gstvideo'],
|
|
|
|
['gstreamer-webrtc', ['gst-plugins-bad', 'gstwebrtc_dep'], 'gstwebrtc'],
|
|
|
|
]
|
2018-01-12 16:04:37 +00:00
|
|
|
|
|
|
|
foreach dep: gst_deps_defs
|
2017-08-21 18:20:47 +00:00
|
|
|
gst_deps += [dependency(dep.get(0) + '-' + apiversion, version: gst_required_version,
|
|
|
|
fallback: dep.get(1))]
|
|
|
|
endforeach
|
|
|
|
|
2017-08-29 18:25:18 +00:00
|
|
|
ges_dep = dependency('gst-editing-services-' + apiversion, version: gst_required_version,
|
2018-04-22 00:51:59 +00:00
|
|
|
fallback: ['gst-editing-services', 'ges_dep'], required: false)
|
2017-08-29 18:25:18 +00:00
|
|
|
|
2018-01-12 16:04:37 +00:00
|
|
|
if ges_dep.found()
|
|
|
|
gst_deps_defs += [
|
|
|
|
['gst-editing-services', ['gst-editing-services', 'ges_dep'], 'libges'],
|
|
|
|
]
|
2019-04-13 06:43:48 +00:00
|
|
|
mono_path += [join_paths(meson.current_build_dir(), 'ges')]
|
2018-01-12 16:04:37 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
testsenv = environment()
|
|
|
|
testsenv.prepend('MONO_PATH', mono_path)
|
|
|
|
i = 0
|
2019-04-13 06:43:48 +00:00
|
|
|
testsenv_ld_library_path = []
|
2018-01-12 16:04:37 +00:00
|
|
|
foreach dep: gst_deps + [ges_dep]
|
|
|
|
if dep.type_name() == 'pkgconfig'
|
2021-10-17 23:40:14 +00:00
|
|
|
testsenv_ld_library_path += [dep.get_variable('libdir')]
|
2018-01-12 16:04:37 +00:00
|
|
|
else
|
|
|
|
depdef = gst_deps_defs[i][1]
|
|
|
|
libname = gst_deps_defs[i].get(2, '')
|
|
|
|
if libname != ''
|
|
|
|
proj = subproject(depdef[0])
|
|
|
|
libpath = proj.get_variable(libname).full_path().split('/')
|
|
|
|
dirname = ''
|
|
|
|
j = 1
|
|
|
|
foreach comp: libpath
|
|
|
|
if j < libpath.length()
|
|
|
|
dirname += '/' + comp
|
|
|
|
endif
|
|
|
|
j += 1
|
|
|
|
endforeach
|
2019-04-13 06:43:48 +00:00
|
|
|
testsenv_ld_library_path += [dirname]
|
2018-01-12 16:04:37 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
i += 1
|
|
|
|
endforeach
|
2019-04-13 06:43:48 +00:00
|
|
|
# FIXME: port this to macOS and Windows
|
|
|
|
testsenv.prepend('LD_LIBRARY_PATH', testsenv_ld_library_path)
|
2018-01-12 16:04:37 +00:00
|
|
|
|
2017-08-21 18:20:47 +00:00
|
|
|
subdir('sources')
|
2017-08-29 18:25:18 +00:00
|
|
|
if ges_dep.found()
|
|
|
|
subdir('ges')
|
2017-09-26 12:30:12 +00:00
|
|
|
custom_target('GESSharp-nuget',
|
|
|
|
command: [nuget, '--package-name', 'GESSharp',
|
|
|
|
'--assembly', ges_sharp.full_path(),
|
|
|
|
'--dependency=GstSharp:' + meson.project_version(),
|
|
|
|
'--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
|
|
|
|
'--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
|
|
|
|
'--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
|
|
|
|
'--version', meson.project_version(),
|
|
|
|
'--tags', 'GStreamer GES GstSharp bindings',
|
|
|
|
'--builddir', meson.current_build_dir(),
|
2017-11-23 15:28:13 +00:00
|
|
|
'--dependency', 'GstSharp:' + meson.project_version(),
|
2017-09-26 12:30:12 +00:00
|
|
|
],
|
|
|
|
output: 'GESSharp.' + meson.project_version() + '.nupkg'
|
|
|
|
)
|
2017-08-29 18:25:18 +00:00
|
|
|
endif
|
|
|
|
|
2017-09-26 12:30:12 +00:00
|
|
|
custom_target('GstSharp-nuget',
|
|
|
|
command: [nuget, '--package-name', 'GstSharp',
|
|
|
|
'--assembly', gst_sharp.full_path(),
|
|
|
|
'--assembly', gio_sharp.full_path(),
|
|
|
|
'--assembly', glib_sharp.full_path(),
|
|
|
|
'--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
|
|
|
|
'--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
|
|
|
|
'--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
|
|
|
|
'--version', meson.project_version(),
|
|
|
|
'--tags', 'GStreamer GstSharp bindings',
|
|
|
|
'--builddir', meson.current_build_dir(),
|
|
|
|
],
|
|
|
|
output: 'GstSharp.' + meson.project_version() + '.nupkg',
|
|
|
|
)
|
2017-08-30 17:02:50 +00:00
|
|
|
|
2017-08-21 18:20:47 +00:00
|
|
|
subdir('samples')
|
2018-05-17 16:03:55 +00:00
|
|
|
subdir('Tests')
|
|
|
|
|
|
|
|
bindinator = subproject('bindinator', default_options: ['gapi_fixup=@0@'.format(gapi_fixup)])
|
|
|
|
if bindinator.get_variable('found')
|
|
|
|
bindinate = bindinator.get_variable('bindinate')
|
|
|
|
run_target('bindinate_gstreamer',
|
|
|
|
command: [bindinate,
|
|
|
|
'--name=gstreamer', '--regenerate=true',
|
2018-03-19 18:49:25 +00:00
|
|
|
'--merge-with=GstApp-1.0,GstAudio-1.0,GstBase-1.0,GstController-1.0,GstNet-1.0,GstPbutils-1.0,GstRtp-1.0,GstRtsp-1.0,GstSdp-1.0,GstTag-1.0,GstVideo-1.0,GstWebRTC-1.0',
|
2018-05-17 16:03:55 +00:00
|
|
|
'--gir=Gst-1.0',
|
|
|
|
'--copy-girs=@0@'.format(join_paths(meson.current_source_dir(), 'girs'))],
|
|
|
|
depends: []
|
|
|
|
)
|
|
|
|
run_target('bindinate_ges',
|
|
|
|
command: ['sh', '-c',
|
|
|
|
'''@0@ --name=gst-editing-services --regenerate=true --gir=GES-1.0 && mv @1@/sources/gst-editing-services-sharp-api.raw @1@/ges/gst-editing-services-api.raw '''.format(
|
|
|
|
bindinate.path(),
|
|
|
|
meson.current_source_dir()),
|
|
|
|
],
|
|
|
|
depends: []
|
|
|
|
)
|
|
|
|
python3 = import('python3').find_python()
|
|
|
|
run_target('update-code', command: [find_program('update_sources.py')])
|
|
|
|
run_target('update-all', command: [find_program('update_sources.py'), 'bindinate'])
|
|
|
|
else
|
|
|
|
warning('Bindinator not usable as some required dependencies are not avalaible.')
|
2018-03-19 18:49:25 +00:00
|
|
|
endif
|
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())
|