docs: Use the MESON_BUILD_ROOT env variable in the plugins cache generator
authorThibault Saunier <tsaunier@igalia.com>
Wed, 15 May 2019 13:23:06 +0000 (09:23 -0400)
committerThibault Saunier <tsaunier@gnome.org>
Thu, 16 May 2019 18:22:20 +0000 (18:22 +0000)
docs/gst-plugins-doc-cache-generator.py
docs/meson.build

index d1509e6..11d7d52 100755 (executable)
@@ -36,7 +36,6 @@ except ImportError:  # python <3.3
 # make it happen. For properties, the best way is to use th
 # GST_PARAM_DOC_SHOW_DEFAULT flag.
 UNSTABLE_VALUE = "unstable-values"
-BUILD_ROOT = "@BUILD_ROOT@"
 
 
 def dict_recursive_update(d, u):
@@ -76,6 +75,7 @@ def test_unstable_values():
 if __name__ == "__main__":
     cache_filename = sys.argv[1]
     output_filename = sys.argv[2]
+    build_root = os.environ.get('MESON_BUILD_ROOT', '')
 
     subenv = os.environ.copy()
     cache = {}
@@ -93,7 +93,7 @@ if __name__ == "__main__":
         gst_plugins_paths.append(os.path.dirname(plugin_path))
 
     try:
-        with open(os.path.join(BUILD_ROOT, 'GstPluginsPath.json'), newline='\n') as f:
+        with open(os.path.join(build_root, 'GstPluginsPath.json'), newline='\n') as f:
             plugin_paths = os.pathsep.join(json.load(f))
     except FileNotFoundError:
         plugin_paths = ""
index 2e78278..584bbf1 100644 (file)
@@ -18,16 +18,11 @@ hotdoc_plugin_scanner = executable('gst-hotdoc-plugins-scanner',
   install: true,
 )
 
-conf = configuration_data()
-# We pass the build root so the doc cache generator can try
-# to find GstPluginsPath.json to set GST_PLUGIN_PATH and
-# thus handle plugins dependencies.
-conf.set('BUILD_ROOT', meson.build_root())
 configure_file(
     input: 'gst-plugins-doc-cache-generator.py',
     output: 'gst-plugins-doc-cache-generator',
     install_dir: helpers_install_dir,
-    configuration: conf
+    copy: true
 )
 
 plugins_cache_generator = find_program(join_paths(meson.current_build_dir(), 'gst-plugins-doc-cache-generator'))