summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-02-11 16:03:15 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-02-12 08:57:05 -0800
commitab9c79bd1cda545c3ce18b0c62b820f6d85221d1 (patch)
treec0d26c42d24848ff3b99b02058ee7b9fa2160f89
parent9a2127051604adc5c21a0a0bebffc4d81c08a429 (diff)
downloadmeson-ab9c79bd1cda545c3ce18b0c62b820f6d85221d1.tar.gz
modules/pkgconfig: use host machine to calculate install prefix
The `mesonlib.is_*` functions are not correct to use here, since they are for the build machine, not the host machine. This means if the build machine if Linux but the host is Haiku, then pkg-config files willb e installed into $libdir/pkgconfig, instead of $prefix/develop/lib/pkgconfig
-rw-r--r--mesonbuild/modules/pkgconfig.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 1bdf82931..974d2521d 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -701,10 +701,11 @@ class PkgConfigModule(NewExtensionModule):
pcfile = filebase + '.pc'
pkgroot = pkgroot_name = kwargs['install_dir'] or default_install_dir
if pkgroot is None:
- if mesonlib.is_freebsd():
+ m = state.environment.machines.host
+ if m.is_freebsd():
pkgroot = os.path.join(_as_str(state.environment.coredata.get_option(OptionKey('prefix'))), 'libdata', 'pkgconfig')
pkgroot_name = os.path.join('{prefix}', 'libdata', 'pkgconfig')
- elif mesonlib.is_haiku():
+ elif m.is_haiku():
pkgroot = os.path.join(_as_str(state.environment.coredata.get_option(OptionKey('prefix'))), 'develop', 'lib', 'pkgconfig')
pkgroot_name = os.path.join('{prefix}', 'develop', 'lib', 'pkgconfig')
else: