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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2572>
This commit is contained in:
Jan Tojnar 2022-08-12 23:57:31 +02:00
parent 6d7a5a91bf
commit 81cc05e61e
3 changed files with 9 additions and 8 deletions

View File

@ -31,7 +31,7 @@ cogl_pkg_private_deps = [
if have_profiler if have_profiler
cogl_pkg_private_deps += [ cogl_pkg_private_deps += [
sysprof_dep, libsysprof_capture_dep,
] ]
endif endif

View File

@ -411,7 +411,7 @@ endif
have_profiler = get_option('profiler') have_profiler = get_option('profiler')
if have_profiler if have_profiler
# libsysprof-capture support # libsysprof-capture support
sysprof_dep = dependency('sysprof-capture-4', libsysprof_capture_dep = dependency('sysprof-capture-4',
required: true, required: true,
default_options: [ default_options: [
'examples=false', 'examples=false',
@ -424,6 +424,13 @@ if have_profiler
], ],
fallback: ['sysprof', 'libsysprof_capture_dep'], 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 endif
required_functions = [ required_functions = [

View File

@ -885,12 +885,6 @@ if have_profiler
'core/meta-profiler.h', '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') 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', dbus_sysprof3_profiler_built_sources = gnome.gdbus_codegen('meta-dbus-sysprof3-profiler',
sysprof3_dbus_file, sysprof3_dbus_file,