diff options
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/cmake.py | 7 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 6 | ||||
-rw-r--r-- | mesonbuild/modules/python.py | 6 |
4 files changed, 14 insertions, 7 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index d0b6065..53beded 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -272,9 +272,10 @@ class CmakeModule(ExtensionModule): if not self.detect_cmake(): raise mesonlib.MesonException('Unable to find cmake') - pkgroot = kwargs.get('install_dir', None) + pkgroot = pkgroot_name = kwargs.get('install_dir', None) if pkgroot is None: pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('libdir')), 'cmake', name) + pkgroot_name = os.path.join('{libdir}', 'cmake', name) if not isinstance(pkgroot, str): raise mesonlib.MesonException('Install_dir must be a string.') @@ -290,7 +291,7 @@ class CmakeModule(ExtensionModule): } mesonlib.do_conf_file(template_file, version_file, conf, 'meson') - res = build.Data([mesonlib.File(True, state.environment.get_scratch_dir(), version_file)], pkgroot, None, state.subproject) + res = build.Data([mesonlib.File(True, state.environment.get_scratch_dir(), version_file)], pkgroot, pkgroot_name, None, state.subproject) return ModuleReturnValue(res, [res]) def create_package_file(self, infile, outfile, PACKAGE_RELATIVE_PATH, extra, confdata): @@ -375,7 +376,7 @@ class CmakeModule(ExtensionModule): if conffile not in self.interpreter.build_def_files: self.interpreter.build_def_files.append(conffile) - res = build.Data([mesonlib.File(True, ofile_path, ofile_fname)], install_dir, None, state.subproject) + res = build.Data([mesonlib.File(True, ofile_path, ofile_fname)], install_dir, install_dir, None, state.subproject) self.interpreter.build.data.append(res) return res diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 5515919..1343bc7 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -1728,7 +1728,7 @@ G_END_DECLS''' with open(fname, 'w', encoding='utf-8') as ofile: for package in packages: ofile.write(package + '\n') - return build.Data([mesonlib.File(True, outdir, fname)], install_dir, None, state.subproject) + return build.Data([mesonlib.File(True, outdir, fname)], install_dir, install_dir, None, state.subproject) def _get_vapi_link_with(self, target): link_with = [] diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index e57c4f6..f73e168 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -537,18 +537,20 @@ class PkgConfigModule(ExtensionModule): unescaped_variables = parse_variable_list(unescaped_variables) pcfile = filebase + '.pc' - pkgroot = kwargs.get('install_dir', default_install_dir) + pkgroot = pkgroot_name = kwargs.get('install_dir', default_install_dir) if pkgroot is None: if mesonlib.is_freebsd(): pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('prefix')), 'libdata', 'pkgconfig') + pkgroot_name = os.path.join('{prefix}', 'libdata', 'pkgconfig') else: pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('libdir')), 'pkgconfig') + pkgroot_name = os.path.join('{libdir}', 'pkgconfig') if not isinstance(pkgroot, str): raise mesonlib.MesonException('Install_dir must be a string.') self._generate_pkgconfig_file(state, deps, subdirs, name, description, url, version, pcfile, conflicts, variables, unescaped_variables, False, dataonly) - res = build.Data([mesonlib.File(True, state.environment.get_scratch_dir(), pcfile)], pkgroot, None, state.subproject, install_tag='devel') + res = build.Data([mesonlib.File(True, state.environment.get_scratch_dir(), pcfile)], pkgroot, pkgroot_name, None, state.subproject, install_tag='devel') variables = self.interpreter.extract_variables(kwargs, argname='uninstalled_variables', dict_new=True) variables = parse_variable_list(variables) unescaped_variables = self.interpreter.extract_variables(kwargs, argname='unescaped_uninstalled_variables') diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index bddaa19..57cea91 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -493,7 +493,8 @@ class PythonInstallation(ExternalProgramHolder): return self.interpreter.install_data_impl( self.interpreter.source_strings_to_files(args[0]), self._get_install_dir_impl(kwargs['pure'], kwargs['subdir']), - mesonlib.FileMode(), rename=None, tag=tag) + mesonlib.FileMode(), rename=None, tag=tag, install_data_type='python', + install_dir_name=self._get_install_dir_name_impl(kwargs['pure'], kwargs['subdir'])) @noPosargs @typed_kwargs('python_installation.install_dir', _PURE_KW, _SUBDIR_KW) @@ -504,6 +505,9 @@ class PythonInstallation(ExternalProgramHolder): return os.path.join( self.purelib_install_path if pure else self.platlib_install_path, subdir) + def _get_install_dir_name_impl(self, pure: bool, subdir: str) -> str: + return os.path.join('{py_purelib}' if pure else '{py_platlib}', subdir) + @noPosargs @noKwargs def language_version_method(self, args: T.List['TYPE_var'], kwargs: 'TYPE_kwargs') -> str: |