diff mbox series

[PATCHv2] vala: fix for gtk4 prior to 4.14

Message ID 20240311072125.214522-1-f_l_k@t-online.de
State New
Headers show
Series [PATCHv2] vala: fix for gtk4 prior to 4.14 | expand

Commit Message

Markus Volk March 11, 2024, 7:21 a.m. UTC
- add a backport patch to fix compatibility with older gtk4 versions
- merge .bb and .inc

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/recipes-devtools/vala/vala.inc           | 71 -----------------
 ...tk4-Preserve-compatibility-with-4.14.patch | 39 ++++++++++
 meta/recipes-devtools/vala/vala_0.56.15.bb    | 76 ++++++++++++++++++-
 3 files changed, 114 insertions(+), 72 deletions(-)
 delete mode 100644 meta/recipes-devtools/vala/vala.inc
 create mode 100644 meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch

Comments

patchtest@automation.yoctoproject.org March 11, 2024, 7:33 a.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/PATCHv2-vala-fix-for-gtk4-prior-to-4.14.patch

FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
Alexander Kanavin March 11, 2024, 9:02 a.m. UTC | #2
Please split the .bb/.inc merge into a separate commit.


Alex

On Mon, 11 Mar 2024 at 08:21, Markus Volk <f_l_k@t-online.de> wrote:
>
> - add a backport patch to fix compatibility with older gtk4 versions
> - merge .bb and .inc
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
>  meta/recipes-devtools/vala/vala.inc           | 71 -----------------
>  ...tk4-Preserve-compatibility-with-4.14.patch | 39 ++++++++++
>  meta/recipes-devtools/vala/vala_0.56.15.bb    | 76 ++++++++++++++++++-
>  3 files changed, 114 insertions(+), 72 deletions(-)
>  delete mode 100644 meta/recipes-devtools/vala/vala.inc
>  create mode 100644 meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch
>
> diff --git a/meta/recipes-devtools/vala/vala.inc b/meta/recipes-devtools/vala/vala.inc
> deleted file mode 100644
> index 0177e86240..0000000000
> --- a/meta/recipes-devtools/vala/vala.inc
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -SUMMARY = "C#-like programming language for easing GObject programming"
> -HOMEPAGE = "http://vala-project.org"
> -DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
> -Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
> -SECTION = "devel"
> -DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
> -
> -# Appending libxslt-native to dependencies has an effect
> -# of rebuilding the manual, which is very slow. Let's do this
> -# only when api-documentation distro feature is enabled.
> -DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
> -
> -# vala-native contains a native version of vapigen, which we use instead of the target one
> -DEPENDS:append:class-target = " vala-native"
> -BBCLASSEXTEND = "native"
> -LICENSE = "LGPL-2.1-only"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> -
> -SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
> -
> -SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
> -inherit autotools pkgconfig upstream-version-is-even
> -
> -FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
> -FILES:${PN}-doc += "${datadir}/devhelp"
> -
> -# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
> -GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
> -
> -do_configure:prepend:class-target() {
> -        # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
> -        # The wrapper will call a native vapigen
> -        cat > ${B}/vapigen-wrapper << EOF
> -#!/bin/sh
> -vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
> -EOF
> -        chmod +x ${B}/vapigen-wrapper
> -}
> -
> -EXTRA_OECONF += " --disable-valadoc"
> -
> -# Vapigen wrapper needs to be available system-wide, because it will be used
> -# to build vapi files from all other packages with vala support
> -do_install:append:class-target() {
> -        install -d ${D}${bindir_crossscripts}/
> -        install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
> -}
> -
> -# Put vapigen wrapper into target sysroot so that it can be used when building
> -# vapi files.
> -SYSROOT_DIRS += "${bindir_crossscripts}"
> -
> -inherit multilib_script
> -MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
> -
> -SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
> -vapigen_sysroot_preprocess() {
> -        # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
> -        # up our wrapper.
> -        sed -i \
> -           -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
> -           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
> -}
> -
> -SSTATE_SCAN_FILES += "vapigen-wrapper"
> -
> -PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
> -
> -vala_package_preprocess () {
> -       rm -rf ${PKGD}${bindir_crossscripts}
> -}
> diff --git a/meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch b/meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch
> new file mode 100644
> index 0000000000..161474086e
> --- /dev/null
> +++ b/meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch
> @@ -0,0 +1,39 @@
> +From 17349020fb95454d06f827fd555b05248f10a370 Mon Sep 17 00:00:00 2001
> +From: Rico Tzschichholz <ricotz@ubuntu.com>
> +Date: Thu, 7 Mar 2024 17:56:05 +0100
> +Subject: [PATCH] gtk4: Preserve compatibility with < 4.14
> +
> +Don't prefer new accessor methods for Calendar.day/month/year
> +
> +Fixes https://gitlab.gnome.org/GNOME/vala/issues/1531
> +
> +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/vala/-/commit/e0c4ea8c4a0bbf859b5341a7465b395892789d9e]
> +
> +Signed-off-by: Markus Volk <f_l_k@t-online.de>
> +---
> + vapi/gtk4.vapi                 | 3 +++
> + vapi/metadata/Gtk-4.0.metadata | 5 +++++
> + 2 files changed, 8 insertions(+)
> +
> +diff --git a/vapi/gtk4.vapi b/vapi/gtk4.vapi
> +index 49f8b2078..51ecea27d 100644
> +--- a/vapi/gtk4.vapi
> ++++ b/vapi/gtk4.vapi
> +@@ -7350,11 +7350,14 @@ namespace Gtk {
> +               [Version (since = "4.14")]
> +               public void set_year (int year);
> +               public void unmark_day (uint day);
> ++              [NoAccessorMethod]
> +               public int day { get; set; }
> ++              [NoAccessorMethod]
> +               public int month { get; set; }
> +               public bool show_day_names { get; set; }
> +               public bool show_heading { get; set; }
> +               public bool show_week_numbers { get; set; }
> ++              [NoAccessorMethod]
> +               public int year { get; set; }
> +               public signal void day_selected ();
> +               public signal void next_month ();
> +--
> +2.44.0
> +
> diff --git a/meta/recipes-devtools/vala/vala_0.56.15.bb b/meta/recipes-devtools/vala/vala_0.56.15.bb
> index dc483b12ba..1f55689c45 100644
> --- a/meta/recipes-devtools/vala/vala_0.56.15.bb
> +++ b/meta/recipes-devtools/vala/vala_0.56.15.bb
> @@ -1,3 +1,77 @@
> -require ${BPN}.inc
> +SUMMARY = "C#-like programming language for easing GObject programming"
> +HOMEPAGE = "http://vala-project.org"
> +DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
> +Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
> +SECTION = "devel"
> +DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
>
> +# Appending libxslt-native to dependencies has an effect
> +# of rebuilding the manual, which is very slow. Let's do this
> +# only when api-documentation distro feature is enabled.
> +DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
> +
> +# vala-native contains a native version of vapigen, which we use instead of the target one
> +DEPENDS:append:class-target = " vala-native"
> +BBCLASSEXTEND = "native"
> +LICENSE = "LGPL-2.1-only"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> +
> +SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
> +
> +SRC_URI = " \
> +       http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz \
> +       file://0001-gtk4-Preserve-compatibility-with-4.14.patch \
> +"
>  SRC_URI[sha256sum] = "535b6452ed310fd5fb5c7dd6794b6213dac3b48e645e5bff3173741ec2cb3f2b"
> +
> +inherit autotools pkgconfig upstream-version-is-even
> +
> +FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
> +FILES:${PN}-doc += "${datadir}/devhelp"
> +
> +# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
> +GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
> +
> +do_configure:prepend:class-target() {
> +        # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
> +        # The wrapper will call a native vapigen
> +        cat > ${B}/vapigen-wrapper << EOF
> +#!/bin/sh
> +vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
> +EOF
> +        chmod +x ${B}/vapigen-wrapper
> +}
> +
> +EXTRA_OECONF += " --disable-valadoc"
> +
> +# Vapigen wrapper needs to be available system-wide, because it will be used
> +# to build vapi files from all other packages with vala support
> +do_install:append:class-target() {
> +        install -d ${D}${bindir_crossscripts}/
> +        install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
> +}
> +
> +# Put vapigen wrapper into target sysroot so that it can be used when building
> +# vapi files.
> +SYSROOT_DIRS += "${bindir_crossscripts}"
> +
> +inherit multilib_script
> +MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
> +
> +SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
> +vapigen_sysroot_preprocess() {
> +        # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
> +        # up our wrapper.
> +        sed -i \
> +           -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
> +           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
> +}
> +
> +SSTATE_SCAN_FILES += "vapigen-wrapper"
> +
> +PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
> +
> +vala_package_preprocess () {
> +       rm -rf ${PKGD}${bindir_crossscripts}
> +}
> +
> --
> 2.44.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196918): https://lists.openembedded.org/g/openembedded-core/message/196918
> Mute This Topic: https://lists.openembedded.org/mt/104858861/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/vala/vala.inc b/meta/recipes-devtools/vala/vala.inc
deleted file mode 100644
index 0177e86240..0000000000
--- a/meta/recipes-devtools/vala/vala.inc
+++ /dev/null
@@ -1,71 +0,0 @@ 
-SUMMARY = "C#-like programming language for easing GObject programming"
-HOMEPAGE = "http://vala-project.org"
-DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
-Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
-SECTION = "devel"
-DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
-
-# Appending libxslt-native to dependencies has an effect
-# of rebuilding the manual, which is very slow. Let's do this
-# only when api-documentation distro feature is enabled.
-DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
-
-# vala-native contains a native version of vapigen, which we use instead of the target one
-DEPENDS:append:class-target = " vala-native"
-BBCLASSEXTEND = "native"
-LICENSE = "LGPL-2.1-only"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
-
-SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
-
-SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
-inherit autotools pkgconfig upstream-version-is-even
-
-FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
-FILES:${PN}-doc += "${datadir}/devhelp"
-
-# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
-GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
-
-do_configure:prepend:class-target() {
-        # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
-        # The wrapper will call a native vapigen
-        cat > ${B}/vapigen-wrapper << EOF
-#!/bin/sh
-vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
-EOF
-        chmod +x ${B}/vapigen-wrapper
-}
-
-EXTRA_OECONF += " --disable-valadoc"
-
-# Vapigen wrapper needs to be available system-wide, because it will be used
-# to build vapi files from all other packages with vala support
-do_install:append:class-target() {
-        install -d ${D}${bindir_crossscripts}/
-        install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
-}
-
-# Put vapigen wrapper into target sysroot so that it can be used when building
-# vapi files.
-SYSROOT_DIRS += "${bindir_crossscripts}"
-
-inherit multilib_script
-MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
-
-SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
-vapigen_sysroot_preprocess() {
-        # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
-        # up our wrapper.
-        sed -i \
-           -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
-           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
-}
-
-SSTATE_SCAN_FILES += "vapigen-wrapper"
-
-PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
-
-vala_package_preprocess () {
-	rm -rf ${PKGD}${bindir_crossscripts}
-}
diff --git a/meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch b/meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch
new file mode 100644
index 0000000000..161474086e
--- /dev/null
+++ b/meta/recipes-devtools/vala/vala/0001-gtk4-Preserve-compatibility-with-4.14.patch
@@ -0,0 +1,39 @@ 
+From 17349020fb95454d06f827fd555b05248f10a370 Mon Sep 17 00:00:00 2001
+From: Rico Tzschichholz <ricotz@ubuntu.com>
+Date: Thu, 7 Mar 2024 17:56:05 +0100
+Subject: [PATCH] gtk4: Preserve compatibility with < 4.14
+
+Don't prefer new accessor methods for Calendar.day/month/year
+
+Fixes https://gitlab.gnome.org/GNOME/vala/issues/1531
+
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/vala/-/commit/e0c4ea8c4a0bbf859b5341a7465b395892789d9e]
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+---
+ vapi/gtk4.vapi                 | 3 +++
+ vapi/metadata/Gtk-4.0.metadata | 5 +++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/vapi/gtk4.vapi b/vapi/gtk4.vapi
+index 49f8b2078..51ecea27d 100644
+--- a/vapi/gtk4.vapi
++++ b/vapi/gtk4.vapi
+@@ -7350,11 +7350,14 @@ namespace Gtk {
+ 		[Version (since = "4.14")]
+ 		public void set_year (int year);
+ 		public void unmark_day (uint day);
++		[NoAccessorMethod]
+ 		public int day { get; set; }
++		[NoAccessorMethod]
+ 		public int month { get; set; }
+ 		public bool show_day_names { get; set; }
+ 		public bool show_heading { get; set; }
+ 		public bool show_week_numbers { get; set; }
++		[NoAccessorMethod]
+ 		public int year { get; set; }
+ 		public signal void day_selected ();
+ 		public signal void next_month ();
+-- 
+2.44.0
+
diff --git a/meta/recipes-devtools/vala/vala_0.56.15.bb b/meta/recipes-devtools/vala/vala_0.56.15.bb
index dc483b12ba..1f55689c45 100644
--- a/meta/recipes-devtools/vala/vala_0.56.15.bb
+++ b/meta/recipes-devtools/vala/vala_0.56.15.bb
@@ -1,3 +1,77 @@ 
-require ${BPN}.inc
+SUMMARY = "C#-like programming language for easing GObject programming"
+HOMEPAGE = "http://vala-project.org"
+DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
+Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
+SECTION = "devel"
+DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
 
+# Appending libxslt-native to dependencies has an effect
+# of rebuilding the manual, which is very slow. Let's do this
+# only when api-documentation distro feature is enabled.
+DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
+
+# vala-native contains a native version of vapigen, which we use instead of the target one
+DEPENDS:append:class-target = " vala-native"
+BBCLASSEXTEND = "native"
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = " \
+	http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz \
+	file://0001-gtk4-Preserve-compatibility-with-4.14.patch \
+"
 SRC_URI[sha256sum] = "535b6452ed310fd5fb5c7dd6794b6213dac3b48e645e5bff3173741ec2cb3f2b"
+
+inherit autotools pkgconfig upstream-version-is-even
+
+FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
+FILES:${PN}-doc += "${datadir}/devhelp"
+
+# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
+GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
+
+do_configure:prepend:class-target() {
+        # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
+        # The wrapper will call a native vapigen
+        cat > ${B}/vapigen-wrapper << EOF
+#!/bin/sh
+vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
+EOF
+        chmod +x ${B}/vapigen-wrapper
+}
+
+EXTRA_OECONF += " --disable-valadoc"
+
+# Vapigen wrapper needs to be available system-wide, because it will be used
+# to build vapi files from all other packages with vala support
+do_install:append:class-target() {
+        install -d ${D}${bindir_crossscripts}/
+        install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
+}
+
+# Put vapigen wrapper into target sysroot so that it can be used when building
+# vapi files.
+SYSROOT_DIRS += "${bindir_crossscripts}"
+
+inherit multilib_script
+MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
+
+SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
+vapigen_sysroot_preprocess() {
+        # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
+        # up our wrapper.
+        sed -i \
+           -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
+           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
+}
+
+SSTATE_SCAN_FILES += "vapigen-wrapper"
+
+PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
+
+vala_package_preprocess () {
+	rm -rf ${PKGD}${bindir_crossscripts}
+}
+