1 project('gstreamer-sharp', ['cs', 'c'], version: '1.13.0.1',
2 meson_version: '>0.42', 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 if host_machine.system() == 'windows'
49 mono_path = gtk_sharp.get_variable('mono_path') + pathsep
50 mono_path += pathsep + join_paths(meson.current_build_dir(), 'sources')
52 codegen_dependencies = [gapi_codegen, gapi_fixup, glib_sharp, gio_sharp]
53 gapi_fixup = gapi_fixup.full_path()
54 gapi_codegen = gapi_codegen.full_path()
56 gacutil = find_program('gacutil')
57 generate_api = find_program('generate_code.py')
58 nuget = find_program('nuget.py')
59 diff = find_program('Tests/test_abi.py')
64 gst_required_version = '>=@0@'.format(meson.project_version())
67 # dependency name, [subproject-name, internal-dep-name, library-name']
69 ['gstreamer', ['gstreamer', 'gst_dep'], 'libgst'],
70 ['gstreamer-app', ['gst-plugins-base', 'app_dep'], 'gstapp'],
71 ['gstreamer-audio', ['gst-plugins-base', 'audio_dep'], 'gstaudio'],
72 ['gstreamer-base', ['gstreamer', 'gst_base_dep'], 'gst_base'],
73 ['gstreamer-controller', ['gstreamer', 'gst_controller_dep'], 'gst_controller'],
74 ['gstreamer-fft', ['gst-plugins-base', 'fft_dep'], 'gstfft'],
75 ['gstreamer-net', ['gstreamer', 'gst_net_dep'], 'gst_net'],
76 ['gstreamer-pbutils', ['gst-plugins-base', 'pbutils_dep'], 'pbutils'],
77 ['gstreamer-riff', ['gst-plugins-base', 'riff_dep'], 'gstriff'],
78 ['gstreamer-rtp', ['gst-plugins-base', 'rtp_dep'], 'gst_rtp'],
79 ['gstreamer-rtsp', ['gst-plugins-base', 'rtsp_dep'], 'gst_rtsp'],
80 ['gstreamer-sdp', ['gst-plugins-base', 'sdp_dep'], 'gstsdp'],
81 ['gstreamer-tag', ['gst-plugins-base', 'tag_dep'], 'gsttag'],
82 ['gstreamer-video', ['gst-plugins-base', 'video_dep'], 'gstvideo'],]
84 foreach dep: gst_deps_defs
85 gst_deps += [dependency(dep.get(0) + '-' + apiversion, version: gst_required_version,
86 fallback: dep.get(1))]
89 ges_dep = dependency('gst-editing-services-' + apiversion, version: gst_required_version,
90 fallback: ['gst-editing-services', 'ges_dep'])
94 ['gst-editing-services', ['gst-editing-services', 'ges_dep'], 'libges'],
96 mono_path += pathsep + join_paths(meson.current_build_dir(), 'ges')
99 testsenv = environment()
100 testsenv.prepend('MONO_PATH', mono_path)
102 foreach dep: gst_deps + [ges_dep]
103 if dep.type_name() == 'pkgconfig'
104 testsenv.prepend('LD_LIBRARY_PATH', dep.get_pkgconfig_variable('libdir'))
106 depdef = gst_deps_defs[i][1]
107 libname = gst_deps_defs[i].get(2, '')
109 proj = subproject(depdef[0])
110 libpath = proj.get_variable(libname).full_path().split('/')
113 foreach comp: libpath
114 if j < libpath.length()
115 dirname += '/' + comp
119 testsenv.prepend('LD_LIBRARY_PATH', dirname)
128 custom_target('GESSharp-nuget',
129 command: [nuget, '--package-name', 'GESSharp',
130 '--assembly', ges_sharp.full_path(),
131 '--dependency=GstSharp:' + meson.project_version(),
132 '--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
133 '--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
134 '--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
135 '--version', meson.project_version(),
136 '--tags', 'GStreamer GES GstSharp bindings',
137 '--builddir', meson.current_build_dir(),
138 '--dependency', 'GstSharp:' + meson.project_version(),
140 output: 'GESSharp.' + meson.project_version() + '.nupkg'
144 custom_target('GstSharp-nuget',
145 command: [nuget, '--package-name', 'GstSharp',
146 '--assembly', gst_sharp.full_path(),
147 '--assembly', gio_sharp.full_path(),
148 '--assembly', glib_sharp.full_path(),
149 '--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
150 '--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
151 '--license-url', 'https://cgit.freedesktop.org/gstreamer/gstreamer-sharp/plain/COPYING',
152 '--version', meson.project_version(),
153 '--tags', 'GStreamer GstSharp bindings',
154 '--builddir', meson.current_build_dir(),
156 output: 'GstSharp.' + meson.project_version() + '.nupkg',
161 bindinate = find_program('bindinate', required: false)
163 run_target('bindinate_gstreamer',
165 '--name=gstreamer', '--regenerate=true',
166 '--merge-with=GstApp-1.0,GstAudio-1.0,GstBase-1.0,GstController-1.0,GstFft-1.0,GstNet-1.0,GstPbutils-1.0,GstRiff-1.0,GstRtp-1.0,GstRtsp-1.0,GstSdp-1.0,GstTag-1.0,GstVideo-1.0',
169 run_target('bindinate_ges',
170 command: ['sh', '-c',
171 '''bindinate --name=gst-editing-services --regenerate=true --gir=GES-1.0 && mv @0@/sources/gst-editing-services-sharp-api.raw @0@/ges/gst-editing-services-api.raw '''.format(
172 meson.current_source_dir())
175 python3 = import('python3').find_python()
176 run_target('update-code', command: [find_program('update_sources.py')])
177 run_target('update-all', command: [find_program('update_sources.py'), 'bindinate'])