From f94fc2f497c22bd28b5f04ec58c97e0f4d95486f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Mar 2015 00:21:40 +0300 Subject: [PATCH 1/4] modules/gnome: auto-set girepository directory Signed-off-by: Igor Gnatenko --- modules/gnome.py | 1 + test cases/frameworks/7 gnome/gir/meson.build | 3 +-- test cases/frameworks/7 gnome/installed_files.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gnome.py b/modules/gnome.py index c0e391f2d..ef5f6b85c 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -70,6 +70,7 @@ class GnomeModule: typelib_cmd = ['g-ir-compiler', scan_target, '--output', '@OUTPUT@'] kwargs['output'] = typelib_output kwargs['command'] = typelib_cmd + kwargs['install_dir'] = os.path.join(state.environment.get_libdir(), 'girepository-1.0') typelib_target = build.CustomTarget(typelib_name, state.subdir, kwargs) return [scan_target, typelib_target] diff --git a/test cases/frameworks/7 gnome/gir/meson.build b/test cases/frameworks/7 gnome/gir/meson.build index 115631e01..cb3308ed8 100644 --- a/test cases/frameworks/7 gnome/gir/meson.build +++ b/test cases/frameworks/7 gnome/gir/meson.build @@ -8,8 +8,7 @@ gnome.generate_gir(girexe, sources : libsources, nsversion : '1.0', namespace : 'Meson', -install : true, -install_dir : 'typelibdir', +install : true ) test('gobject introspection', girexe) diff --git a/test cases/frameworks/7 gnome/installed_files.txt b/test cases/frameworks/7 gnome/installed_files.txt index 019b81aad..4267c262b 100644 --- a/test cases/frameworks/7 gnome/installed_files.txt +++ b/test cases/frameworks/7 gnome/installed_files.txt @@ -1,2 +1,2 @@ -usr/typelibdir/Meson-1.0.typelib +usr/lib/girepository-1.0/Meson-1.0.typelib usr/share/glib-2.0/schemas/com.github.meson.gschema.xml From 888945ac2e6e212ee06ec7eaa6607b0faf1a2743 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Mar 2015 00:32:41 +0300 Subject: [PATCH 2/4] modules/gnome: install Gir also and auto-detect it's dir Gir file should be installed in devel subpackage Signed-off-by: Igor Gnatenko --- modules/gnome.py | 3 +++ test cases/frameworks/7 gnome/installed_files.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/modules/gnome.py b/modules/gnome.py index ef5f6b85c..53e26ee08 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -63,6 +63,9 @@ class GnomeModule: scankwargs = {'output' : girfile, 'input' : libsources, 'command' : scan_command} + if kwargs.get('install'): + scankwargs['install'] = kwargs['install'] + scankwargs['install_dir'] = os.path.join(state.environment.get_datadir(), 'gir-1.0') scan_target = build.CustomTarget(scan_name, state.subdir, scankwargs) typelib_name = girtarget.name + '-typelib' diff --git a/test cases/frameworks/7 gnome/installed_files.txt b/test cases/frameworks/7 gnome/installed_files.txt index 4267c262b..846483988 100644 --- a/test cases/frameworks/7 gnome/installed_files.txt +++ b/test cases/frameworks/7 gnome/installed_files.txt @@ -1,2 +1,3 @@ usr/lib/girepository-1.0/Meson-1.0.typelib +usr/share/gir-1.0/Meson-1.0.gir usr/share/glib-2.0/schemas/com.github.meson.gschema.xml From e2b63141d08d3317b32acf8af7ce0854c7ffb1ee Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Mar 2015 02:16:41 +0300 Subject: [PATCH 3/4] modules/gnome: use custom classes for targets. Closes #62 To easy identify which target we're building (for making files section in rpm) Signed-off-by: Igor Gnatenko --- modules/gnome.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/gnome.py b/modules/gnome.py index 53e26ee08..80ee5fb9a 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -66,7 +66,7 @@ class GnomeModule: if kwargs.get('install'): scankwargs['install'] = kwargs['install'] scankwargs['install_dir'] = os.path.join(state.environment.get_datadir(), 'gir-1.0') - scan_target = build.CustomTarget(scan_name, state.subdir, scankwargs) + scan_target = GirTarget(scan_name, state.subdir, scankwargs) typelib_name = girtarget.name + '-typelib' typelib_output = '%s-%s.typelib' % (ns, nsversion) @@ -74,7 +74,7 @@ class GnomeModule: kwargs['output'] = typelib_output kwargs['command'] = typelib_cmd kwargs['install_dir'] = os.path.join(state.environment.get_libdir(), 'girepository-1.0') - typelib_target = build.CustomTarget(typelib_name, state.subdir, kwargs) + typelib_target = TypelibTarget(typelib_name, state.subdir, kwargs) return [scan_target, typelib_target] def compile_schemas(self, state, args, kwargs): @@ -115,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) From 4b33a88eeb65e8cde8fa454be5d8bc953a042c9a Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Mar 2015 02:21:05 +0300 Subject: [PATCH 4/4] modules/rpm: handle Gir and Typelib from GNOME Signed-off-by: Igor Gnatenko --- modules/rpm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/rpm.py b/modules/rpm.py index 57c1de5f9..a91b313d3 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())