diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-12-06 16:14:22 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-12-27 20:29:46 -0500 |
commit | 2fa074917597fea0cf3332c6620d3414034825e4 (patch) | |
tree | 787dc86c8affa560710340a76dcdbbbf7794ff86 /mesonbuild/interpreter/mesonmain.py | |
parent | 26b83eee9427889b5b006079872aa288bc0ffaed (diff) | |
download | meson-2fa074917597fea0cf3332c6620d3414034825e4.zip meson-2fa074917597fea0cf3332c6620d3414034825e4.tar.gz meson-2fa074917597fea0cf3332c6620d3414034825e4.tar.bz2 |
add license_files kwarg to project
Hook this up to installed dependency manifests. This is often needed
above and beyond just an SPDX string -- e.g. many licenses have custom
copyright lines.
Diffstat (limited to 'mesonbuild/interpreter/mesonmain.py')
-rw-r--r-- | mesonbuild/interpreter/mesonmain.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/mesonmain.py b/mesonbuild/interpreter/mesonmain.py index 01d0029..1a902ad 100644 --- a/mesonbuild/interpreter/mesonmain.py +++ b/mesonbuild/interpreter/mesonmain.py @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2012-2021 The Meson development team # Copyright © 2021 Intel Corporation +from __future__ import annotations import os import typing as T @@ -74,6 +75,7 @@ class MesonMain(MesonInterpreterObject): 'override_find_program': self.override_find_program_method, 'project_version': self.project_version_method, 'project_license': self.project_license_method, + 'project_license_files': self.project_license_files_method, 'version': self.version_method, 'project_name': self.project_name_method, 'get_cross_property': self.get_cross_property_method, @@ -400,6 +402,12 @@ class MesonMain(MesonInterpreterObject): def project_license_method(self, args: T.List['TYPE_var'], kwargs: 'TYPE_kwargs') -> T.List[str]: return self.build.dep_manifest[self.interpreter.active_projectname].license + @FeatureNew('meson.project_license_files()', '1.1.0') + @noPosargs + @noKwargs + def project_license_files_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> T.List[mesonlib.File]: + return [l[1] for l in self.build.dep_manifest[self.interpreter.active_projectname].license_files] + @noPosargs @noKwargs def version_method(self, args: T.List['TYPE_var'], kwargs: 'TYPE_kwargs') -> MesonVersionString: |