1 project('gstreamer-sharp', ['cs', 'c'], version: '1.19.2.1',
2 meson_version : '>= 0.54', license: 'LGPL')
4 if host_machine.system() == 'osx'
12 gtk_sharp_required_version = '>=3.22.6'
14 csc = meson.get_compiler('cs')
15 if csc.get_id() == 'mono'
16 add_project_arguments('-keyfile:' + join_paths(meson.current_source_dir(), meson.project_name() + '.snk'),
21 subproject('gtk-sharp', default_options: ['install=false'])
22 gtk_sharp = subproject('gtk-sharp')
24 glib_sharp_dep = gtk_sharp.get_variable('glib_sharp_dep')
25 glib_sharp = gtk_sharp.get_variable('glib_sharp')
27 gio_sharp_dep = gtk_sharp.get_variable('gio_sharp_dep')
28 gio_sharp = gtk_sharp.get_variable('gio_sharp')
30 gapi_fixup = gtk_sharp.get_variable('gapi_fixup')
31 gapi_codegen = gtk_sharp.get_variable('gapi_codegen')
33 glib_api_includes = gtk_sharp.get_variable('glib_api_includes')
34 gio_api_includes = gtk_sharp.get_variable('gio_api_includes')
35 has_gtk = gtk_sharp.get_variable('has_gtk')
37 gtk_sharp_dep = [gtk_sharp.get_variable('gtk_sharp_dep'),
38 gtk_sharp.get_variable('atk_sharp_dep')]
40 gtk_sharp_dep = dependency('gtk-sharp-3.0', version: gtk_sharp_required_version,
44 mono_path = [gtk_sharp.get_variable('mono_path'), join_paths(meson.current_build_dir(), 'sources')]
46 codegen_dependencies = [gapi_codegen, gapi_fixup, glib_sharp, gio_sharp]
47 gapi_fixup = gapi_fixup.full_path()
48 gapi_codegen = gapi_codegen.full_path()
50 gacutil = find_program('gacutil')
51 generate_api = find_program('generate_code.py')
52 nuget = find_program('nuget.py')
53 diff = find_program('Tests/test_abi.py')
58 gst_required_version = '>=@0@'.format(meson.project_version())
61 # dependency name, [subproject-name, internal-dep-name, library-name']
63 ['gstreamer', ['gstreamer', 'gst_dep'], 'libgst'],
64 ['gstreamer-app', ['gst-plugins-base', 'app_dep'], 'gstapp'],
65 ['gstreamer-audio', ['gst-plugins-base', 'audio_dep'], 'gstaudio'],
66 ['gstreamer-base', ['gstreamer', 'gst_base_dep'], 'gst_base'],
67 ['gstreamer-controller', ['gstreamer', 'gst_controller_dep'], 'gst_controller'],
68 ['gstreamer-fft', ['gst-plugins-base', 'fft_dep'], 'gstfft'],
69 ['gstreamer-net', ['gstreamer', 'gst_net_dep'], 'gst_net'],
70 ['gstreamer-pbutils', ['gst-plugins-base', 'pbutils_dep'], 'pbutils'],
71 ['gstreamer-riff', ['gst-plugins-base', 'riff_dep'], 'gstriff'],
72 ['gstreamer-rtp', ['gst-plugins-base', 'rtp_dep'], 'gst_rtp'],
73 ['gstreamer-rtsp', ['gst-plugins-base', 'rtsp_dep'], 'gst_rtsp'],
74 ['gstreamer-sdp', ['gst-plugins-base', 'sdp_dep'], 'gstsdp'],
75 ['gstreamer-tag', ['gst-plugins-base', 'tag_dep'], 'gsttag'],
76 ['gstreamer-video', ['gst-plugins-base', 'video_dep'], 'gstvideo'],
77 ['gstreamer-webrtc', ['gst-plugins-bad', 'gstwebrtc_dep'], 'gstwebrtc'],
80 foreach dep: gst_deps_defs
81 gst_deps += [dependency(dep.get(0) + '-' + apiversion, version: gst_required_version,
82 fallback: dep.get(1))]
85 ges_dep = dependency('gst-editing-services-' + apiversion, version: gst_required_version,
86 fallback: ['gst-editing-services', 'ges_dep'], required: false)
90 ['gst-editing-services', ['gst-editing-services', 'ges_dep'], 'libges'],
92 mono_path += [join_paths(meson.current_build_dir(), 'ges')]
95 testsenv = environment()
96 testsenv.prepend('MONO_PATH', mono_path)
98 testsenv_ld_library_path = []
99 foreach dep: gst_deps + [ges_dep]
100 if dep.type_name() == 'pkgconfig'
101 testsenv_ld_library_path += [dep.get_pkgconfig_variable('libdir')]
103 depdef = gst_deps_defs[i][1]
104 libname = gst_deps_defs[i].get(2, '')
106 proj = subproject(depdef[0])
107 libpath = proj.get_variable(libname).full_path().split('/')
110 foreach comp: libpath
111 if j < libpath.length()
112 dirname += '/' + comp
116 testsenv_ld_library_path += [dirname]
121 # FIXME: port this to macOS and Windows
122 testsenv.prepend('LD_LIBRARY_PATH', testsenv_ld_library_path)
127 custom_target('GESSharp-nuget',
128 command: [nuget, '--package-name', 'GESSharp',
129 '--assembly', ges_sharp.full_path(),
130 '--dependency=GstSharp:' + meson.project_version(),
131 '--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
132 '--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
133 '--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
134 '--version', meson.project_version(),
135 '--tags', 'GStreamer GES GstSharp bindings',
136 '--builddir', meson.current_build_dir(),
137 '--dependency', 'GstSharp:' + meson.project_version(),
139 output: 'GESSharp.' + meson.project_version() + '.nupkg'
143 custom_target('GstSharp-nuget',
144 command: [nuget, '--package-name', 'GstSharp',
145 '--assembly', gst_sharp.full_path(),
146 '--assembly', gio_sharp.full_path(),
147 '--assembly', glib_sharp.full_path(),
148 '--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
149 '--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
150 '--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
151 '--version', meson.project_version(),
152 '--tags', 'GStreamer GstSharp bindings',
153 '--builddir', meson.current_build_dir(),
155 output: 'GstSharp.' + meson.project_version() + '.nupkg',
161 bindinator = subproject('bindinator', default_options: ['gapi_fixup=@0@'.format(gapi_fixup)])
162 if bindinator.get_variable('found')
163 bindinate = bindinator.get_variable('bindinate')
164 run_target('bindinate_gstreamer',
166 '--name=gstreamer', '--regenerate=true',
167 '--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',
169 '--copy-girs=@0@'.format(join_paths(meson.current_source_dir(), 'girs'))],
172 run_target('bindinate_ges',
173 command: ['sh', '-c',
174 '''@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(
176 meson.current_source_dir()),
180 python3 = import('python3').find_python()
181 run_target('update-code', command: [find_program('update_sources.py')])
182 run_target('update-all', command: [find_program('update_sources.py'), 'bindinate'])
184 warning('Bindinator not usable as some required dependencies are not avalaible.')