build: fix pkgconfig yamldir var again
pkgconfig's should not have a fully formed prefix but
instead should use a '${prefix}' redirection. This allows
alternative installed root paths, like you would find in the
OE-SDK. Without this '${prefix}', the phosphor-dbus-interfaces.pc
in the SDK will have a literal '/usr/share/...' path and packages
using this variable will be unable to find the SDK-relative path.
Also, since the 'yamldir' variable is intended to be used at
cross-compile time (as opposed to execution time) it should similarly
be prefixed by '${pc_sysrootdir}' according to [1].
Tested: Copied the generated pkgconfig into an OE-SDK (to overwrite
the original one) and confirmed a successful meson build using this
variable and by manually running pkgconfig:
```
$ .../sdk/sysroots/x86_64-oesdk-linux/usr/bin/pkg-config \
--variable=yamldir phosphor-dbus-interfaces
.../sdk/sysroots/arm1176jzs-openbmc-linux-gnueabi/usr/share/phosphor-dbus-yaml/yaml
```
1. https://autotools.io/pkgconfig/cross-compiling.html
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6b078fac65aac7c642358ad73a4acf9df1594174
diff --git a/meson.build b/meson.build
index 2bfa8b6..ec64ee5 100644
--- a/meson.build
+++ b/meson.build
@@ -118,7 +118,7 @@
name: meson.project_name(),
version: meson.project_version(),
description: 'Generated sdbusplus bindings for phosphor-dbus-interfaces',
- variables: ['yamldir=' + get_option('prefix') / inst_yaml_dir],
+ variables: ['yamldir=' + '${pc_sysrootdir}${prefix}' / inst_yaml_dir],
)
phosphor_dbus_interfaces_dep = declare_dependency(