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 | |
| 9 | DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | gdk-pixbuf-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
| 12 | LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" |
| 13 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 14 | inherit autotools 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] | 15 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | BBCLASSEXTEND = "native nativesdk" |
| 17 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 18 | GSETTINGS_PACKAGE:class-native = "" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 19 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | # versions >= 3.90 are development versions, otherwise like upstream-version-is-even |
| 21 | UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar" |
| 22 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 23 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | |
| 25 | # This should be in autotools.bbclass, but until something elses uses it putting |
| 26 | # it here avoids rebuilding everything. |
| 27 | export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native" |
| 28 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 29 | do_configure:prepend() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 30 | #delete a file that will get confused with generated one in ${B} |
| 31 | rm -f ${S}/gtk/gtktypefuncs.c |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 32 | |
| 33 | # These files are generated by wayland-scanner but will race over modification |
| 34 | # time between the copies in the sysroot from wayland-protocols and the copy |
| 35 | # in the source tree. Solve the race by deleting so they need to be regenerated. |
| 36 | # 3.24.22 will not be shipping these files so this can be deleted then: |
| 37 | # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2183 |
| 38 | rm -f ${S}/modules/input/text-input-unstable-v3*.[ch] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | EXTRA_OECONF += " \ |
| 42 | --disable-glibtest \ |
| 43 | --disable-xinerama \ |
| 44 | --enable-modules \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 45 | ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \ |
| 46 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 48 | do_compile:prepend() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 49 | export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs" |
| 50 | } |
| 51 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 52 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \ |
| 53 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | PACKAGECONFIG:class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
| 55 | PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | |
| 57 | PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,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] | 58 | # this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build |
| 59 | PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 60 | PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl" |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 61 | PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/egl virtual/libgles2 wayland-native" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 62 | PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 63 | PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 64 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 65 | prepare_gtk_scripts() { |
| 66 | 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] | 67 | |
| 68 | # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache |
| 69 | mkdir -p ${D}${libexecdir} |
| 70 | 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] | 71 | } |
| 72 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 73 | do_install:append:class-target() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 74 | prepare_gtk_scripts |
| 75 | } |
| 76 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 77 | do_install:append:class-nativesdk() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 78 | prepare_gtk_scripts |
| 79 | } |
| 80 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 81 | do_install:append:class-native() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 82 | create_wrapper ${D}/${bindir}/gtk-update-icon-cache \ |
| 83 | GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache |
| 84 | create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \ |
| 85 | GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache |
| 86 | } |
| 87 | |
| 88 | PROVIDES += "gtk-icon-utils" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 89 | PACKAGES =+ "${PN}-demo" |
| 90 | LIBV = "3.0.0" |
| 91 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 92 | FILES:${PN}-demo = "${bindir}/gtk3-demo \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 93 | ${bindir}/gtk3-demo-application \ |
| 94 | ${bindir}/gtk3-icon-browser \ |
| 95 | ${bindir}/gtk3-widget-factory \ |
| 96 | ${datadir}/gtk-3.0/demo \ |
| 97 | ${datadir}/applications/gtk3-demo.desktop \ |
| 98 | ${datadir}/applications/gtk3-icon-browser.desktop \ |
| 99 | ${datadir}/applications/gtk3-widget-factory.desktop \ |
| 100 | ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \ |
| 101 | ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png" |
| 102 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 103 | FILES:${PN}:append = " ${bindir}/gtk-update-icon-cache-3.0 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 104 | ${bindir}/gtk-query-immodules-3.0 \ |
| 105 | ${bindir}/gtk-launch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 106 | ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \ |
| 107 | ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \ |
| 108 | ${libdir}/gtk-3.0/modules/*.so" |
| 109 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 110 | FILES:${PN}-dev += " \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | ${datadir}/gtk-3.0/gtkbuilder.rng \ |
| 112 | ${datadir}/gtk-3.0/include \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 113 | ${datadir}/gtk-3.0/valgrind \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 114 | ${datadir}/gettext/its \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 115 | ${libdir}/gtk-3.0/include \ |
| 116 | ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \ |
| 117 | ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \ |
| 118 | ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \ |
| 119 | ${libdir}/gtk-3.0/${LIBV}/engines/*.la \ |
| 120 | ${libdir}/gtk-3.0/modules/*.la \ |
| 121 | ${bindir}/gtk-builder-convert \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 122 | ${bindir}/gtk-encode-symbolic-svg \ |
| 123 | ${bindir}/gtk-builder-tool \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 124 | ${bindir}/gtk-query-settings \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 125 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 126 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 127 | GTKBASE_RRECOMMENDS ?= "liberation-fonts \ |
| 128 | gdk-pixbuf-loader-png \ |
| 129 | gdk-pixbuf-loader-jpeg \ |
| 130 | gdk-pixbuf-loader-gif \ |
| 131 | gdk-pixbuf-loader-xpm \ |
| 132 | shared-mime-info \ |
| 133 | adwaita-icon-theme-symbolic \ |
| 134 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 135 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 136 | GTKBASE_RRECOMMENDS:class-native ?= "\ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 137 | " |
| 138 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 139 | GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1" |
| 140 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 141 | RRECOMMENDS:${PN} = "${GTKBASE_RRECOMMENDS}" |
| 142 | RRECOMMENDS:${PN}:libc-glibc = "${GTKGLIBC_RRECOMMENDS}" |
| 143 | RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 144 | |
| 145 | PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*" |
| 146 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 147 | ALTERNATIVE:${PN} = "gtk-update-icon-cache" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 148 | 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] | 149 | ALTERNATIVE_PRIORITY = "30" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 150 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 151 | python populate_packages:prepend () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 152 | import os.path |
| 153 | |
| 154 | gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}') |
| 155 | immodules_root = os.path.join(gtk_libdir, 'immodules') |
| 156 | printmodules_root = os.path.join(gtk_libdir, 'printbackends'); |
| 157 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 158 | 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] | 159 | if immodules: |
| 160 | d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules)) |
| 161 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 162 | 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] | 163 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 164 | if (d.getVar('DEBIAN_NAMES')): |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 165 | d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-3.0') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 166 | } |