meson: Use templated pkgconfig file rather than meson generator

Merged Calvin Walton requested to merge kepstin/shared-mime-info:meson-pkgconfig into master

The meson pkgconfig generator was, in some circumstances, adding architecture-specific Cflags and libdir/includedir to the pkgconfig file. Since the pkgconfig file is installed in an architecture-independent path (e.g. /usr/share/pkgconfig) this was causing problems with cross-compile builds or builds on multilib/multiarch systems.

The extra variables could be avoided by setting the "dataonly" option on the pkgconfig generator, but that causes the "prefix" variable to also be removed. I took a quick check and didn't see anything that used this variable... but there could be something I missed.

So, in the interests of fixing the issue while preserving compatibility with the old autotools build, I've adjusted the meson build to use the pkgconfig template which was leftover from the autotools build system.

Merge request reports