xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-core/glib-2.0/glib.inc (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "A general-purpose utility library"
2DESCRIPTION = "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."
3HOMEPAGE = "https://developer.gnome.org/glib/"
4
5# pcre is under BSD;
6# docs/reference/COPYING is with a 'public domain'-like license!
7LICENSE = "LGPL-2.1-or-later & BSD-3-Clause & PD"
8LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
9                    file://glib/glib.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
10                    file://gmodule/COPYING;md5=4fbd65380cdd255951079008b364516c \
11                    file://gmodule/gmodule.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
12                    file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
13BUGTRACKER = "http://bugzilla.gnome.org"
14SECTION = "libs"
15
16CVE_PRODUCT = "glib"
17
18BBCLASSEXTEND = "native nativesdk"
19
20DEPENDS = "glib-2.0-native \
21           virtual/libintl \
22           virtual/libiconv \
23           libffi \
24           libpcre \
25           zlib"
26
27PACKAGES += "${PN}-codegen ${PN}-utils"
28
29LEAD_SONAME = "libglib-2.0.*"
30
31inherit meson gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages
32
33DEPENDS:append:class-target = "${@' gtk-doc' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}"
34
35GTKDOC_MESON_OPTION = "gtk_doc"
36
37S = "${WORKDIR}/glib-${PV}"
38
39PACKAGECONFIG ??= "libmount \
40                   ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
41PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux"
42PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native"
43# libelf is auto-detected without a configuration option
44PACKAGECONFIG[libelf] = ",,elfutils"
45PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,"
46PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux"
47
48EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false"
49
50do_configure:prepend() {
51	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
52}
53
54FILES:${PN} = "${libdir}/lib*${SOLIBS} \
55               ${libdir}/gio \
56               ${libexecdir}/*gio-querymodules \
57               ${datadir}/glib-2.0/schemas"
58
59FILES:${PN}-utils += "${bindir}/glib-genmarshal \
60                      ${bindir}/glib-gettextize \
61                      ${bindir}/glib-mkenums \
62                      ${bindir}/glib-compile-resources"
63
64FILES:${PN}-dev += "${libdir}/glib-2.0/include \
65                    ${libdir}/gio/modules/lib*${SOLIBSDEV} \
66                    ${libdir}/gio/modules/*.la \
67                    ${datadir}/glib-2.0/gettext/po/Makefile.in.in \
68                    ${datadir}/glib-2.0/schemas/gschema.dtd \
69                    ${datadir}/glib-2.0/valgrind/glib.supp \
70                    ${datadir}/gettext/its"
71FILES:${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb"
72FILES:${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \
73                       ${bindir}/gdbus-codegen"
74FILES:${PN}-utils = "${bindir}/*"
75
76SHAREDMIMEDEP = "shared-mime-info"
77SHAREDMIMEDEP:class-native = ""
78# When cross compiling for Windows we don't want to include this
79SHAREDMIMEDEP:mingw32 = ""
80
81RRECOMMENDS:${PN} += "${SHAREDMIMEDEP}"
82
83ARM_INSTRUCTION_SET:armv4 = "arm"
84ARM_INSTRUCTION_SET:armv5 = "arm"
85# Valgrind runtime detection works using hand-written assembly, which
86# doesn't support mips16e
87CPPFLAGS:append:class-target:mips16e = " -DNVALGRIND=1"
88
89# GLib generally requires gettext to be present so for USE_NLS to yes.  For
90# native builds as i18n is disabled globally we have to add a gettext-native dependency.
91USE_NLS:class-target = "yes"
92USE_NLS:class-nativesdk = "yes"
93DEPENDS:append:class-native = " gettext-native"
94
95EXEEXT = ""
96EXEEXT:mingw32 = ".exe"
97
98do_install:append () {
99	if [ -f ${D}${bindir}/gtester-report ]; then
100		sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|'
101	fi
102
103	# Remove some unpackaged files
104	rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__
105	rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
106	rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
107
108	if [ -e ${D}${libdir}/charset.alias ]; then
109		rm -f ${D}${libdir}/charset.alias
110	fi
111
112        # Make sure gio-querymodules is unique among multilibs
113        if test "x${MLPREFIX}" != "x"; then
114                mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT}
115        fi
116        # Autotools does this, meson does not
117        mkdir -p ${D}${libdir}/gio/modules
118}
119
120do_install:append:class-target () {
121	# Tests are only installed on targets, not native builds.  Separating this out
122	# keeps glib-2.0-native from depending on DISTRO_FEATURES
123	if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then
124		if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then
125			rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
126		fi
127	fi
128	if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then
129        if test "x${MLPREFIX}" != "x"; then
130                mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test
131        fi
132	fi
133}
134
135# As we do not build python3 for windows, makes no sense to ship the script that's using it
136do_install:append:mingw32() {
137        rm -f ${D}${bindir}/gtester-report
138}
139
140CODEGEN_PYTHON_RDEPENDS = "python3 python3-distutils python3-xml"
141CODEGEN_PYTHON_RDEPENDS:mingw32 = ""
142
143RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}"
144
145RDEPENDS:${PN}-ptest += "${PN}-utils"
146
147RDEPENDS:${PN}-ptest += "\
148            coreutils \
149            libgcc \
150            dbus \
151            gnome-desktop-testing \
152            tzdata \
153            tzdata-americas \
154            tzdata-asia \
155            tzdata-europe \
156            tzdata-posix \
157            shared-mime-info \
158            ${PN}-locale-ja \
159            ${PN}-locale-fr \
160            ${PN}-locale-el \
161            ${PN}-locale-hr \
162            ${PN}-locale-lt \
163            ${PN}-locale-pl \
164            ${PN}-locale-ru \
165            ${PN}-locale-th \
166            python3-core \
167            python3-modules \
168            ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-dbusmock', '', d)} \
169            ${PN}-codegen \
170           "
171
172RDEPENDS:${PN}-ptest:append:libc-glibc = "\
173            glibc-gconv-utf-16 \
174            glibc-charmap-utf-8 \
175            glibc-gconv-cp1255 \
176            glibc-charmap-cp1255 \
177            glibc-gconv-utf-32 \
178            glibc-gconv-utf-7 \
179            glibc-gconv-euc-jp \
180            glibc-gconv-iso8859-1 \
181            glibc-gconv-iso8859-15 \
182            glibc-charmap-invariant \
183            glibc-localedata-translit-cjk-variants \
184            locale-base-tr-tr \
185            locale-base-lt-lt \
186            locale-base-ja-jp.euc-jp \
187            locale-base-fa-ir \
188            locale-base-ru-ru \
189            locale-base-de-de \
190            locale-base-hr-hr \
191            locale-base-el-gr \
192            locale-base-fr-fr \
193            locale-base-es-es \
194            locale-base-en-gb \
195            locale-base-en-us \
196            locale-base-pl-pl \
197            locale-base-pl-pl.iso-8859-2 \
198           "
199