Add initial meson devenv support
authorXavier Claessens <xavier.claessens@collabora.com>
Sun, 21 Feb 2021 15:20:15 +0000 (10:20 -0500)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 19 Oct 2021 16:18:43 +0000 (16:18 +0000)
There is still a few things missing compared to gst-env.py, but it is
functional.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1162>

meson.build

index 12f02c9..af130e9 100644 (file)
@@ -12,6 +12,7 @@ gst_version = '>= @0@'.format(meson.project_version())
 build_system = build_machine.system()
 cc = meson.get_compiler('c')
 
+fs = import('fs')
 gnome = import('gnome')
 pkgconfig = import('pkgconfig')
 python3 = import('python').find_installation()
@@ -219,13 +220,24 @@ if documented_projects != ''
 endif
 
 all_plugins_paths = []
+all_plugins_dirs = []
 foreach plugin: all_plugins
   all_plugins_paths += plugin.full_path()
+  all_plugins_dirs += fs.parent(plugin.full_path())
 endforeach
 # Work around meson bug: https://github.com/mesonbuild/meson/pull/6770
 pathsep = host_machine.system() == 'windows' ? ';' : ':'
 all_plugins_paths = pathsep.join(all_plugins_paths)
 
+devenv = environment()
+devenv.set('GST_PLUGIN_PATH', all_plugins_dirs)
+devenv.set('CURRENT_GST', meson.current_source_dir())
+devenv.set('GST_VERSION', meson.project_version())
+devenv.set('GST_ENV', 'gst-' + meson.project_version())
+devenv.set('GST_REGISTRY', meson.current_build_dir() / 'registry.dat')
+devenv.set('GST_PLUGIN_SYSTEM_PATH', '')
+meson.add_devenv(devenv)
+
 generate_plugins_paths = find_program('scripts/generate_plugins_path.py')
 configure_file(
   output : 'GstPluginsPath.json',