diff options
author | Calvin Walton <calvin.walton@kepstin.ca> | 2020-10-06 17:02:40 -0400 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2020-12-28 18:42:51 +0000 |
commit | 02c51b9e07666011b81e0b518e9c16cf9ed88eae (patch) | |
tree | 7d6e8892ec8de97511309c297e7f3e131a1b5ed8 | |
parent | 7d8ba1867da07e657c4e58b85515d0bf16995dc4 (diff) | |
download | shared-mime-info-02c51b9e07666011b81e0b518e9c16cf9ed88eae.tar.gz |
meson: Use templated pkgconfig file rather than meson generator
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.
-rw-r--r-- | data/meson.build | 7 | ||||
-rw-r--r-- | meson.build | 11 |
2 files changed, 10 insertions, 8 deletions
diff --git a/data/meson.build b/data/meson.build index e22b5447..263567d9 100644 --- a/data/meson.build +++ b/data/meson.build @@ -33,10 +33,3 @@ custom_target('shared-mime-info-spec-html', ], build_by_default: true, ) - -pkgconfig.generate( - name: 'shared-mime-info', - description: 'Freedesktop common MIME database', - version: meson.project_version(), - install_dir: get_option('datadir') / 'pkgconfig' -) diff --git a/meson.build b/meson.build index bdffdb9f..b224c4b1 100644 --- a/meson.build +++ b/meson.build @@ -8,7 +8,6 @@ project('shared-mime-info', config = configuration_data() i18n = import('i18n') -pkgconfig = import('pkgconfig') cc = meson.get_compiler('c') @@ -68,6 +67,16 @@ subdir('data') subdir('src') subdir('tests') +configure_file( + input: 'shared-mime-info.pc.in', + output: '@BASENAME@', + configuration: { + 'prefix': get_option('prefix'), + 'VERSION': meson.project_version() + }, + install_dir: get_option('datadir') / 'pkgconfig' +) + if get_option('update-mimedb') upd_tool = (meson.is_cross_build() ? find_program('update-mime-database').path() |