summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2021-02-10 10:39:16 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2023-03-14 12:37:48 +0000
commit98aa7b1c6e64e076d869221381b39a28c2bae774 (patch)
tree586865e4dbcce7f1bc3c5f5a2bc7eaca46ccf20e
parent5de00116635e0402c5689b4f965055b0c947f614 (diff)
downloadgobject-introspection-98aa7b1c6e64e076d869221381b39a28c2bae774.tar.gz
Python tools: Don't prepend /usr/share to the search path for GIR XML
This code was presumably intended to add a relocatable path ${bindir}/../${gir_dir_prefix}/gir-1.0 to the search path, where ${bindir} is computed at runtime and ${gir_dir_prefix} is hard-coded at configure time. However, this didn't work as intended for two reasons: * the gir-1.0 suffix was missing, so in practice we would look for GIR XML in a location like /usr/share/Gio-2.0.gir or /usr/lib64/Gio-2.0.gir, not find it, and proceed to the next search path entry; * the @gir_dir_prefix@ substituted from the build system is currently an absolute path, so os.path.join would discard ${bindir}/.. and use the compile-time @gir_dir_prefix@ as-is If this had worked as intended, its precedence would also have been inconsistent with the C code: the Python code searches GIRDIR before the XDG_DATA_DIRS, but the C code searches its direct equivalent, GIR_DIR, after the XDG_DATA_DIRS. Since this doesn't seem to be doing anything useful, discard it. This leaves builtins.GIRDIR set to either empty (normally) or just the ${srcdir}/gir/ (when running uninstalled). Helps: #323, #455 Signed-off-by: Simon McVittie <smcv@debian.org>
-rwxr-xr-xtools/g-ir-tool-template.in6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
index 6e98f52e..b8f67913 100755
--- a/tools/g-ir-tool-template.in
+++ b/tools/g-ir-tool-template.in
@@ -52,11 +52,7 @@ if not os.path.isdir(os.path.join(datadir, 'gir-1.0')):
datadir = "@datarootdir@"
builtins.__dict__['DATADIR'] = datadir
-
-# Respect gir_dir_prefix
-girdir = ''
-girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@'))
-builtins.__dict__['GIRDIR'] = [girdir]
+builtins.__dict__['GIRDIR'] = []
# Again, relative paths first so that the installation prefix is relocatable
pylibdir = os.path.abspath(os.path.join(filedir, '..', 'lib', 'gobject-introspection'))