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 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 36 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | PACKAGECONFIG:class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
| 38 | PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 40 | 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] | 41 | # 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] | 42 | PACKAGECONFIG[opengl] = "-Dopengl=true,-Dopengl=false,libepoxy" |
| 43 | 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] | 44 | PACKAGECONFIG[cups] = ",,cups,cups gtk3-printbackend-cups" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 45 | PACKAGECONFIG[colord] = "-Dcolord=yes,-Dcolord=no,colord" |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 46 | PACKAGECONFIG[cloudproviders] = "-Dcloudproviders=true,-Dcloudproviders=false,libcloudproviders" |
| 47 | PACKAGECONFIG[tracker3] = "-Dtracker3=true,-Dtracker3=false,tracker,tracker-miners" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | prepare_gtk_scripts() { |
| 50 | 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] | 51 | |
| 52 | # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache |
| 53 | mkdir -p ${D}${libexecdir} |
| 54 | 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] | 55 | } |
| 56 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | do_install:append:class-target() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 58 | prepare_gtk_scripts |
| 59 | } |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | do_install:append:class-nativesdk() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 62 | prepare_gtk_scripts |
| 63 | } |
| 64 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 65 | do_install:append:class-native() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 66 | create_wrapper ${D}/${bindir}/gtk-update-icon-cache \ |
| 67 | GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache |
| 68 | create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \ |
| 69 | GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache |
| 70 | } |
| 71 | |
| 72 | PROVIDES += "gtk-icon-utils" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | PACKAGES =+ "${PN}-demo" |
| 74 | LIBV = "3.0.0" |
| 75 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | FILES:${PN}-demo = "${bindir}/gtk3-demo \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | ${bindir}/gtk3-demo-application \ |
| 78 | ${bindir}/gtk3-icon-browser \ |
| 79 | ${bindir}/gtk3-widget-factory \ |
| 80 | ${datadir}/gtk-3.0/demo \ |
| 81 | ${datadir}/applications/gtk3-demo.desktop \ |
| 82 | ${datadir}/applications/gtk3-icon-browser.desktop \ |
| 83 | ${datadir}/applications/gtk3-widget-factory.desktop \ |
| 84 | ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \ |
| 85 | ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png" |
| 86 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 87 | FILES:${PN}:append = " ${bindir}/gtk-update-icon-cache-3.0 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | ${bindir}/gtk-query-immodules-3.0 \ |
| 89 | ${bindir}/gtk-launch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 90 | ${datadir}/themes ${datadir}/gtk-3.0/emoji \ |
| 91 | ${sysconfdir} ${datadir}/glib-2.0/schemas/ \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \ |
| 93 | ${libdir}/gtk-3.0/modules/*.so" |
| 94 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 95 | FILES:${PN}-dev += " \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 96 | ${datadir}/gtk-3.0/gtkbuilder.rng \ |
| 97 | ${datadir}/gtk-3.0/include \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 98 | ${datadir}/gtk-3.0/valgrind \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 99 | ${datadir}/gettext/its \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 100 | ${libdir}/gtk-3.0/include \ |
| 101 | ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \ |
| 102 | ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \ |
| 103 | ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \ |
| 104 | ${libdir}/gtk-3.0/${LIBV}/engines/*.la \ |
| 105 | ${libdir}/gtk-3.0/modules/*.la \ |
| 106 | ${bindir}/gtk-builder-convert \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 107 | ${bindir}/gtk-encode-symbolic-svg \ |
| 108 | ${bindir}/gtk-builder-tool \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 109 | ${bindir}/gtk-query-settings \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 110 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 112 | GTKBASE_RRECOMMENDS ?= "liberation-fonts \ |
| 113 | gdk-pixbuf-loader-png \ |
| 114 | gdk-pixbuf-loader-jpeg \ |
| 115 | gdk-pixbuf-loader-gif \ |
| 116 | gdk-pixbuf-loader-xpm \ |
| 117 | shared-mime-info \ |
| 118 | adwaita-icon-theme-symbolic \ |
| 119 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 120 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 121 | GTKBASE_RRECOMMENDS:class-native ?= "\ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 122 | " |
| 123 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 124 | GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1" |
| 125 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 126 | RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}" |
| 127 | RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}" |
| 128 | RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 129 | |
| 130 | PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*" |
| 131 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 132 | ALTERNATIVE:${PN} = "gtk-update-icon-cache" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 133 | 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] | 134 | ALTERNATIVE_PRIORITY = "30" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 135 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 136 | python populate_packages:prepend () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 137 | import os.path |
| 138 | |
| 139 | gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}') |
| 140 | immodules_root = os.path.join(gtk_libdir, 'immodules') |
| 141 | printmodules_root = os.path.join(gtk_libdir, 'printbackends'); |
| 142 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 143 | 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] | 144 | if immodules: |
| 145 | d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules)) |
| 146 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 147 | 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] | 148 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 149 | if (d.getVar('DEBIAN_NAMES')): |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 150 | d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-3.0') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 151 | } |