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
pull/843/head
Patrick Griffis 8 years ago
parent 62ec92c8b0
commit dd9dfa77fb
  1. 18
      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):

Loading…
Cancel
Save