summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2018-10-10 23:03:00 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-12 16:57:21 +0100
commitd5e56347a6e7eae0f0fcf46bf862532e67751a0e (patch)
tree36d54119b4d45b5073520f1aa89570c9a40c3bba
parentca571cb9823c5fecdf0801d0ecdfdf99fd51ef2b (diff)
downloadpoky-d5e56347a6e7eae0f0fcf46bf862532e67751a0e.tar.gz
gobject-introspection: fix multilib install file conflicts
Fix multilib isntall file conflicts for gobject-introspection. * use multilib_script.bbclass to handle ${bindir}/g-ir-annotation-tool and ${bindir}/g-ir-scanner * add configure option to install .gir files to an alternative path and only set it when multilib is enabled (From OE-Core rev: efd91da5230ea27f5c554c3fe51d4c009b85705d) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-make-GIR_DIR-configurable.patch68
-rw-r--r--meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-g-ir-tools-respect-gir_dir_prefix.patch76
-rw-r--r--meta/recipes-gnome/gobject-introspection/gobject-introspection_1.58.0.bb11
3 files changed, 152 insertions, 3 deletions
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-make-GIR_DIR-configurable.patch b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-make-GIR_DIR-configurable.patch
new file mode 100644
index 0000000000..e0402f8f49
--- /dev/null
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-make-GIR_DIR-configurable.patch
@@ -0,0 +1,68 @@
1configure.ac: make GIR_DIR configurable
2
3Some .gir files such as GLib-2.0.gir are arch related which contain such
4as lengths of pointers that they are different for 64 and 32 bit target.
5It causes install file conflicts for multilib when intall
6gobject-introspection and lib32-gobject-introspection both.
7
8Add configure option 'with-gir-dir-prefix' for autotools to make .gir
9could be installed to a configured path such as ${libdir}. And update
10girdir in .pc files as well.
11
12Upstream-Status: Accepted [https://gitlab.gnome.org/GNOME/gobject-introspection/commit/3301c7e]
13
14Signed-off-by: Kai Kang <kai.kang@windriver.com>
15---
16 configure.ac | 7 +++++--
17 gobject-introspection-1.0.pc.in | 2 +-
18 gobject-introspection-no-export-1.0.pc.in | 2 +-
19 3 files changed, 7 insertions(+), 4 deletions(-)
20
21diff --git a/configure.ac b/configure.ac
22index b4294c57..60506947 100644
23--- a/configure.ac
24+++ b/configure.ac
25@@ -114,9 +114,12 @@ GIR_SUFFIX="gir-1.0"
26 AC_SUBST(GIR_SUFFIX)
27 AC_DEFINE_UNQUOTED(GIR_SUFFIX, "$GIR_SUFFIX", [Name of the gir directory])
28
29-GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX"
30+AC_ARG_WITH([gir-dir-prefix],
31+ [AS_HELP_STRING([--with-gir-dir-prefix], [Directory prefix for gir installation])],
32+ [GIR_DIR_PREFIX="$withval"], [GIR_DIR_PREFIX="$EXPANDED_DATADIR"])
33+GIR_DIR="$GIR_DIR_PREFIX/$GIR_SUFFIX"
34 AC_SUBST(GIR_DIR)
35-AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Director prefix for gir installation])
36+AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Directory prefix for gir installation])
37
38 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.58.0])
39
40diff --git a/gobject-introspection-1.0.pc.in b/gobject-introspection-1.0.pc.in
41index a08b5d27..3409856c 100644
42--- a/gobject-introspection-1.0.pc.in
43+++ b/gobject-introspection-1.0.pc.in
44@@ -10,7 +10,7 @@ g_ir_scanner=${bindir}/g-ir-scanner
45 g_ir_compiler=${bindir}/g-ir-compiler@EXEEXT@
46 g_ir_generate=${bindir}/g-ir-generate@EXEEXT@
47 gidatadir=${datadir}/gobject-introspection-1.0
48-girdir=${datadir}/gir-1.0
49+girdir=@GIR_DIR@
50 typelibdir=${libdir}/girepository-1.0
51
52 Cflags: -I${includedir}/gobject-introspection-1.0 @FFI_PC_CFLAGS@
53diff --git a/gobject-introspection-no-export-1.0.pc.in b/gobject-introspection-no-export-1.0.pc.in
54index d214d22d..745aaade 100644
55--- a/gobject-introspection-no-export-1.0.pc.in
56+++ b/gobject-introspection-no-export-1.0.pc.in
57@@ -9,7 +9,7 @@ includedir=@includedir@
58 g_ir_scanner=${bindir}/g-ir-scanner
59 g_ir_compiler=${bindir}/g-ir-compiler@EXEEXT@
60 g_ir_generate=${bindir}/g-ir-generate@EXEEXT@
61-girdir=${datadir}/gir-1.0
62+girdir=@GIR_DIR@
63 typelibdir=${libdir}/girepository-1.0
64
65 Cflags: -I${includedir}/gobject-introspection-1.0 @FFI_PC_CFLAGS@
66--
672.17.0
68
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-g-ir-tools-respect-gir_dir_prefix.patch b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-g-ir-tools-respect-gir_dir_prefix.patch
new file mode 100644
index 0000000000..5e4176725c
--- /dev/null
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-g-ir-tools-respect-gir_dir_prefix.patch
@@ -0,0 +1,76 @@
1g-ir-tools: respect gir_dir_prefix
2
3Configure option gir_dir_prefix is used to configure install dir for
4.gir files, so add its value to include file search paths.
5
6Upstream-Status: Accepted [https://gitlab.gnome.org/GNOME/gobject-introspection/commit/3fe995a]
7
8Signed-off-by: Kai Kang <kai.kang@windriver.com>
9---
10 Makefile-tools.am | 2 +-
11 giscanner/transformer.py | 1 +
12 tests/warn/warningtester.py | 1 +
13 tools/g-ir-tool-template.in | 10 ++++++++++
14 6 files changed, 15 insertions(+), 2 deletions(-)
15
16diff --git a/Makefile-tools.am b/Makefile-tools.am
17index c70d9850..fcaf1e01 100644
18--- a/Makefile-tools.am
19+++ b/Makefile-tools.am
20@@ -9,7 +9,7 @@ EXTRA_DIST += \
21 tools/g-ir-tool-template.in \
22 tools/meson.build
23
24-TOOL_SUBSTITUTIONS = -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON_CMD\@,\/usr\/bin\/env\ $(PYTHON),
25+TOOL_SUBSTITUTIONS = -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON_CMD\@,\/usr\/bin\/env\ $(PYTHON), -e s,@GIR_DIR\@,$(GIR_DIR),g
26
27 g-ir-scanner: tools/g-ir-tool-template.in _giscanner.la Makefile
28 $(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,scannermain, -e s,@TOOL_FUNCTION\@,scanner_main, $< > $@.tmp && mv $@.tmp $@
29diff --git a/giscanner/transformer.py b/giscanner/transformer.py
30index 335e229f..2c412339 100644
31--- a/giscanner/transformer.py
32+++ b/giscanner/transformer.py
33@@ -184,6 +184,7 @@ None."""
34 def _get_gi_data_dirs(self):
35 data_dirs = utils.get_system_data_dirs()
36 data_dirs.append(DATADIR)
37+ data_dirs.append(GIRDIR)
38 if os.name != 'nt':
39 # For backwards compatibility, was always unconditionally added to the list.
40 data_dirs.append('/usr/share')
41diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py
42index f17c8889..be5aec13 100644
43--- a/tests/warn/warningtester.py
44+++ b/tests/warn/warningtester.py
45@@ -18,6 +18,7 @@ sys.path.insert(0, path)
46
47 # Not correct, but enough to get the tests going uninstalled
48 builtins.__dict__['DATADIR'] = path
49+builtins.__dict__['GIRDIR'] = ''
50
51 from giscanner.annotationparser import GtkDocCommentBlockParser
52 from giscanner.ast import Include, Namespace
53diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
54index ed33d16b..b9cf0911 100755
55--- a/tools/g-ir-tool-template.in
56+++ b/tools/g-ir-tool-template.in
57@@ -60,6 +60,16 @@ if not os.path.isdir(os.path.join(datadir, 'gir-1.0')):
58
59 builtins.__dict__['DATADIR'] = datadir
60
61+# Respect gir_dir_prefix for meson and autotools
62+girdir = ''
63+# for meson
64+if '@gir_dir_prefix@' and not '@gir_dir_prefix@'.startswith('@'):
65+ girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@'))
66+# for autotools
67+elif '@GIR_DIR@' and not '@GIR_DIR@'.startswith('@'):
68+ girdir = os.path.dirname(os.path.abspath('@GIR_DIR@'))
69+builtins.__dict__['GIRDIR'] = girdir
70+
71 # Again, relative paths first so that the installation prefix is relocatable
72 pylibdir = os.path.abspath(os.path.join(filedir, '..', 'lib', 'gobject-introspection'))
73
74--
752.17.0
76
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.58.0.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.58.0.bb
index 2c8cfa6bd9..55ca87ddaa 100644
--- a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.58.0.bb
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.58.0.bb
@@ -17,6 +17,8 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${@oe.utils.trim_version("${PV}", 2)}/${BPN}-$
17 file://0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch \ 17 file://0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch \
18 file://0001-giscanner-add-a-lib-dirs-envvar-option.patch \ 18 file://0001-giscanner-add-a-lib-dirs-envvar-option.patch \
19 file://0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch \ 19 file://0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch \
20 file://0001-configure.ac-make-GIR_DIR-configurable.patch \
21 file://0002-g-ir-tools-respect-gir_dir_prefix.patch \
20 " 22 "
21 23
22SRC_URI[md5sum] = "94fec875276262037bfcd51226db12fe" 24SRC_URI[md5sum] = "94fec875276262037bfcd51226db12fe"
@@ -24,7 +26,9 @@ SRC_URI[sha256sum] = "27c1590a32749de0a5481ce897772547043e94bccba4bc0a7edb3d8513
24 26
25SRC_URI_append_class-native = " file://0001-Relocate-the-repository-directory-for-native-builds.patch" 27SRC_URI_append_class-native = " file://0001-Relocate-the-repository-directory-for-native-builds.patch"
26 28
27inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even 29inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even multilib_script
30
31MULTILIB_SCRIPTS = "${PN}:${bindir}/g-ir-annotation-tool ${PN}:${bindir}/g-ir-scanner"
28 32
29DEPENDS_append = " libffi zlib glib-2.0 python3 flex-native bison-native autoconf-archive" 33DEPENDS_append = " libffi zlib glib-2.0 python3 flex-native bison-native autoconf-archive"
30 34
@@ -50,6 +54,7 @@ EXTRA_OECONF_class-target = " \
50 --enable-gi-cross-wrapper=${B}/g-ir-scanner-qemuwrapper \ 54 --enable-gi-cross-wrapper=${B}/g-ir-scanner-qemuwrapper \
51 --enable-gi-ldd-wrapper=${B}/g-ir-scanner-lddwrapper \ 55 --enable-gi-ldd-wrapper=${B}/g-ir-scanner-lddwrapper \
52 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection-data', '--disable-introspection-data', d)} \ 56 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection-data', '--disable-introspection-data', d)} \
57 ${@'--with-gir-dir-prefix=${libdir}' if d.getVar('MULTILIBS') else ''} \
53" 58"
54 59
55# Need to ensure ld.so.conf exists so prelink-native works 60# Need to ensure ld.so.conf exists so prelink-native works
@@ -94,7 +99,7 @@ EOF
94# This prevents g-ir-scanner from writing cache data to $HOME 99# This prevents g-ir-scanner from writing cache data to $HOME
95export GI_SCANNER_DISABLE_CACHE=1 100export GI_SCANNER_DISABLE_CACHE=1
96 101
97g-ir-scanner --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH --use-binary-wrapper=${STAGING_BINDIR}/g-ir-scanner-qemuwrapper --use-ldd-wrapper=${STAGING_BINDIR}/g-ir-scanner-lddwrapper --add-include-path=${STAGING_DATADIR}/gir-1.0 "\$@" 102g-ir-scanner --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH --use-binary-wrapper=${STAGING_BINDIR}/g-ir-scanner-qemuwrapper --use-ldd-wrapper=${STAGING_BINDIR}/g-ir-scanner-lddwrapper --add-include-path=${STAGING_DATADIR}/gir-1.0 --add-include-path=${STAGING_LIBDIR}/gir-1.0 "\$@"
98EOF 103EOF
99 chmod +x ${B}/g-ir-scanner-wrapper 104 chmod +x ${B}/g-ir-scanner-wrapper
100 105
@@ -178,7 +183,7 @@ FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
178 183
179# .gir files go to dev package, as they're needed for developing (but not for running) 184# .gir files go to dev package, as they're needed for developing (but not for running)
180# things that depends on introspection. 185# things that depends on introspection.
181FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir" 186FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir ${libdir}/gir-*/*.gir"
182FILES_${PN}-dev_append = " ${datadir}/gir-*/*.rnc" 187FILES_${PN}-dev_append = " ${datadir}/gir-*/*.rnc"
183 188
184# These are used by gobject-based packages 189# These are used by gobject-based packages