From 81cc05e61e6e34e231fbdf374c38fb95d7b86f3b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 12 Aug 2022 23:57:31 +0200 Subject: [PATCH] build: Fix Sysprof interface path with split sysprof package When sysprof-4 and libsysprof-capture-4 are installed into different prefixes, such as with Nix package manager, the D-Bus interfaces are likely not discoverable from the latter package. Part-of: --- cogl/meson.build | 2 +- meson.build | 9 ++++++++- src/meson.build | 6 ------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cogl/meson.build b/cogl/meson.build index a87cd1823..e73f1a8f9 100644 --- a/cogl/meson.build +++ b/cogl/meson.build @@ -31,7 +31,7 @@ cogl_pkg_private_deps = [ if have_profiler cogl_pkg_private_deps += [ - sysprof_dep, + libsysprof_capture_dep, ] endif diff --git a/meson.build b/meson.build index 56c1d7321..25c744065 100644 --- a/meson.build +++ b/meson.build @@ -411,7 +411,7 @@ endif have_profiler = get_option('profiler') if have_profiler # libsysprof-capture support - sysprof_dep = dependency('sysprof-capture-4', + libsysprof_capture_dep = dependency('sysprof-capture-4', required: true, default_options: [ 'examples=false', @@ -424,6 +424,13 @@ if have_profiler ], fallback: ['sysprof', 'libsysprof_capture_dep'], ) + + if libsysprof_capture_dep.type_name() == 'pkgconfig' + sysprof_dep = dependency('sysprof-4') + sysprof_dbus_interfaces_dir = join_paths(sysprof_dep.get_variable('datadir'), 'dbus-1', 'interfaces') + else + sysprof_dbus_interfaces_dir = join_paths(mutter_srcdir, 'subprojects', 'sysprof', 'src') + endif endif required_functions = [ diff --git a/src/meson.build b/src/meson.build index 1231d5544..7063687a7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -885,12 +885,6 @@ if have_profiler 'core/meta-profiler.h', ] - if sysprof_dep.type_name() == 'pkgconfig' - sysprof_dbus_interfaces_dir = join_paths(sysprof_dep.get_variable('datadir'), 'dbus-1', 'interfaces') - else - sysprof_dbus_interfaces_dir = join_paths(mutter_srcdir, 'subprojects', 'sysprof', 'src') - endif - sysprof3_dbus_file = join_paths(sysprof_dbus_interfaces_dir, 'org.gnome.Sysprof3.Profiler.xml') dbus_sysprof3_profiler_built_sources = gnome.gdbus_codegen('meta-dbus-sysprof3-profiler', sysprof3_dbus_file,