blob: b6160b88b6a50a4a39cc67281303352e89756e41 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001# Inherit this class in recipes to enable building their introspection files
2
Patrick Williamsc0f7c042017-02-23 20:41:17 -06003# python3native is inherited to prevent introspection tools being run with
4# host's python 3 (they need to be run with native python 3)
5#
6# This also sets up autoconf-based recipes to build introspection data (or not),
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05007# depending on distro and machine features (see gobject-introspection-data class).
Patrick Williamsc0f7c042017-02-23 20:41:17 -06008inherit python3native gobject-introspection-data
9EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
10
11# When building native recipes, disable introspection, as it is not necessary,
12# pulls in additional dependencies, and makes build times longer
13EXTRA_OECONF_prepend_class-native = "--disable-introspection "
14EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection "
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015
16UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
17
18# Generating introspection data depends on a combination of native and target
19# introspection tools, and qemu to run the target tools.
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020DEPENDS_append_class-target = " gobject-introspection gobject-introspection-native qemu-native prelink-native"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021
Patrick Williamsc0f7c042017-02-23 20:41:17 -060022# Even though introspection is disabled on -native, gobject-introspection package is still
23# needed for m4 macros.
24DEPENDS_append_class-native = " gobject-introspection-native"
25DEPENDS_append_class-nativesdk = " gobject-introspection-native"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026
27# This is used by introspection tools to find .gir includes
28export XDG_DATA_DIRS = "${STAGING_DATADIR}"
29
30do_configure_prepend_class-target () {
31 # introspection.m4 pre-packaged with upstream tarballs does not yet
32 # have our fixes
33 mkdir -p ${S}/m4
34 cp ${STAGING_DIR_TARGET}/${datadir}/aclocal/introspection.m4 ${S}/m4
35}
36
37# .typelib files are needed at runtime and so they go to the main package (so
38# they'll be together with libraries they support).
39FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
40
41# .gir files go to dev package, as they're needed for developing (but not for
42# running) things that depends on introspection.
43FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir"