From cea4346d84eda7df2f0d02c1c716217fca7c1982 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 23 Jan 2017 12:12:06 -0300 Subject: [PATCH] meson: Build GIR files --- gst-libs/gst/gl/meson.build | 20 +++++++++++++++++++- gst-libs/gst/insertbin/meson.build | 19 ++++++++++++++++++- gst-libs/gst/mpegts/meson.build | 20 ++++++++++++++++++-- gst-libs/gst/player/meson.build | 21 ++++++++++++++++++++- meson.build | 8 ++++++++ meson_options.txt | 3 +++ 6 files changed, 86 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/gl/meson.build b/gst-libs/gst/gl/meson.build index b228c7e..4231240 100644 --- a/gst-libs/gst/gl/meson.build +++ b/gst-libs/gst/gl/meson.build @@ -595,9 +595,27 @@ if build_gstgl # Don't need vs_module_defs for gstgl because we do symbol exporting in the # function definitions via __declspec(dllexport/import) ) - # TODO: generate gir + gen_sources = [] + if build_gir + gl_gir = gnome.generate_gir(gstgl, + sources : gl_sources + gl_headers, + namespace : 'GstGL', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-gl-1.0', + includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'], + install : true, + extra_args : gir_init_section + ['-DGST_USE_UNSTABLE_API', + '--c-include=gst/gl/gl.h'], + dependencies : [gst_dep, gstbase_dep, gstvideo_dep] + ) + gen_sources += gl_gir + endif + gstgl_dep = declare_dependency(link_with : gstgl, include_directories : [libsinc], + sources: gen_sources, dependencies : [gstbase_dep, gstvideo_dep] + gl_winsys_deps) endif diff --git a/gst-libs/gst/insertbin/meson.build b/gst-libs/gst/insertbin/meson.build index 565be5f..20d71c6 100644 --- a/gst-libs/gst/insertbin/meson.build +++ b/gst-libs/gst/insertbin/meson.build @@ -12,8 +12,25 @@ gstinsertbin = library('gstinsertbin-' + api_version, dependencies : [gst_dep], vs_module_defs: vs_module_defs_dir + 'libgstinsertbin.def', ) -# TODO: generate gir + +gen_sources = [] +if build_gir + insertbin_gir = gnome.generate_gir(gstinsertbin, + sources : insert_sources + insert_headers, + namespace : 'GstInsertBin', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-insertbin-1.0', + includes : ['Gst-1.0'], + install : true, + extra_args : gir_init_section + ['-DGST_USE_UNSTABLE_API'], + dependencies : [gst_dep] + ) + gen_sources += insertbin_gir +endif gstinsertbin_dep = declare_dependency(link_with : gstinsertbin, include_directories : [libsinc], + sources: gen_sources, dependencies : [gst_dep]) diff --git a/gst-libs/gst/mpegts/meson.build b/gst-libs/gst/mpegts/meson.build index b189e69..ea430b3 100644 --- a/gst-libs/gst/mpegts/meson.build +++ b/gst-libs/gst/mpegts/meson.build @@ -25,6 +25,7 @@ mpegts_h = custom_target('mpegtsenum_h', install : true, install_dir : 'include/gstreamer-1.0/gst/mpegts', command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@']) +gen_sources = [mpegts_h] mpegts_c = custom_target('mpegtsenum_c', output : 'gstmpegts-enumtypes.c', @@ -41,9 +42,24 @@ gstmpegts = library('gstmpegts-' + api_version, dependencies : [gst_dep], vs_module_defs: vs_module_defs_dir + 'libgstmpegts.def', ) -# TODO: generate gir +if build_gir + mpegts_gir = gnome.generate_gir(gstmpegts, + sources : mpegts_sources + mpegts_headers, + namespace : 'GstMpegts', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-mpegts-1.0', + includes : ['Gst-1.0'], + install : true, + extra_args : gir_init_section + ['-DGST_USE_UNSTABLE_API'], + dependencies : [gst_dep] + ) + gen_sources += mpegts_gir +endif + gstmpegts_dep = declare_dependency(link_with : gstmpegts, include_directories : [libsinc], dependencies : [gst_dep], - sources : [mpegts_h]) + sources : gen_sources) diff --git a/gst-libs/gst/player/meson.build b/gst-libs/gst/player/meson.build index d881d54..5033d1a 100644 --- a/gst-libs/gst/player/meson.build +++ b/gst-libs/gst/player/meson.build @@ -33,9 +33,28 @@ gstplayer = library('gstplayer-' + api_version, gsttag_dep, gstpbutils_dep], vs_module_defs: vs_module_defs_dir + 'libgstplayer.def', ) -# TODO: gir + +gen_sources = [] +if build_gir + player_gir = gnome.generate_gir(gstplayer, + sources : gstplayer_sources + gstplayer_headers, + namespace : 'GstPlayer', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-player-1.0', + includes : ['Gst-1.0', 'GstPbutils-1.0', 'GstBase-1.0', 'GstVideo-1.0', + 'GstAudio-1.0', 'GstTag-1.0'], + install : true, + extra_args : gir_init_section + ['-DGST_USE_UNSTABLE_API'], + dependencies : [gstbase_dep, gstvideo_dep, gstaudio_dep, + gsttag_dep, gstpbutils_dep] + ) + gen_sources += player_gir +endif gstplayer_dep = declare_dependency(link_with : gstplayer, include_directories : [libsinc], + sources: gen_sources, dependencies : [gstbase_dep, gstvideo_dep, gstaudio_dep, gsttag_dep, gstpbutils_dep]) diff --git a/meson.build b/meson.build index 5c0a9cc..5ef8747 100644 --- a/meson.build +++ b/meson.build @@ -373,6 +373,14 @@ vs_module_defs_dir = meson.current_source_dir() + '/win32/common/' # Used by the *_mkenum.py helper scripts glib_mkenums = find_program('glib-mkenums') +gir = find_program('g-ir-scanner', required : false) +gnome = import('gnome') +build_gir = gir.found() and not meson.is_cross_build() and not get_option('disable_introspection') +gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \ + 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \ + 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ + 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ + 'gst_init(NULL,NULL);' ] subdir('gst-libs') subdir('gst') subdir('sys') diff --git a/meson_options.txt b/meson_options.txt index ed97cda..5d66945 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,3 +5,6 @@ option('with_gl_winsys', type : 'string', value : 'auto', description : 'A comma option('with_egl_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libEGL.so library (default: libEGL.so)') option('with_opengl_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libGL.so library (default: libGL.so)') option('with_gles2_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libGLESv2.so library (default: libGLESv2.so)') +option('disable_introspection', + type : 'boolean', value : false, + description : 'Whether to disable the introspection generation') -- 2.7.4