From 2c03b2bb7f4a292094b9b53f6214686503137141 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Tue, 8 Mar 2022 14:27:20 -0600 Subject: [PATCH] Move dataonly pkgconfig file to datadir/pkgconfig dataonly files are architecture independent (lib vs lib64 for example). Fixes #9902 --- .../snippets/dataonly-pkgconfig-default-install-path.md | 4 ++++ mesonbuild/modules/pkgconfig.py | 1 + test cases/common/44 pkgconfig-gen/test.json | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md diff --git a/docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md b/docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md new file mode 100644 index 000000000..d968158df --- /dev/null +++ b/docs/markdown/snippets/dataonly-pkgconfig-default-install-path.md @@ -0,0 +1,4 @@ +## `dataonly` Pkgconfig Default Install Path + +The default install path for `dataonly` pkgconfig files has changed from +`${libdir}/pkgconfig` to `${datadir}/pkgconfig`. diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index f67e6eb41..0eac360f8 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -524,6 +524,7 @@ class PkgConfigModule(ExtensionModule): blocked_vars = ['libraries', 'libraries_private', 'require_private', 'extra_cflags', 'subdirs'] if any(k in kwargs for k in blocked_vars): raise mesonlib.MesonException(f'Cannot combine dataonly with any of {blocked_vars}') + default_install_dir = os.path.join(state.environment.get_datadir(), 'pkgconfig') subdirs = mesonlib.stringlistify(kwargs.get('subdirs', default_subdirs)) version = kwargs.get('version', default_version) diff --git a/test cases/common/44 pkgconfig-gen/test.json b/test cases/common/44 pkgconfig-gen/test.json index 118fecdd4..4630a0204 100644 --- a/test cases/common/44 pkgconfig-gen/test.json +++ b/test cases/common/44 pkgconfig-gen/test.json @@ -6,7 +6,6 @@ {"type": "file", "file": "usr/lib/pkgconfig/libanswer.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/libfoo.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/libhello.pc"}, - {"type": "file", "file": "usr/lib/pkgconfig/libhello_nolib.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/libvartest.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/libvartest2.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/simple2.pc"}, @@ -14,7 +13,8 @@ {"type": "file", "file": "usr/lib/pkgconfig/simple5.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/simple6.pc"}, {"type": "file", "file": "usr/lib/pkgconfig/ct.pc"}, - {"type": "file", "file": "usr/lib/pkgconfig/ct0.pc"} + {"type": "file", "file": "usr/lib/pkgconfig/ct0.pc"}, + {"type": "file", "file": "usr/share/pkgconfig/libhello_nolib.pc"} ], "stdout": [ {