Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | # Inherit this class in recipes to enable building their introspection files |
| 2 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 3 | # 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 7 | # depending on distro and machine features (see gobject-introspection-data class). |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 8 | inherit python3native gobject-introspection-data |
| 9 | EXTRA_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 |
| 13 | EXTRA_OECONF_prepend_class-native = "--disable-introspection " |
| 14 | EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection " |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 15 | |
| 16 | UNKNOWN_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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | DEPENDS_append_class-target = " gobject-introspection gobject-introspection-native qemu-native prelink-native" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 22 | # Even though introspection is disabled on -native, gobject-introspection package is still |
| 23 | # needed for m4 macros. |
| 24 | DEPENDS_append_class-native = " gobject-introspection-native" |
| 25 | DEPENDS_append_class-nativesdk = " gobject-introspection-native" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | |
| 27 | # This is used by introspection tools to find .gir includes |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 28 | export XDG_DATA_DIRS = "${STAGING_DATADIR}:${STAGING_LIBDIR}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 29 | |
| 30 | do_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). |
| 39 | FILES_${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. |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 43 | FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir ${libdir}/gir-*/*.gir" |