blob: 420ead2ca2e4062ee4ebb49d1e612260e888108e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Multi-platform toolkit for creating GUIs"
2DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
3set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
4HOMEPAGE = "http://www.gtk.org"
5BUGTRACKER = "https://bugzilla.gnome.org/"
6SECTION = "libs"
7
8DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009 gdk-pixbuf-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
11LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
12
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013inherit 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
16UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar"
17
Patrick Williamsf1e5d692016-03-30 15:21:19 -050018ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
20# This should be in autotools.bbclass, but until something elses uses it putting
21# it here avoids rebuilding everything.
22export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
23
24do_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 Williamsc0f7c042017-02-23 20:41:17 -060028 #delete a file that will get confused with generated one in ${B}
29 rm -f ${S}/gtk/gtktypefuncs.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030}
31
32EXTRA_OECONF += " \
33 --disable-glibtest \
34 --disable-xinerama \
35 --enable-modules \
36 --disable-cups \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037 --disable-colord \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060038 ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \
39 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050041do_compile_prepend() {
42 export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
43}
44
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \
46 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047
48PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060049# this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
50PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050051PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060052PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/mesa wayland-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053
54do_install_append() {
55 mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
56}
57
58PACKAGES =+ "${PN}-demo"
59LIBV = "3.0.0"
60
61FILES_${PN}-demo = "${bindir}/gtk3-demo \
62 ${bindir}/gtk3-demo-application \
63 ${bindir}/gtk3-icon-browser \
64 ${bindir}/gtk3-widget-factory \
65 ${datadir}/gtk-3.0/demo \
66 ${datadir}/applications/gtk3-demo.desktop \
67 ${datadir}/applications/gtk3-icon-browser.desktop \
68 ${datadir}/applications/gtk3-widget-factory.desktop \
69 ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
70 ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
71
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050072FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 ${bindir}/gtk-query-immodules-3.0 \
74 ${bindir}/gtk-launch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
76 ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
77 ${libdir}/gtk-3.0/modules/*.so"
78
79FILES_${PN}-dev += " \
80 ${datadir}/gtk-3.0/gtkbuilder.rng \
81 ${datadir}/gtk-3.0/include \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060082 ${datadir}/gettext/its \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083 ${libdir}/gtk-3.0/include \
84 ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
85 ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
86 ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
87 ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
88 ${libdir}/gtk-3.0/modules/*.la \
89 ${bindir}/gtk-builder-convert \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050090 ${bindir}/gtk-encode-symbolic-svg \
91 ${bindir}/gtk-builder-tool \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060092 ${bindir}/gtk-query-settings \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050093 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050094
Patrick Williamsc0f7c042017-02-23 20:41:17 -060095GTKBASE_RRECOMMENDS ?= "liberation-fonts \
96 gdk-pixbuf-loader-png \
97 gdk-pixbuf-loader-jpeg \
98 gdk-pixbuf-loader-gif \
99 gdk-pixbuf-loader-xpm \
100 shared-mime-info \
101 adwaita-icon-theme-symbolic \
102 "
103GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
104
105RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
106RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
107RDEPENDS_${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108
109PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
110
111ALTERNATIVE_${PN} = "gtk-update-icon-cache"
112ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500113ALTERNATIVE_PRIORITY = "30"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500114
115python populate_packages_prepend () {
116 import os.path
117
118 gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
119 immodules_root = os.path.join(gtk_libdir, 'immodules')
120 printmodules_root = os.path.join(gtk_libdir, 'printbackends');
121
122 immodules = do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s')
123 if immodules:
124 d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
125
126 do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
127
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500128 if (d.getVar('DEBIAN_NAMES')):
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500129 d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130}