aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorFilipe Laíns <lains@riseup.net>2021-08-17 13:38:48 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-09-06 18:10:55 +0200
commitaf8b55d49b64e72dbefbd40d613b93f56d17b855 (patch)
treeff763c3346d5b7f8f87f41e3f0cb7348ded1a47e /mesonbuild/interpreter/interpreter.py
parentbe3bd9ea64570a468d482a8fc70e3d8474f77286 (diff)
downloadmeson-af8b55d49b64e72dbefbd40d613b93f56d17b855.zip
meson-af8b55d49b64e72dbefbd40d613b93f56d17b855.tar.gz
meson-af8b55d49b64e72dbefbd40d613b93f56d17b855.tar.bz2
mintro: add installed_plan
Signed-off-by: Filipe Laíns <lains@riseup.net>
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index fe27cb3..891c606 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1926,14 +1926,24 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
'"rename" and "sources" argument lists must be the same length if "rename" is given. '
f'Rename has {len(rename)} elements and sources has {len(sources)}.')
- return self.install_data_impl(sources, kwargs['install_dir'], kwargs['install_mode'], rename,
- kwargs['install_tag'])
+ install_dir_name = kwargs['install_dir']
+ if install_dir_name:
+ if not os.path.isabs(install_dir_name):
+ install_dir_name = os.path.join('{datadir}', install_dir_name)
+ else:
+ install_dir_name = '{datadir}'
+ return self.install_data_impl(sources, kwargs['install_dir'], kwargs['install_mode'],
+ rename, kwargs['install_tag'], install_dir_name)
def install_data_impl(self, sources: T.List[mesonlib.File], install_dir: str,
install_mode: FileMode, rename: T.Optional[str],
- tag: T.Optional[str]) -> build.Data:
+ tag: T.Optional[str],
+ install_dir_name: T.Optional[str] = None,
+ install_data_type: T.Optional[str] = None) -> build.Data:
+
"""Just the implementation with no validation."""
- data = build.Data(sources, install_dir, install_mode, self.subproject, rename, tag)
+ data = build.Data(sources, install_dir, install_dir_name or install_dir, install_mode,
+ self.subproject, rename, tag, install_data_type)
self.build.data.append(data)
return data
@@ -2158,7 +2168,8 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
install_tag = kwargs.get('install_tag')
if install_tag is not None and not isinstance(install_tag, str):
raise InvalidArguments('install_tag keyword argument must be string')
- self.build.data.append(build.Data([cfile], idir, install_mode, self.subproject, install_tag=install_tag))
+ self.build.data.append(build.Data([cfile], idir, idir, install_mode, self.subproject,
+ install_tag=install_tag, data_type='configure'))
return mesonlib.File.from_built_file(self.subdir, output)
def extract_incdirs(self, kwargs):