Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/markdown/snippets/install_man_kwargs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## install_man: add support install_tag kwarg

By default install_man uses 'man' tag for its files which not always is desirable,
for example if project uses plugin functionality and plugin wants to install its own man files
it was not possible using `meson install --tags xxx`.
9 changes: 9 additions & 0 deletions docs/yaml/functions/install_man.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |
overridden by specifying it with the `install_dir` keyword argument.

*(since 0.49.0)* [manpages are no longer compressed implicitly][install_man_49].
*(since 1.11.0)* install_man supports `install_tag` kwarg

[install_man_49]:
https://mesonbuild.com/Release-notes-for-0-49-0.html#manpages-are-no-longer-compressed-implicitly
Expand All @@ -32,6 +33,14 @@ kwargs:
type: str
description: Where to install to.

install_tag:
type: str
since: 1.11.0
description: |
A string used by the `meson install --tags` command
to install only a subset of the files. By default these files have `man` install
tag which means they are installed explicitly or when no tags given at all

locale:
type: str
since: 0.58.0
Expand Down
5 changes: 4 additions & 1 deletion mesonbuild/backend/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,10 @@ def generate_man_install(self, d: InstallData) -> None:
srcabs = f.absolute_path(self.environment.get_source_dir(), self.environment.get_build_dir())
dstname = os.path.join(subdir, os.path.basename(fname))
dstabs = dstname.replace('{mandir}', manroot)
i = InstallDataBase(srcabs, dstabs, dstname, m.get_custom_install_mode(), m.subproject, tag='man')
tag = 'man'
if m.install_tag is not None:
tag = m.install_tag
i = InstallDataBase(srcabs, dstabs, dstname, m.get_custom_install_mode(), m.subproject, tag=tag)
d.man.append(i)

def generate_emptydir_install(self, d: InstallData) -> None:
Expand Down
1 change: 1 addition & 0 deletions mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class Man(HoldableObject):
custom_install_mode: 'FileMode'
subproject: str
locale: T.Optional[str]
install_tag: T.Optional[str] = None

def get_custom_install_dir(self) -> T.Optional[str]:
return self.custom_install_dir
Expand Down
3 changes: 2 additions & 1 deletion mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,7 @@ def func_install_headers(self, node: mparser.BaseNode,
KwargInfo('locale', (str, NoneType), since='0.58.0'),
INSTALL_MODE_KW.evolve(since='0.47.0'),
INSTALL_DIR_KW,
INSTALL_TAG_KW.evolve(since='1.11.0')
)
def func_install_man(self, node: mparser.BaseNode,
args: T.Tuple[T.List['mesonlib.FileOrString']],
Expand All @@ -2389,7 +2390,7 @@ def func_install_man(self, node: mparser.BaseNode,
raise InvalidArguments('Man file must have a file extension of a number between 1 and 9')

m = build.Man(sources, kwargs['install_dir'], install_mode,
self.subproject, kwargs['locale'])
self.subproject, kwargs['locale'], kwargs['install_tag'])
self.build.man.append(m)

return m
Expand Down
Loading