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