[gobject-introspection/thiblahute/fix_meson_override_program: 2/2] Make meson.override_find_program working on more complex use cases
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/thiblahute/fix_meson_override_program: 2/2] Make meson.override_find_program working on more complex use cases
- Date: Thu, 15 Aug 2019 13:58:20 +0000 (UTC)
commit ba744068f2075dad4d5d3562c79034f23a6bb90a
Author: Thibault Saunier <tsaunier igalia com>
Date: Thu Aug 15 09:41:30 2019 -0400
Make meson.override_find_program working on more complex use cases
Add some missing `meson.override_find_program`
And make sure that the `.gir` we build are found when used uninstalled
as a concequence of `meson.override_find_program`.
girepository/girparser.c | 4 ++++
giscanner/transformer.py | 3 +--
meson.build | 1 +
tools/g-ir-tool-template.in | 3 ++-
tools/meson.build | 3 +++
5 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 53450baf..fb47e75c 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -309,6 +309,10 @@ locate_gir (GIrParser *parser,
if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
return path;
g_free (path);
+ path = g_build_filename (UNINSTALLED_GIR_DIR, girname, NULL);
+ if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
+ return path;
+ g_free (path);
return NULL;
}
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index f63894cb..bcabdedc 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -183,7 +183,6 @@ None."""
def _get_gi_data_dirs(self):
data_dirs = utils.get_system_data_dirs()
data_dirs.append(DATADIR)
- data_dirs.append(GIRDIR)
if os.name != 'nt':
# For backwards compatibility, was always unconditionally added to the list.
data_dirs.append('/usr/share')
@@ -191,9 +190,9 @@ None."""
def _find_include(self, include):
searchdirs = self._includepaths[:]
+ searchdirs.extend(GIRDIR)
for path in self._get_gi_data_dirs():
searchdirs.append(os.path.join(path, 'gir-1.0'))
- searchdirs.append(os.path.join(DATADIR, 'gir-1.0'))
girname = '%s-%s.gir' % (include.name, include.version)
for d in searchdirs:
diff --git a/meson.build b/meson.build
index 7d71c8e5..bd6eaa48 100644
--- a/meson.build
+++ b/meson.build
@@ -90,6 +90,7 @@ endif
girdir = join_paths(gir_dir_prefix, 'gir-1.0')
config.set_quoted('GIR_DIR', girdir)
config.set_quoted('GOBJECT_INTROSPECTION_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
+config.set_quoted('UNINSTALLED_GIR_DIR', join_paths(meson.current_build_dir(), 'gir'))
foreach type : ['char', 'short', 'int', 'long']
size = cc.sizeof(type)
diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
index 3b33f75d..8462f88a 100755
--- a/tools/g-ir-tool-template.in
+++ b/tools/g-ir-tool-template.in
@@ -61,7 +61,7 @@ if '@gir_dir_prefix@' and not '@gir_dir_prefix@'.startswith('@'):
# for autotools
elif '@GIR_DIR@' and not '@GIR_DIR@'.startswith('@'):
girdir = os.path.dirname(os.path.abspath('@GIR_DIR@'))
-builtins.__dict__['GIRDIR'] = girdir
+builtins.__dict__['GIRDIR'] = [girdir]
# Again, relative paths first so that the installation prefix is relocatable
pylibdir = os.path.abspath(os.path.join(filedir, '..', 'lib', 'gobject-introspection'))
@@ -85,6 +85,7 @@ if not os.path.isfile(os.path.join(pylibdir, 'giscanner', '_giscanner' + py_mod_
# We're running uninstalled inside meson
builddir = os.path.abspath(os.path.join(filedir, '..'))
pylibdir = builddir
+ builtins.__dict__['GIRDIR'].append(os.path.join(filedir, os.pardir, 'gir'))
gdump_path = os.path.join(builddir, 'girepository', 'gdump.c')
if os.path.isfile(gdump_path):
builtins.__dict__['GDUMP_PATH'] = gdump_path
diff --git a/tools/meson.build b/tools/meson.build
index 6cc3186a..1fedaa53 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -56,6 +56,7 @@ gircompiler = executable('g-ir-compiler', 'compiler.c',
install: true,
c_args: custom_c_args,
)
+meson.override_find_program('g-ir-compiler', gircompiler)
girgenerate = executable('g-ir-generate', 'generate.c',
dependencies: [
@@ -65,9 +66,11 @@ girgenerate = executable('g-ir-generate', 'generate.c',
install: true,
c_args: custom_c_args,
)
+meson.override_find_program('g-ir-generate', girgenerate)
girinspect = executable('g-ir-inspect', 'g-ir-inspect.c',
dependencies: girepo_dep,
install: true,
c_args: custom_c_args,
)
+meson.override_find_program('g-ir-inspect', girinspect)
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]