glib.inc 7.5 KB

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