diff options
Diffstat (limited to 'meta/classes-recipe/gobject-introspection.bbclass')
| -rw-r--r-- | meta/classes-recipe/gobject-introspection.bbclass | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/meta/classes-recipe/gobject-introspection.bbclass b/meta/classes-recipe/gobject-introspection.bbclass deleted file mode 100644 index d0052cd623..0000000000 --- a/meta/classes-recipe/gobject-introspection.bbclass +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Copyright OpenEmbedded Contributors | ||
| 3 | # | ||
| 4 | # SPDX-License-Identifier: MIT | ||
| 5 | # | ||
| 6 | |||
| 7 | # Inherit this class in recipes to enable building their introspection files | ||
| 8 | |||
| 9 | # python3native is inherited to prevent introspection tools being run with | ||
| 10 | # host's python 3 (they need to be run with native python 3) | ||
| 11 | # | ||
| 12 | # This also sets up autoconf-based recipes to build introspection data (or not), | ||
| 13 | # depending on distro and machine features (see gobject-introspection-data class). | ||
| 14 | inherit python3native gobject-introspection-data | ||
| 15 | |||
| 16 | # meson: default option name to enable/disable introspection. This matches most | ||
| 17 | # project's configuration. In doubts - check meson_options.txt in project's | ||
| 18 | # source path. | ||
| 19 | GIR_MESON_OPTION ?= 'introspection' | ||
| 20 | GIR_MESON_ENABLE_FLAG ?= 'true' | ||
| 21 | GIR_MESON_DISABLE_FLAG ?= 'false' | ||
| 22 | |||
| 23 | # Define g-i options such that they can be disabled completely when GIR_MESON_OPTION is empty | ||
| 24 | GIRMESONTARGET = "-D${GIR_MESON_OPTION}=${@bb.utils.contains('GI_DATA_ENABLED', 'True', '${GIR_MESON_ENABLE_FLAG}', '${GIR_MESON_DISABLE_FLAG}', d)} " | ||
| 25 | GIRMESONBUILD = "-D${GIR_MESON_OPTION}=${GIR_MESON_DISABLE_FLAG} " | ||
| 26 | # Auto enable/disable based on GI_DATA_ENABLED | ||
| 27 | EXTRA_OECONF:prepend:class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} " | ||
| 28 | EXTRA_OEMESON:prepend:class-target = "${@['', '${GIRMESONTARGET}'][d.getVar('GIR_MESON_OPTION') != '']}" | ||
| 29 | # When building native recipes, disable introspection, as it is not necessary, | ||
| 30 | # pulls in additional dependencies, and makes build times longer | ||
| 31 | EXTRA_OECONF:prepend:class-native = "--disable-introspection " | ||
| 32 | EXTRA_OECONF:prepend:class-nativesdk = "--disable-introspection " | ||
| 33 | EXTRA_OEMESON:prepend:class-native = "${@['', '${GIRMESONBUILD}'][d.getVar('GIR_MESON_OPTION') != '']}" | ||
| 34 | EXTRA_OEMESON:prepend:class-nativesdk = "${@['', '${GIRMESONBUILD}'][d.getVar('GIR_MESON_OPTION') != '']}" | ||
| 35 | |||
| 36 | # Generating introspection data depends on a combination of native and target | ||
| 37 | # introspection tools, and qemu to run the target tools. | ||
| 38 | DEPENDS:append:class-target = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'gobject-introspection qemu-native', '', d)}" | ||
| 39 | |||
| 40 | # Even when introspection is disabled, the gobject-introspection package is still needed for m4 macros. | ||
| 41 | DEPENDS:append = " gobject-introspection-native" | ||
| 42 | |||
| 43 | # This is used by introspection tools to find .gir includes | ||
| 44 | export XDG_DATA_DIRS = "${STAGING_DATADIR}:${STAGING_LIBDIR}" | ||
| 45 | |||
| 46 | do_configure:prepend:class-target () { | ||
| 47 | # introspection.m4 pre-packaged with upstream tarballs does not yet | ||
| 48 | # have our fixes | ||
| 49 | mkdir -p ${S}/m4 | ||
| 50 | cp ${STAGING_DIR_NATIVE}/${datadir}/aclocal/introspection.m4 ${S}/m4 | ||
| 51 | } | ||
| 52 | |||
| 53 | do_compile:prepend() { | ||
| 54 | # This prevents g-ir-scanner from writing cache data to $HOME | ||
| 55 | export GI_SCANNER_DISABLE_CACHE=1 | ||
| 56 | } | ||
| 57 | |||
| 58 | # .typelib files are needed at runtime and so they go to the main package (so | ||
| 59 | # they'll be together with libraries they support). | ||
| 60 | FILES:${PN}:append = " ${libdir}/girepository-*/*.typelib" | ||
| 61 | |||
| 62 | # .gir files go to dev package, as they're needed for developing (but not for | ||
| 63 | # running) things that depends on introspection. | ||
| 64 | FILES:${PN}-dev:append = " ${datadir}/gir-*/*.gir ${libdir}/gir-*/*.gir" | ||
