Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "A general-purpose utility library" |
| 2 | DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on." |
| 3 | HOMEPAGE = "https://developer.gnome.org/glib/" |
| 4 | |
| 5 | # pcre is under BSD; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 6 | # docs/reference/COPYING is with a 'public domain'-like license! |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 7 | LICENSE = "LGPL-2.1-or-later & BSD-3-Clause & PD" |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=41890f71f740302b785c27661123bff5 \ |
| 9 | file://glib/glib.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \ |
| 10 | file://LICENSES/LGPL-2.1-or-later.txt;md5=41890f71f740302b785c27661123bff5 \ |
| 11 | file://gmodule/gmodule.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc" |
| 13 | BUGTRACKER = "http://bugzilla.gnome.org" |
| 14 | SECTION = "libs" |
| 15 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | CVE_PRODUCT = "glib" |
| 17 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | BBCLASSEXTEND = "native nativesdk" |
| 19 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | DEPENDS = "glib-2.0-native \ |
| 21 | virtual/libintl \ |
| 22 | virtual/libiconv \ |
| 23 | libffi \ |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 24 | libpcre2 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | zlib" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | PACKAGES += "${PN}-codegen ${PN}-utils" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | |
| 29 | LEAD_SONAME = "libglib-2.0.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 31 | inherit meson gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages gobject-introspection-data |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 33 | GTKDOC_MESON_OPTION = "gtk_doc" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | S = "${WORKDIR}/glib-${PV}" |
| 36 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 37 | PACKAGECONFIG ??= "libmount \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 39 | PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native" |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 41 | PACKAGECONFIG[libelf] = "-Dlibelf=enabled,-Dlibelf=disabled,elfutils" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 42 | PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false," |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 43 | PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 44 | |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 45 | EXTRA_OEMESON = "-Ddtrace=false -Dsystemtap=false" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 46 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 47 | do_configure:prepend() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 48 | sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | } |
| 50 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 51 | FILES:${PN} = "${libdir}/lib*${SOLIBS} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 52 | ${libdir}/gio \ |
| 53 | ${libexecdir}/*gio-querymodules \ |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 54 | ${libexecdir}/*gio-launch-desktop \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 55 | ${datadir}/glib-2.0/dtds \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 56 | ${datadir}/glib-2.0/schemas" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 57 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 58 | FILES:${PN}-dev += "${libdir}/glib-2.0/include \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | ${libdir}/gio/modules/lib*${SOLIBSDEV} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 60 | ${libdir}/gio/modules/*.la \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 61 | ${datadir}/glib-2.0/gettext/po/Makefile.in.in \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 62 | ${datadir}/glib-2.0/schemas/gschema.dtd \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 63 | ${datadir}/glib-2.0/valgrind/glib.supp \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 64 | ${datadir}/gettext/its" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 65 | FILES:${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb" |
| 66 | FILES:${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 67 | ${bindir}/gdbus-codegen" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | FILES:${PN}-utils = "${bindir}/*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 70 | SHAREDMIMEDEP = "shared-mime-info" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 71 | SHAREDMIMEDEP:class-native = "" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 72 | # When cross compiling for Windows we don't want to include this |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 73 | SHAREDMIMEDEP:mingw32 = "" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 74 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 75 | RRECOMMENDS:${PN} += "${SHAREDMIMEDEP}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 76 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 77 | ARM_INSTRUCTION_SET:armv4 = "arm" |
| 78 | ARM_INSTRUCTION_SET:armv5 = "arm" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 79 | # Valgrind runtime detection works using hand-written assembly, which |
| 80 | # doesn't support mips16e |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 81 | CPPFLAGS:append:class-target:mips16e = " -DNVALGRIND=1" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 82 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 83 | # GLib generally requires gettext to be present so for USE_NLS to yes. For |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 84 | # native builds as i18n is disabled globally we have to add a gettext-native dependency. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 85 | USE_NLS:class-target = "yes" |
| 86 | USE_NLS:class-nativesdk = "yes" |
| 87 | DEPENDS:append:class-native = " gettext-native" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 88 | |
| 89 | EXEEXT = "" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 90 | EXEEXT:mingw32 = ".exe" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 92 | do_install:append () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 93 | if [ -f ${D}${bindir}/gtester-report ]; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 94 | sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | fi |
| 96 | |
| 97 | # Remove some unpackaged files |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 98 | rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 99 | rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc |
| 100 | rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo |
| 101 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 102 | if [ -e ${D}${libdir}/charset.alias ]; then |
| 103 | rm -f ${D}${libdir}/charset.alias |
| 104 | fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 105 | |
| 106 | # Make sure gio-querymodules is unique among multilibs |
| 107 | if test "x${MLPREFIX}" != "x"; then |
| 108 | mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT} |
| 109 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 110 | # Autotools does this, meson does not |
| 111 | mkdir -p ${D}${libdir}/gio/modules |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 112 | } |
| 113 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 114 | do_install:append:class-native () { |
| 115 | # Link gio-querymodules into ${bindir} as otherwise tools like meson won't find it |
| 116 | ln -rs ${D}${libexecdir}/gio-querymodules ${D}${bindir} |
| 117 | } |
| 118 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 119 | do_install:append:class-target () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 120 | # Tests are only installed on targets, not native builds. Separating this out |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 121 | # keeps glib-2.0-native from depending on DISTRO_FEATURES |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 122 | if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then |
| 123 | if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then |
| 124 | rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test |
| 125 | fi |
| 126 | fi |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 127 | if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then |
| 128 | if test "x${MLPREFIX}" != "x"; then |
| 129 | mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test |
| 130 | fi |
| 131 | fi |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 132 | # https://gitlab.gnome.org/GNOME/glib/-/issues/2810 |
| 133 | rm -f ${D}${datadir}/installed-tests/glib/thread-pool-slow.test |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 134 | } |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 135 | do_install:append:class-target:libc-musl () { |
| 136 | # Remove failing tests on musl libc systems, this helps set baseline for musl testing |
| 137 | # they remain to be rootcaused and fixed but marked known failures here. |
| 138 | for t in convert.test collate.test gdatetime.test date.test converter-stream.test option-context.test; do |
| 139 | rm -rf ${D}${datadir}/installed-tests/glib/$t |
| 140 | done |
| 141 | } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 142 | # As we do not build python3 for windows, makes no sense to ship the script that's using it |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 143 | do_install:append:mingw32() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 144 | rm -f ${D}${bindir}/gtester-report |
| 145 | } |
| 146 | |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 147 | # remove setuptools dependency when usage of distutils is dropped in |
| 148 | # https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/gdbus-2.0/codegen/utils.py |
| 149 | CODEGEN_PYTHON_RDEPENDS = "python3 python3-setuptools python3-xml" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 150 | CODEGEN_PYTHON_RDEPENDS:mingw32 = "" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 151 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 152 | RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 153 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 154 | RDEPENDS:${PN}-ptest += "${PN}-utils" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 155 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 156 | RDEPENDS:${PN}-ptest += "\ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 157 | coreutils \ |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 158 | libgcc \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 159 | dbus \ |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 160 | desktop-file-utils \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 161 | gnome-desktop-testing \ |
| 162 | tzdata \ |
| 163 | tzdata-americas \ |
| 164 | tzdata-asia \ |
| 165 | tzdata-europe \ |
| 166 | tzdata-posix \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 167 | shared-mime-info \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 168 | ${PN}-locale-ja \ |
| 169 | ${PN}-locale-fr \ |
| 170 | ${PN}-locale-el \ |
| 171 | ${PN}-locale-hr \ |
| 172 | ${PN}-locale-lt \ |
| 173 | ${PN}-locale-pl \ |
| 174 | ${PN}-locale-ru \ |
| 175 | ${PN}-locale-th \ |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 176 | python3-core \ |
| 177 | python3-modules \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 178 | ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-dbusmock', '', d)} \ |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 179 | ${PN}-codegen \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 180 | locale-base-de-de \ |
| 181 | locale-base-es-es \ |
| 182 | locale-base-en-gb \ |
| 183 | locale-base-en-us \ |
| 184 | locale-base-fr-fr \ |
| 185 | locale-base-ru-ru \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 186 | " |
| 187 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 188 | RDEPENDS:${PN}-ptest:append:libc-glibc = "\ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 189 | glibc-gconv-utf-16 \ |
| 190 | glibc-charmap-utf-8 \ |
| 191 | glibc-gconv-cp1255 \ |
| 192 | glibc-charmap-cp1255 \ |
| 193 | glibc-gconv-utf-32 \ |
| 194 | glibc-gconv-utf-7 \ |
| 195 | glibc-gconv-euc-jp \ |
| 196 | glibc-gconv-iso8859-1 \ |
| 197 | glibc-gconv-iso8859-15 \ |
| 198 | glibc-charmap-invariant \ |
| 199 | glibc-localedata-translit-cjk-variants \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 200 | locale-base-lt-lt \ |
| 201 | locale-base-ja-jp.euc-jp \ |
| 202 | locale-base-fa-ir \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 203 | locale-base-hr-hr \ |
| 204 | locale-base-el-gr \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 205 | locale-base-pl-pl \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 206 | locale-base-pl-pl.iso-8859-2 \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 207 | locale-base-tr-tr \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 208 | " |