aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-08-01 23:51:43 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-08-22 14:15:22 -0400
commit3e73d4d77d1d36b15d06c8b3c4a7ee6ad77847b6 (patch)
tree1657528ecf739758e226827e9e8f3eae1d3419c5 /mesonbuild/backend/backends.py
parente19e9ce6f196f7c127a2668b5df0ada1d50806df (diff)
downloadmeson-3e73d4d77d1d36b15d06c8b3c4a7ee6ad77847b6.zip
meson-3e73d4d77d1d36b15d06c8b3c4a7ee6ad77847b6.tar.gz
meson-3e73d4d77d1d36b15d06c8b3c4a7ee6ad77847b6.tar.bz2
introspection: untangle install_plan implemetation, fix a bunch of wrong ones
Generally plumb through the values of get_option() passed to install_dir, and use this to establish the install plan name. Fixes several odd cases, such as: - {datadir} being prepended to "share" or "include" - dissociating custom install directories and writing them out as {prefix}/share/foo or {prefix}/lib/python3.10/site-packages This is the second half of #9478 Fixes #10601
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 67bc8bf..42f6255 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1534,7 +1534,7 @@ class Backend:
for t in self.build.get_targets().values():
if not t.should_install():
continue
- outdirs, default_install_dir_name, custom_install_dir = t.get_install_dir()
+ outdirs, install_dir_names, custom_install_dir = t.get_install_dir()
# Sanity-check the outputs and install_dirs
num_outdirs, num_out = len(outdirs), len(t.get_outputs())
if num_outdirs != 1 and num_outdirs != num_out:
@@ -1544,7 +1544,9 @@ class Backend:
raise MesonException(m.format(t.name, num_out, t.get_outputs(), num_outdirs))
assert len(t.install_tag) == num_out
install_mode = t.get_custom_install_mode()
- first_outdir = outdirs[0] # because mypy get's confused type narrowing in lists
+ # because mypy get's confused type narrowing in lists
+ first_outdir = outdirs[0]
+ first_outdir_name = install_dir_names[0]
# Install the target output(s)
if isinstance(t, build.BuildTarget):
@@ -1570,7 +1572,7 @@ class Backend:
tag = t.install_tag[0] or ('devel' if isinstance(t, build.StaticLibrary) else 'runtime')
mappings = t.get_link_deps_mapping(d.prefix)
i = TargetInstallData(self.get_target_filename(t), first_outdir,
- default_install_dir_name,
+ first_outdir_name,
should_strip, mappings, t.rpath_dirs_to_remove,
t.install_rpath, install_mode, t.subproject,
tag=tag, can_strip=can_strip)
@@ -1595,7 +1597,7 @@ class Backend:
implib_install_dir = self.environment.get_import_lib_dir()
# Install the import library; may not exist for shared modules
i = TargetInstallData(self.get_target_filename_for_linking(t),
- implib_install_dir, default_install_dir_name,
+ implib_install_dir, first_outdir_name,
False, {}, set(), '', install_mode,
t.subproject, optional=isinstance(t, build.SharedModule),
tag='devel')
@@ -1604,19 +1606,19 @@ class Backend:
if not should_strip and t.get_debug_filename():
debug_file = os.path.join(self.get_target_dir(t), t.get_debug_filename())
i = TargetInstallData(debug_file, first_outdir,
- default_install_dir_name,
+ first_outdir_name,
False, {}, set(), '',
install_mode, t.subproject,
optional=True, tag='devel')
d.targets.append(i)
# Install secondary outputs. Only used for Vala right now.
if num_outdirs > 1:
- for output, outdir, tag in zip(t.get_outputs()[1:], outdirs[1:], t.install_tag[1:]):
+ for output, outdir, outdir_name, tag in zip(t.get_outputs()[1:], outdirs[1:], install_dir_names[1:], t.install_tag[1:]):
# User requested that we not install this output
if outdir is False:
continue
f = os.path.join(self.get_target_dir(t), output)
- i = TargetInstallData(f, outdir, default_install_dir_name, False, {}, set(), None,
+ i = TargetInstallData(f, outdir, outdir_name, False, {}, set(), None,
install_mode, t.subproject,
tag=tag)
d.targets.append(i)
@@ -1635,18 +1637,18 @@ class Backend:
if first_outdir is not False:
for output, tag in zip(t.get_outputs(), t.install_tag):
f = os.path.join(self.get_target_dir(t), output)
- i = TargetInstallData(f, first_outdir, default_install_dir_name,
+ i = TargetInstallData(f, first_outdir, first_outdir_name,
False, {}, set(), None, install_mode,
t.subproject, optional=not t.build_by_default,
tag=tag)
d.targets.append(i)
else:
- for output, outdir, tag in zip(t.get_outputs(), outdirs, t.install_tag):
+ for output, outdir, outdir_name, tag in zip(t.get_outputs(), outdirs, install_dir_names, t.install_tag):
# User requested that we not install this output
if outdir is False:
continue
f = os.path.join(self.get_target_dir(t), output)
- i = TargetInstallData(f, outdir, default_install_dir_name,
+ i = TargetInstallData(f, outdir, outdir_name,
False, {}, set(), None, install_mode,
t.subproject, optional=not t.build_by_default,
tag=tag)