Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Multi-platform toolkit for creating GUIs" |
| 2 | DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \ |
| 3 | set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites." |
| 4 | HOMEPAGE = "http://www.gtk.org" |
| 5 | BUGTRACKER = "https://bugzilla.gnome.org/" |
| 6 | SECTION = "libs" |
| 7 | |
| 8 | DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | gdk-pixbuf-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | |
| 11 | LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" |
| 12 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 13 | inherit autotools gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check gobject-introspection |
| 14 | |
| 15 | # versions >= 3.90 are development versions, otherwise like upstream-version-is-even |
| 16 | UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar" |
| 17 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 18 | ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
| 20 | # This should be in autotools.bbclass, but until something elses uses it putting |
| 21 | # it here avoids rebuilding everything. |
| 22 | export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native" |
| 23 | |
| 24 | do_configure_prepend() { |
| 25 | # Do this because the configure script is running ./libtool directly |
| 26 | rm -f libtool |
| 27 | ln -s ${TARGET_PREFIX}libtool libtool |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 28 | #delete a file that will get confused with generated one in ${B} |
| 29 | rm -f ${S}/gtk/gtktypefuncs.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | EXTRA_OECONF += " \ |
| 33 | --disable-glibtest \ |
| 34 | --disable-xinerama \ |
| 35 | --enable-modules \ |
| 36 | --disable-cups \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 37 | --disable-colord \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 38 | ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \ |
| 39 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 41 | do_compile_prepend() { |
| 42 | export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs" |
| 43 | } |
| 44 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 45 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \ |
| 46 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | |
| 48 | 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] | 49 | # this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build |
| 50 | PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 51 | PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 52 | PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/mesa wayland-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | |
| 54 | do_install_append() { |
| 55 | 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] | 56 | |
| 57 | # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache |
| 58 | mkdir -p ${D}${libexecdir} |
| 59 | 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] | 60 | } |
| 61 | |
| 62 | PACKAGES =+ "${PN}-demo" |
| 63 | LIBV = "3.0.0" |
| 64 | |
| 65 | FILES_${PN}-demo = "${bindir}/gtk3-demo \ |
| 66 | ${bindir}/gtk3-demo-application \ |
| 67 | ${bindir}/gtk3-icon-browser \ |
| 68 | ${bindir}/gtk3-widget-factory \ |
| 69 | ${datadir}/gtk-3.0/demo \ |
| 70 | ${datadir}/applications/gtk3-demo.desktop \ |
| 71 | ${datadir}/applications/gtk3-icon-browser.desktop \ |
| 72 | ${datadir}/applications/gtk3-widget-factory.desktop \ |
| 73 | ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \ |
| 74 | ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png" |
| 75 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 76 | FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | ${bindir}/gtk-query-immodules-3.0 \ |
| 78 | ${bindir}/gtk-launch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 79 | ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \ |
| 80 | ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \ |
| 81 | ${libdir}/gtk-3.0/modules/*.so" |
| 82 | |
| 83 | FILES_${PN}-dev += " \ |
| 84 | ${datadir}/gtk-3.0/gtkbuilder.rng \ |
| 85 | ${datadir}/gtk-3.0/include \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 86 | ${datadir}/gettext/its \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 87 | ${libdir}/gtk-3.0/include \ |
| 88 | ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \ |
| 89 | ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \ |
| 90 | ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \ |
| 91 | ${libdir}/gtk-3.0/${LIBV}/engines/*.la \ |
| 92 | ${libdir}/gtk-3.0/modules/*.la \ |
| 93 | ${bindir}/gtk-builder-convert \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 94 | ${bindir}/gtk-encode-symbolic-svg \ |
| 95 | ${bindir}/gtk-builder-tool \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 96 | ${bindir}/gtk-query-settings \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 97 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 98 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 99 | GTKBASE_RRECOMMENDS ?= "liberation-fonts \ |
| 100 | gdk-pixbuf-loader-png \ |
| 101 | gdk-pixbuf-loader-jpeg \ |
| 102 | gdk-pixbuf-loader-gif \ |
| 103 | gdk-pixbuf-loader-xpm \ |
| 104 | shared-mime-info \ |
| 105 | adwaita-icon-theme-symbolic \ |
| 106 | " |
| 107 | GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1" |
| 108 | |
| 109 | RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}" |
| 110 | RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}" |
| 111 | RDEPENDS_${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | |
| 113 | PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*" |
| 114 | |
| 115 | ALTERNATIVE_${PN} = "gtk-update-icon-cache" |
| 116 | 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] | 117 | ALTERNATIVE_PRIORITY = "30" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | |
| 119 | python populate_packages_prepend () { |
| 120 | import os.path |
| 121 | |
| 122 | gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}') |
| 123 | immodules_root = os.path.join(gtk_libdir, 'immodules') |
| 124 | printmodules_root = os.path.join(gtk_libdir, 'printbackends'); |
| 125 | |
| 126 | immodules = do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s') |
| 127 | if immodules: |
| 128 | d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules)) |
| 129 | |
| 130 | do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s') |
| 131 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 132 | if (d.getVar('DEBIAN_NAMES')): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 133 | d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 134 | } |