From fae786dec1a9a5615f11d083a7994ad42f2b7a81 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Tue, 29 Jan 2019 11:18:06 -0200 Subject: [PATCH] build_helper: add gir build_helper --- Manual.md | 3 +++ common/build-helper/gir.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 common/build-helper/gir.sh diff --git a/Manual.md b/Manual.md index 996ea159ad..164bfb1f54 100644 --- a/Manual.md +++ b/Manual.md @@ -874,6 +874,9 @@ The current list of available `build_helper` scripts is the following: - `rust` specifies environment variables required for cross-compiling crates via cargo and for compiling cargo -sys crates. +- `gir` specifies dependencies for native and cross builds to deal with +GObject Introspection + ### Functions diff --git a/common/build-helper/gir.sh b/common/build-helper/gir.sh new file mode 100644 index 0000000000..63c22929c5 --- /dev/null +++ b/common/build-helper/gir.sh @@ -0,0 +1,27 @@ +# +# gir - build-helper for gobject-introspection +# +# This build-helper is used for packages that make use of +# the GObject introspection middleware layer. +# + +# Check if the 'gir' build_option is set or if there is no +# 'gir' build_option. +if [ "$build_option_gir" ] || [[ $build_options != *"gir"* ]]; then + # Provide the host tooling, g-ir-scanner, g-ir-compiler and its + # wrappers. + hostmakedepends+=" gobject-introspection" + + if [ "$CROSS_BUILD" ]; then + # Required for running binaries produced from g-ir-compiler + # via g-ir-scanner-qemuwrapper + hostmakedepends+=" qemu-user-static" + + # Required for running the g-ir-scanner-lddwrapper + hostmakedepends+=" prelink-cross" + + # Provide basic .gir types like GLib, GObject, DBus, Gio, cairo + # and tooling like g-ir-compiler + makedepends+=" gobject-introspection" + fi +fi