From dd9dfa77fb7caa36128024f27d2b204a1adc16a9 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sun, 2 Oct 2016 01:49:46 -0400 Subject: gnome.generate_gir(): Add install_dir_gir and install_dir_typelib A generic `install_dir` is less useful and didn't work so just ignore it --- mesonbuild/modules/gnome.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 4cd0505..e972202 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -195,6 +195,8 @@ class GnomeModule: def generate_gir(self, state, args, kwargs): if len(args) != 1: raise MesonException('Gir takes one argument') + if kwargs.get('install_dir'): + raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"') girtarget = args[0] while hasattr(girtarget, 'held_object'): girtarget = girtarget.held_object @@ -311,7 +313,8 @@ class GnomeModule: } if kwargs.get('install'): scankwargs['install'] = kwargs['install'] - scankwargs['install_dir'] = os.path.join(state.environment.get_datadir(), 'gir-1.0') + scankwargs['install_dir'] = kwargs.get('install_dir_gir', + os.path.join(state.environment.get_datadir(), 'gir-1.0')) scan_target = GirTarget(girfile, state.subdir, scankwargs) typelib_output = '%s-%s.typelib' % (ns, nsversion) @@ -335,10 +338,15 @@ class GnomeModule: if girdir: typelib_cmd += ["--includedir=%s" % (girdir, )] - kwargs['output'] = typelib_output - kwargs['command'] = typelib_cmd - kwargs['install_dir'] = os.path.join(state.environment.get_libdir(), 'girepository-1.0') - typelib_target = TypelibTarget(typelib_output, state.subdir, kwargs) + typelib_kwargs = { + 'output': typelib_output, + 'command': typelib_cmd, + } + if kwargs.get('install'): + typelib_kwargs['install'] = kwargs['install'] + typelib_kwargs['install_dir'] = kwargs.get('install_dir_typelib', + os.path.join(state.environment.get_libdir(), 'girepository-1.0')) + typelib_target = TypelibTarget(typelib_output, state.subdir, typelib_kwargs) return [scan_target, typelib_target] def compile_schemas(self, state, args, kwargs): -- cgit v1.1