Skip to contentSkip to conversation

gobject-introspection: fix default search path for girdir

PATCH In review Chen Qi 2 participants 2 messages Jul 13, 2021

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 gobject-introspection: fix default search path for girdir

When running g-ir-scanner, we get the following error:

Couldn't find include 'GObject-2.0.gir' (search path:
'['/usr/lib64', 'gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0']')

This is because g-ir-tool-template.in is not setting girdir correctly. It's using the prefix instead of the actual girdir.

---
 ...-ir-tool-template.in-fix-girdir-path.patch | 33 +++++++++++++++++++
 .../gobject-introspection_1.66.1.bb           |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch
meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch new file +33 -0
new file mode 100644
index 0000000000..c0d263946b
@@ -0,0 +1,33 @@
+From b01b448613b76f9acefdfd89ee01686dc7a67df4 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Tue, 13 Jul 2021 02:05:11 -0700
+Subject: [PATCH] g-ir-tool-template.in: fix girdir path
+
+In case gir_dir_prefix is set, it's possible that g-ir-scanner
+cannot find the .gir files. This is because that the girdir
+is set to gir_dir_prefix, which is wrong. It's not a prefix,
+it the actual gir dir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ tools/g-ir-tool-template.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
+index 6e98f52e..62c07c31 100755
+--- a/tools/g-ir-tool-template.in
++++ b/tools/g-ir-tool-template.in
+@@ -55,7 +55,7 @@ builtins.__dict__['DATADIR'] = datadir
+ 
+ # Respect gir_dir_prefix
+ girdir = ''
+-girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@'))
++girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@', 'gir-1.0'))
+ builtins.__dict__['GIRDIR'] = [girdir]
+ 
+ # Again, relative paths first so that the installation prefix is relocatable
+-- 
+2.30.2
+
meta/recipes-gnome/gobject-introspection/gobject-introspection_1.66.1.bb +1 -0
index ebac8d3a43..45440cea1d 100644
@@ -16,6 +16,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c434e8128a68bedd59b80b2ac1eb1c4a \
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${@oe.utils.trim_version("${PV}", 2)}/${BPN}-${PV}.tar.xz \
            file://0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch \
            file://0001-meson.build-exclude-girepo_dep-if-introspection-data.patch \
+           file://0001-g-ir-tool-template.in-fix-girdir-path.patch \
            "
 
 SRC_URI[sha256sum] = "dd44a55ee5f426ea22b6b89624708f9e8d53f5cc94e5485c15c87cb30e06161d"
Signature · 1 line
2.30.2
#1 lore raw

This is not seen in the autobuilder, how can it be reproduced?

Also, please submit upstream first.

Alex

Quoted 91 lines · Chen Qi

When running g-ir-scanner, we get the following error:

Couldn't find include 'GObject-2.0.gir' (search path:
'['/usr/lib64', 'gir-1.0', '/usr/local/share/gir-1.0',
'/usr/share/gir-1.0',
'/usr/share/gir-1.0', '/usr/share/gir-1.0']')

This is because g-ir-tool-template.in is not setting girdir correctly. It's using the prefix instead of the actual girdir.

---
 ...-ir-tool-template.in-fix-girdir-path.patch | 33 +++++++++++++++++++
 .../gobject-introspection_1.66.1.bb           |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644

meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch

diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch new file mode 100644
index 0000000000..c0d263946b
--- /dev/null
+++
b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch

meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-g-ir-tool-template.in-fix-girdir-path.patch new file +26 -0
@@ -0,0 +1,33 @@
+From b01b448613b76f9acefdfd89ee01686dc7a67df4 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Tue, 13 Jul 2021 02:05:11 -0700
+Subject: [PATCH] g-ir-tool-template.in: fix girdir path
+
+In case gir_dir_prefix is set, it's possible that g-ir-scanner
+cannot find the .gir files. This is because that the girdir
+is set to gir_dir_prefix, which is wrong. It's not a prefix,
+it the actual gir dir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ tools/g-ir-tool-template.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
+index 6e98f52e..62c07c31 100755
+--- a/tools/g-ir-tool-template.in
++++ b/tools/g-ir-tool-template.in
+@@ -55,7 +55,7 @@ builtins.__dict__['DATADIR'] = datadir
+
+ # Respect gir_dir_prefix
+ girdir = ''
+-girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@

'))
++girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@', 'gir-1.0'))
+ builtins.__dict__['GIRDIR'] = [girdir]
+
+ # Again, relative paths first so that the installation prefix is relocatable
+--
+2.30.2

(quoted diff) +1 -0
+
(quoted diff) +0 -0

gobject-introspection_1.66.1.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.66.1.bb index ebac8d3a43..45440cea1d 100644
--- a/meta/recipes-gnome/gobject-introspection/ gobject-introspection_1.66.1.bb
+++ b/meta/recipes-gnome/gobject-introspection/ gobject-introspection_1.66.1.bb

(quoted diff) +0 -0
@@ -16,6 +16,7 @@ LIC_FILES_CHKSUM =
 "file://COPYING;md5=c434e8128a68bedd59b80b2ac1eb1c4a \
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${@oe.utils.trim_version("${PV}",
 2)}/${BPN}-${PV}.tar.xz \
 
 file://0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch \
 

file://0001-meson.build-exclude-girepo_dep-if-introspection-data.patch \

+           file://0001-g-ir-tool-template.in-fix-girdir-path.patch \
            "

SRC_URI[sha256sum] =
"dd44a55ee5f426ea22b6b89624708f9e8d53f5cc94e5485c15c87cb30e06161d" --
2.30.2