Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 1 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | SUMMARY = "Multi-platform toolkit for creating GUIs" |
| 3 | DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \ |
| 4 | set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites." |
| 5 | HOMEPAGE = "http://www.gtk.org" |
| 6 | BUGTRACKER = "https://bugzilla.gnome.org/" |
| 7 | SECTION = "libs" |
| 8 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 9 | DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf gdk-pixbuf-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 11 | LICENSE = "LGPL-2.0-only & LGPL-2.0-or-later & LGPL-2.1-or-later" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 13 | inherit meson gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings features_check gobject-introspection |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 15 | BBCLASSEXTEND = "native nativesdk" |
| 16 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 17 | GSETTINGS_PACKAGE:class-native = "" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | # versions >= 3.90 are development versions, otherwise like upstream-version-is-even |
| 20 | UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar" |
| 21 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 22 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 24 | do_configure:prepend() { |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 25 | # These files are generated by wayland-scanner but will race over modification |
| 26 | # time between the copies in the sysroot from wayland-protocols and the copy |
| 27 | # in the source tree. Solve the race by deleting so they need to be regenerated. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 28 | rm -f ${S}/modules/input/*-text-input-*.[ch] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | } |
| 30 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 31 | GTKDOC_MESON_OPTION = 'gtk_doc' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 33 | EXTRA_OEMESON = "-Dxinerama=no -Dtests=false" |
| 34 | EXTRA_OEMESON:append:class-native = " -Ddemos=false -Dexamples=false" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 35 | |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 36 | PACKAGECONFIG ??= " \ |
| 37 | ${@bb.utils.filter('DISTRO_FEATURES', 'opengl x11', d)} \ |
| 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl wayland', 'wayland', '', d)} \ |
| 39 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 40 | PACKAGECONFIG:class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
| 41 | PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 43 | PACKAGECONFIG[x11] = "-Dx11_backend=true,-Dx11_backend=false,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 44 | # this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 45 | PACKAGECONFIG[opengl] = "-Dopengl=true,-Dopengl=false,libepoxy" |
| 46 | PACKAGECONFIG[wayland] = "-Dwayland_backend=true,-Dwayland_backend=false,wayland wayland-protocols libxkbcommon virtual/egl virtual/libgles2 wayland-native" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 47 | PACKAGECONFIG[cups] = ",,cups,cups gtk3-printbackend-cups" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 48 | PACKAGECONFIG[colord] = "-Dcolord=yes,-Dcolord=no,colord" |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 49 | PACKAGECONFIG[cloudproviders] = "-Dcloudproviders=true,-Dcloudproviders=false,libcloudproviders" |
| 50 | PACKAGECONFIG[tracker3] = "-Dtracker3=true,-Dtracker3=false,tracker,tracker-miners" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 52 | prepare_gtk_scripts() { |
| 53 | mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 54 | |
| 55 | # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache |
| 56 | mkdir -p ${D}${libexecdir} |
| 57 | ln ${D}${bindir}/gtk-query-immodules-3.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-3.0 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | } |
| 59 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 60 | do_install:append:class-target() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 61 | prepare_gtk_scripts |
| 62 | } |
| 63 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 64 | do_install:append:class-nativesdk() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 65 | prepare_gtk_scripts |
| 66 | } |
| 67 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | do_install:append:class-native() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 69 | create_wrapper ${D}/${bindir}/gtk-update-icon-cache \ |
| 70 | GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache |
| 71 | create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \ |
| 72 | GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache |
| 73 | } |
| 74 | |
| 75 | PROVIDES += "gtk-icon-utils" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 76 | PACKAGES =+ "${PN}-demo" |
| 77 | LIBV = "3.0.0" |
| 78 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 79 | FILES:${PN}-demo = "${bindir}/gtk3-demo \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | ${bindir}/gtk3-demo-application \ |
| 81 | ${bindir}/gtk3-icon-browser \ |
| 82 | ${bindir}/gtk3-widget-factory \ |
| 83 | ${datadir}/gtk-3.0/demo \ |
| 84 | ${datadir}/applications/gtk3-demo.desktop \ |
| 85 | ${datadir}/applications/gtk3-icon-browser.desktop \ |
| 86 | ${datadir}/applications/gtk3-widget-factory.desktop \ |
| 87 | ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \ |
| 88 | ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png" |
| 89 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 90 | FILES:${PN}:append = " ${bindir}/gtk-update-icon-cache-3.0 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | ${bindir}/gtk-query-immodules-3.0 \ |
| 92 | ${bindir}/gtk-launch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 93 | ${datadir}/themes ${datadir}/gtk-3.0/emoji \ |
| 94 | ${sysconfdir} ${datadir}/glib-2.0/schemas/ \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \ |
| 96 | ${libdir}/gtk-3.0/modules/*.so" |
| 97 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 98 | FILES:${PN}-dev += " \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 99 | ${datadir}/gtk-3.0/gtkbuilder.rng \ |
| 100 | ${datadir}/gtk-3.0/include \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 101 | ${datadir}/gtk-3.0/valgrind \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 102 | ${datadir}/gettext/its \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 103 | ${libdir}/gtk-3.0/include \ |
| 104 | ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \ |
| 105 | ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \ |
| 106 | ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \ |
| 107 | ${libdir}/gtk-3.0/${LIBV}/engines/*.la \ |
| 108 | ${libdir}/gtk-3.0/modules/*.la \ |
| 109 | ${bindir}/gtk-builder-convert \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 110 | ${bindir}/gtk-encode-symbolic-svg \ |
| 111 | ${bindir}/gtk-builder-tool \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 112 | ${bindir}/gtk-query-settings \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 113 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 114 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 115 | GTKBASE_RRECOMMENDS ?= "liberation-fonts \ |
| 116 | gdk-pixbuf-loader-png \ |
| 117 | gdk-pixbuf-loader-jpeg \ |
| 118 | gdk-pixbuf-loader-gif \ |
| 119 | gdk-pixbuf-loader-xpm \ |
| 120 | shared-mime-info \ |
| 121 | adwaita-icon-theme-symbolic \ |
| 122 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 123 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 124 | GTKBASE_RRECOMMENDS:class-native ?= "\ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 125 | " |
| 126 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 127 | GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1" |
| 128 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}" |
| 130 | RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}" |
| 131 | RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 132 | |
| 133 | PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*" |
| 134 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 135 | ALTERNATIVE:${PN} = "gtk-update-icon-cache" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 136 | ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 137 | ALTERNATIVE_PRIORITY = "30" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 138 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 139 | python populate_packages:prepend () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 140 | import os.path |
| 141 | |
| 142 | gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}') |
| 143 | immodules_root = os.path.join(gtk_libdir, 'immodules') |
| 144 | printmodules_root = os.path.join(gtk_libdir, 'printbackends'); |
| 145 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 146 | immodules = do_split_packages(d, immodules_root, r'^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 147 | if immodules: |
| 148 | d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules)) |
| 149 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 150 | do_split_packages(d, printmodules_root, r'^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 151 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 152 | if (d.getVar('DEBIAN_NAMES')): |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 153 | d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-3.0') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 154 | } |