From 5f8270f0e80fa17a6ff1f4af98de7ddaafb50c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sat, 19 Jul 2025 12:49:01 +0200 Subject: [PATCH] clapper-app: Retain compatibility with older graphviz --- src/bin/clapper-app/clapper-app-utils.c | 9 +++++++++ src/bin/clapper-app/meson.build | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/bin/clapper-app/clapper-app-utils.c b/src/bin/clapper-app/clapper-app-utils.c index 90ceb6e2..b6854ea2 100644 --- a/src/bin/clapper-app/clapper-app-utils.c +++ b/src/bin/clapper-app/clapper-app-utils.c @@ -610,7 +610,16 @@ _create_pipeline_svg_file_in_thread (GTask *task, GObject *source G_GNUC_UNUSED, gvc = gvContext (); gvLayout (gvc, graph, "dot"); + +#ifdef HAVE_GVC_13 gvRenderData (gvc, graph, "svg", &img_data, &size); +#else + { + guint tmp_size = 0; // Temporary uint to satisfy older API + gvRenderData (gvc, graph, "svg", &img_data, &tmp_size); + size = tmp_size; + } +#endif agclose (graph); gvFreeContext (gvc); diff --git a/src/bin/clapper-app/meson.build b/src/bin/clapper-app/meson.build index 50c29f03..b9b1f38b 100644 --- a/src/bin/clapper-app/meson.build +++ b/src/bin/clapper-app/meson.build @@ -105,6 +105,9 @@ if not pp_option.disabled() if cgraph_dep.found() and gvc_dep.found() clapperapp_c_args += ['-DHAVE_GRAPHVIZ'] clapperapp_deps += [cgraph_dep, gvc_dep] + if gvc_dep.version().version_compare('>= 13.0.0') + clapperapp_c_args += ['-DHAVE_GVC_13'] + endif clapperapp_available_functionalities += 'pipeline-preview' elif pp_option.enabled() error('pipeline-preview option was enabled, but required dependencies were not found')