diff options
author | jpakkane <jpakkane@gmail.com> | 2015-03-23 20:28:15 +0200 |
---|---|---|
committer | jpakkane <jpakkane@gmail.com> | 2015-03-23 20:28:15 +0200 |
commit | cf3995d71760014cdb299f8a90d4c508b7f54dcc (patch) | |
tree | c3a8ebbc7a21f84967c389da94b79fec8d1383ca /modules | |
parent | a22172e7b3628d10790cab24690a5ceb3e9ed5a0 (diff) | |
parent | 4b33a88eeb65e8cde8fa454be5d8bc953a042c9a (diff) | |
download | meson-cf3995d71760014cdb299f8a90d4c508b7f54dcc.zip meson-cf3995d71760014cdb299f8a90d4c508b7f54dcc.tar.gz meson-cf3995d71760014cdb299f8a90d4c508b7f54dcc.tar.bz2 |
Merge pull request #61 from ignatenkobrain/wip/gnome
modules/gnome: auto-set gobject-introspection directories and install gir
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gnome.py | 16 | ||||
-rw-r--r-- | modules/rpm.py | 5 |
2 files changed, 19 insertions, 2 deletions
diff --git a/modules/gnome.py b/modules/gnome.py index c0e391f..80ee5fb 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -63,14 +63,18 @@ class GnomeModule: scankwargs = {'output' : girfile, 'input' : libsources, 'command' : scan_command} - scan_target = build.CustomTarget(scan_name, state.subdir, scankwargs) + if kwargs.get('install'): + scankwargs['install'] = kwargs['install'] + scankwargs['install_dir'] = os.path.join(state.environment.get_datadir(), 'gir-1.0') + scan_target = GirTarget(scan_name, state.subdir, scankwargs) typelib_name = girtarget.name + '-typelib' typelib_output = '%s-%s.typelib' % (ns, nsversion) typelib_cmd = ['g-ir-compiler', scan_target, '--output', '@OUTPUT@'] kwargs['output'] = typelib_output kwargs['command'] = typelib_cmd - typelib_target = build.CustomTarget(typelib_name, state.subdir, kwargs) + kwargs['install_dir'] = os.path.join(state.environment.get_libdir(), 'girepository-1.0') + typelib_target = TypelibTarget(typelib_name, state.subdir, kwargs) return [scan_target, typelib_target] def compile_schemas(self, state, args, kwargs): @@ -111,3 +115,11 @@ def initialize(): mlog.log('Warning, glib compiled dependencies will not work until this upstream issue is fixed:', mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754')) return GnomeModule() + +class GirTarget(build.CustomTarget): + def __init__(self, name, subdir, kwargs): + super().__init__(name, subdir, kwargs) + +class TypelibTarget(build.CustomTarget): + def __init__(self, name, subdir, kwargs): + super().__init__(name, subdir, kwargs) diff --git a/modules/rpm.py b/modules/rpm.py index 4ae1cc6..19f69f2 100644 --- a/modules/rpm.py +++ b/modules/rpm.py @@ -19,6 +19,7 @@ import build import compilers import datetime import mlog +import modules.gnome import os class RPMModule: @@ -62,6 +63,10 @@ class RPMModule: to_delete.add('%%{buildroot}%%{_libdir}/%s' % target.get_filename()) mlog.log('Warning, removing', mlog.bold(target.get_filename()), 'from package because packaging static libs not recommended') + elif isinstance(target, modules.gnome.GirTarget) and target.should_install(): + files_devel.add('%%{_datadir}/gir-1.0/%s' % target.get_filename()[0]) + elif isinstance(target, modules.gnome.TypelibTarget) and target.should_install(): + files.add('%%{_libdir}/girepository-1.0/%s' % target.get_filename()[0]) for header in state.headers: if len(header.get_install_subdir()) > 0: files_devel.add('%%{_includedir}/%s/' % header.get_install_subdir()) |