[2/2] libical: build gobject and vala introspection

Message ID 20220120234129.4160546-2-f_l_k@t-online.de
State Accepted, archived
Commit 5e2fc4676b8944fc1d36d567bb2d1ff4cff32294
Headers show
Series [1/2] python3-dbusmock: add BBCLASSEXTEND = "native nativesdk" | expand

Commit Message

Markus Volk Jan. 20, 2022, 11:41 p.m. UTC
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/recipes-support/libical/libical_3.0.12.bb | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin Jan. 20, 2022, 11:50 p.m. UTC | #1
On Fri, 21 Jan 2022 at 00:41, Markus Volk <f_l_k@t-online.de> wrote:

> +EXTRA_OECMAKE += "-DGOBJECT_INTROSPECTION=ON"
>

This needs to be conditionally enabled similar to webkitgtk recipe:
                ${@bb.utils.contains('GI_DATA_ENABLED', 'True',
'-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \


+do_configure:append () {

> +    # fix abs path for g-ir-scanner-wrapper
> +    sed  -i ${B}/build.ninja \
> +        -e 's: ${bindir}/g-ir-scanner-wrapper:
> ${STAGING_BINDIR}/g-ir-scanner-wrapper:g'
> +
> +    # fix abs path for g-ir-compiler-wrapper
> +    sed  -i ${B}/build.ninja \
> +        -e 's: ${bindir}/g-ir-compiler-wrapper:
> ${STAGING_BINDIR}/g-ir-compiler-wrapper:g'
> +
> +    # fix abs path for vapigen
> +    sed  -i ${B}/build.ninja \
> +        -e 's: ${STAGING_BINDIR}/vapigen:
> ${STAGING_BINDIR_NATIVE}/vapigen:g'
> +}
>

This needs to be done with a patch and not by patching generated files with
sed after the fact; the binary names should be provided from calling
pkg-config.

Alex
Markus Volk Jan. 21, 2022, midnight UTC | #2
> This needs to be conditionally enabled similar to webkitgtk recipe:
>                 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 
> '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \

Most Gnome Projects meanwhile consider gobject-introspection to be 
mandatory. Are you sure this needs to be optional. The generated files 
are really small in size and you just cant build the complete Gnome Code 
if you allow to make it optional.

> This needs to be done with a patch and not by patching generated files 
> with sed after the fact; the binary names should be provided from 
> calling pkg-config.
Yes, i know, you are right. But that whole introspection thing is to 
some point a big mess. Found that hack in the evolution-data-server 
recipe. Not sure if i'm able to sort that out, but i'll have a look at.

Am 21.01.22 um 00:50 schrieb Alexander Kanavin:
> On Fri, 21 Jan 2022 at 00:41, Markus Volk <f_l_k@t-online.de 
> <mailto:f_l_k@t-online.de>> wrote:
>
>     +EXTRA_OECMAKE += "-DGOBJECT_INTROSPECTION=ON"
>
>
> This needs to be conditionally enabled similar to webkitgtk recipe:
>                 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 
> '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
>
>
> +do_configure:append () {
>
>     +    # fix abs path for g-ir-scanner-wrapper
>     +    sed  -i ${B}/build.ninja \
>     +        -e 's: ${bindir}/g-ir-scanner-wrapper:
>     ${STAGING_BINDIR}/g-ir-scanner-wrapper:g'
>     +
>     +    # fix abs path for g-ir-compiler-wrapper
>     +    sed  -i ${B}/build.ninja \
>     +        -e 's: ${bindir}/g-ir-compiler-wrapper:
>     ${STAGING_BINDIR}/g-ir-compiler-wrapper:g'
>     +
>     +    # fix abs path for vapigen
>     +    sed  -i ${B}/build.ninja \
>     +        -e 's: ${STAGING_BINDIR}/vapigen:
>     ${STAGING_BINDIR_NATIVE}/vapigen:g'
>     +}
>
>
> This needs to be done with a patch and not by patching generated files 
> with sed after the fact; the binary names should be provided from 
> calling pkg-config.
>
> Alex
Alexander Kanavin Jan. 21, 2022, 12:06 a.m. UTC | #3
On Fri, 21 Jan 2022 at 01:01, Markus Volk <f_l_k@t-online.de> wrote:

> This needs to be conditionally enabled similar to webkitgtk recipe:
>                 ${@bb.utils.contains('GI_DATA_ENABLED', 'True',
> '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
>
> Most Gnome Projects meanwhile consider gobject-introspection to be
> mandatory. Are you sure this needs to be optional. The generated files are
> really small in size and you just cant build the complete Gnome Code if you
> allow to make it optional.
>

Absolutely. Gobject introspection in cross-compile requires running a
target executable through qemu usermode, and that is not guaranteed to
work. If qemu errors out, then the whole recipe build breaks.

Alex

Patch

diff --git a/meta/recipes-support/libical/libical_3.0.12.bb b/meta/recipes-support/libical/libical_3.0.12.bb
index b2b2211b9b..fef569ea64 100644
--- a/meta/recipes-support/libical/libical_3.0.12.bb
+++ b/meta/recipes-support/libical/libical_3.0.12.bb
@@ -16,7 +16,7 @@  SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.g
 SRC_URI[sha256sum] = "35095a4cc1a061a3de0f332c2dc728226cf127fa0baa818e9f8856cee6d35830"
 UPSTREAM_CHECK_URI = "https://github.com/libical/libical/releases"
 
-inherit cmake pkgconfig
+inherit cmake pkgconfig gobject-introspection vala
 
 DEPENDS += "libical-native"
 
@@ -32,10 +32,26 @@  EXTRA_OECMAKE += "-DPERL_EXECUTABLE=${HOSTTOOLS_DIR}/perl"
 EXTRA_OECMAKE += "-DLIBICAL_BUILD_TESTING=false"
 # doc build fails with linker error (??) for libical-glib so disable it
 EXTRA_OECMAKE += "-DICAL_BUILD_DOCS=false"
+EXTRA_OECMAKE += "-DGOBJECT_INTROSPECTION=ON"
+EXTRA_OECMAKE += "-DICAL_GLIB_VAPI=ON"
 
 # Tell the cross-libical where the tool it needs to build is
 EXTRA_OECMAKE:append:class-target = " -DIMPORT_ICAL_GLIB_SRC_GENERATOR=${STAGING_LIBDIR_NATIVE}/cmake/LibIcal/IcalGlibSrcGenerator.cmake"
 
+do_configure:append () {
+    # fix abs path for g-ir-scanner-wrapper
+    sed  -i ${B}/build.ninja \
+        -e 's: ${bindir}/g-ir-scanner-wrapper: ${STAGING_BINDIR}/g-ir-scanner-wrapper:g'
+
+    # fix abs path for g-ir-compiler-wrapper
+    sed  -i ${B}/build.ninja \
+        -e 's: ${bindir}/g-ir-compiler-wrapper: ${STAGING_BINDIR}/g-ir-compiler-wrapper:g'
+
+    # fix abs path for vapigen
+    sed  -i ${B}/build.ninja \
+        -e 's: ${STAGING_BINDIR}/vapigen: ${STAGING_BINDIR_NATIVE}/vapigen:g'
+}
+
 do_install:append () {
     # Remove build host references (https://github.com/libical/libical/issues/532)
     sed -i \