meson: remove pc_sysroot from registry_dir
The pkg-config variable 'registry_dir' is intended to represent where
the Redfish Message Registries will be installed. When cross-compiling,
bitbake provides meson with the `sys_root` as somewhere in the bitbake
build tree, which meson then uses as an argument to pkg-config, which
uses it as the `${pc_sysrootdir}` value. If we use `${pc_sysrootdir}`
in the pkg-config file, it ends up being expanded as the cross-compile
sysroot and not the final location. Remove the `${pc_sysroot}` portion
so that the value points at the final location.
There is an argument that it is useful to have it contain the sysroot
location during the compilation state. Some repositories _could_
choose to process the registry during build time, like phosphor-logging
does with the `yamldir` variable. However, cross-compile environments
provide an alternative way to get the sysroot, such as
`meson.get_external_property('sys_root')`. Having it already included
in the pkg-config makes it harder to get the install location (since
you have to subtract the path, rather than add it).
Arguably, `yamldir` should also be adjusted but that will require
changes in, at least, phosphor-logging that should be made separately.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I12b4ff68478583f6c2a8b438689aeb3a5d66228f
diff --git a/meson.build b/meson.build
index 133767d..a167846 100644
--- a/meson.build
+++ b/meson.build
@@ -91,7 +91,7 @@
description: 'Generated sdbusplus bindings for phosphor-dbus-interfaces',
variables: [
'yamldir=' + '${pc_sysrootdir}${prefix}' / inst_yaml_dir,
- 'registry_dir=' + '${pc_sysrootdir}${prefix}' / inst_registry_dir,
+ 'registry_dir=' + '${prefix}' / inst_registry_dir,
],
)