build: Use datarootdir in Meson-generated pkg-config files
With datadir outside of prefix (currently unsupported by Meson¹ but a frequent occurrence in Nixpkgs), the datadir
entry, in the polkit-gobject-1
pkg-config file will be an absolute path. This will prevent changing the base directory of policydir
with --define-variable=prefix=…
, which many projects use to install policy files to their own prefix.
Previously, this worked without changes on Nixpkgs’s part because the pkg-config template used by Autotools contained @datarootdir@
, which resolves to $(prefix)/share
², taking no heed of the changed datadir.
Similar issue can happen when a distribution package redefines datadir like Debian does/did: https://blogs.gnome.org/hughsie/2014/06/16/datarootdir-v-s-datadir/
This patch changes Meson-based build system to use $(prefix)/share
in the generated pkg-config files, mirroring Autotools.